HF PanelDocsv1.0.0

Panel backup

Back up the control panel itself every night into one encrypted file, copy it to your backup storage, and bring a lost server back from it.

The Panel backup screen backs up HF Panel itself, not your customers' accounts. Every night the panel packs its database, settings file, server key and system files into one encrypted file and copies it to your backup storage. If the server is lost, you install HF Panel on a new server and put the panel back from this file.

Where: Server Admin › System › Panel backup

Customer accounts have their own nightly backups (see Backups). The panel backup does not contain websites, mail or databases.

What is in the file

  • the panel database (logins, accounts, packages, invoices, tickets, settings)
  • the settings file and the server key, which opens saved passwords and keys
  • the files in /etc/hostfog, the panel's nginx configuration and the company mail file

Important: the file holds the server key, so it is never made without a passphrase. Nothing in it can be read without the passphrase, not even on your own backup storage.

Switch it on

  1. In Passphrase, enter a passphrase of at least 12 characters twice and click Save.
  2. In Settings, tick Back up the panel every night.
  3. Choose the Time (server time) and the number of Copies to keep (1–60, 7 by default).
  4. Under Send it to, tick the backup storages that should receive the file. Add storage first under Backup storage if the list is empty.
  5. Click Save.

Warning: write the passphrase down and keep it somewhere safe, away from this server. Nobody, including HostFog, can open a panel backup without it.

If a storage is chosen, older copies beyond Copies to keep are deleted from it and from this server. Copies are kept in /var/lib/hostfog/panel-backups.

Check the result

The coloured line at the top and the dashboard show the state:

State Meaning
green the last backup worked and reached a storage
amber no backup yet, it is overdue, or the copy is only on this server
red the last backup failed, with the reason

The Last backup card shows when it ran and how each storage went. Click Back up now to make one at once, or Check the newest copy to open the newest copy on this server with the saved passphrase and test that it is complete. Copies lists the files on this server and, when you click a storage, on that storage.

A failed run is retried after an hour, up to three times a night, and raises the Panel backup failed alert and the panelarc.failed event hook. A successful run raises panelarc.finished.

Disaster recovery: the server is lost

  1. Install HF Panel on a new server, the same way as the first time, and create the first administrator login.

  2. Add the same backup storage as on the old server under Backup storage. Or, if you cannot sign in yet, put its settings in a JSON file (for S3 storage: endpoint, region, bucket, access_key, secret_key, prefix) and use --storage below.

  3. Bring the panel back, as root:

    bash
    sudo hf-panel restore-panel remote --host old-server-name --system
    

    Use --host with the old server's panel host name, because copies are stored in a folder named after the server that made them. Without --host the new server's own name is used. The command lists the copies on the storage, fetches the newest, asks for the passphrase, shows when and where the copy was made, and asks you to type yes.

  4. The panel database, the settings file and the server key are replaced, the panel restarts, and the old database is kept as hostfog.before-restore-<date>.sqlite. With --system the files in /etc/hostfog and the nginx configs come back too; nginx is tested first, and if it refuses them (for example because the SSL certificates are not on the new server yet) the old files are put back. Run sudo hf-panel ssl-now and repeat the command if that happens.

  5. Sign in with your old administrator login. Check Server Admin › Accounts, point the DNS records at the new server and renew the SSL certificates.

  6. Restore the customers' accounts from their own backups: copy them from your off-server backup storage (see Backups), then restore each account from its Backups page in the Control Panel.

To restore from a file instead of a storage: sudo hf-panel restore-panel /path/to/panel-full-20261024-020000.hfpa.

Tip: practise this once on a spare server before you need it.