{% extends "admin/dbs/wiki/_layout.html" %} {% block wiki %}

The DBS manager

The DBS manager is a separate application in the same package. Install it with its extra and run it on your own machine:

pip install "django-dbs[manager]"
django_dbs run

If the shell says django_dbs is not recognized, pip put the script in a folder that is not on your PATH. Run python -m dbs.manager run instead, or install with pipx install "django-dbs[manager]".

It opens in your browser and looks after many servers over SSH: it pulls their backups, keeps their .env versions and folder archives, and moves a project onto a new server, with a way back if the move stops.

How it takes this server's backups

This server pushes nothing. Each time the manager backs it up, it first collects the backups it left waiting here, then runs manage.py dbs backup --stream and receives the new backup as it is written. A copy stays in DBS_BACKUP_DIR, so a backup whose connection breaks is collected the next time the manager connects. Once the manager has checked its own copy, it removes the copies it left here, keeping as many as the plan says (none by default). This server keeps at most five streamed backups per name.

The passphrase

The manager stores this server's backup passphrase, sealed, read from the server while it is added and before its first backup. It must never change: the backups taken with it would no longer open.

Accounts

The master account manages the other accounts, each an admin, an operator or a viewer, each allowed less than the one before. Every sign-in takes the password and a code from an authenticator app, set up at the first sign-in, and passwords expire after 30 days. From a shell: django_dbs createuser NAME --role operator, django_dbs account list|role|disable|enable|reset-2fa and django_dbs password NAME.

From a terminal

Everything the manager's interface does is also a command, on the same data and the same audit trail:

django_dbs server add web --host app.example.com --user deploy --ssh-password
django_dbs backup take --all
django_dbs backup list --server web

server add shows the host key fingerprint to confirm, finds this project and the Python that has django-dbs, and checks the server. Actions the interface protects with your password ask for it in the terminal too. django_dbs AREA VERB --help lists the rest: server, backup, plan, activity, env, files and redeploy.

With Claude

django_dbs mcp lets Claude add servers, take and verify backups, set up plans and rehearse restores and moves (claude mcp add dbs -- django_dbs mcp). Before it adds a server, you confirm the host key yourself, in the manager or with django_dbs server confirm-host-key ID. It never reveals a secret, never takes your account password, and cannot restore or move for real, make a plan keep fewer backups, or remove or delete anything.

Letting it reach this project

  1. Open Connection and press Copy.
  2. In the manager, choose Add a server and paste the snippet, or run django_dbs server add. Without one, the manager searches the server for the project once it can sign in, and Browse the server lets you pick its folder from the server's own folders.
  3. Confirm the host key fingerprint matches the one shown on the Connection page.
  4. Add the key the manager shows to ~/.ssh/authorized_keys for the user that owns this project.
  5. Store the passphrase before the first backup.

The manager takes backups with dbs backup --stream, so this project needs django-dbs 0.7 or later and DBS_BACKUP_DIR.

If this project runs in a Docker Compose service, choose In a Docker Compose service under Where the project runs and name the service, or pass --runtime compose --compose-service backend to server add. The manager then runs every manage.py command inside that service with docker compose exec, from the project folder. The SSH user must be able to run docker compose and the service must be running, with django-dbs installed in its image and DBS_BACKUP_DIR set.

This project never contacts the manager and keeps nothing about it. A backup the manager asks for is written to DBS_BACKUP_DIR and recorded in the audit trail like any other backup.

{% endblock %}