Skip to content
GitHubSupport

Backups and restore

arikan backup

The archive mikan-YYYYMMDD-HHMMSS.tar.gz appears in /opt/mikan/backups. It holds config.json and secrets/ (.env on a server set up before 0.5.2.0), compose.yaml, a consistent database snapshot, the panel’s certificates, node data and payment adapter settings. All of the server’s secrets are inside, so the folder is accessible only to root.

Before risky operations Arikan makes backups by itself and keeps a few of the latest:

When How many are kept
before an update 5
before moving to PostgreSQL 3
before a restore 3

Your own Arikan-* archives are never deleted automatically.

arikan restore /opt/mikan/backups/Arikan-20261001-031500.tar.gz

Before restoring, the program checks the archive, stops the containers and saves a snapshot of the current state. If a step fails, everything goes back as it was. The server’s own database password, image and version are kept, so a backup can be moved to a freshly installed server. A panel backup will not fit a node, and the other way round.

  • -y asks no questions.
  • --no-db-snapshot does not copy the current database before replacing it: for a PostgreSQL that is so broken it cannot be dumped. If the restore fails, the current data is lost.

An archive with only the database (like a backup from Telegram) restores only the database: the server’s files — config.json, secrets/, certificates and adapters — stay as they are. The settings inside the database do come from the archive, though: the panel’s address and port, the subscription domain and paths, the bot token.

After a restore Arikan compares the database’s panel_port setting with the port the panel listens on (PANEL_PORT in config.json). When the database’s port is free here, the panel comes up on it — at the address it had, with the old links and every node’s address: PANEL_PORT is rewritten, the port is opened in ufw, and arikan restore says which address it ended with. When the port is held, the panel stays on its own listener and corrects the panel_port setting at start (both ports are in the log); arikan restore names both ports and the one that stayed. A full archive is fitted the same way: its PANEL_PORT and the database’s panel_port must agree, and otherwise the restore says what is left and what to do about it.

The join key stays this server’s too: after such a restore every node has to join again (issue a new key on the Nodes page, then mikan join on the node). Old SQLite backups restore onto a PostgreSQL panel too. A restore replaces the whole database.

arikan doctor shows the same comparison: the port from the database against the listener, and the panel’s domain against this server’s addresses.

Telegram → Infrastructure → Backups to Telegram: every day at the chosen hour (UTC) the panel sends an encrypted database backup to the admin chat. You need to connect the admin chat, see Alerts.

  • Encryption password: at least 20 characters, with a “Generate” button. A lost password cannot be recovered.
  • “Send now” sends a backup right away.
  • The backup holds only the database: users, plans, settings, the bot token. It has no settings files (config.json, secrets/), certificates or node keys, so keep server backups for those.
  • The file is at most 50 MB, which is the limit for Telegram bots.

To restore on the server (you need the age utility):

age -d -o Arikan.tar.gz Arikan-….tar.gz.age
arikan restore Arikan.tar.gz