Překlad není k dispozici
Tento článek zatím není přeložen do jazyka Čeština. Zobrazuje se anglická verze.
Backup restore
This guide gets a backup from the backup service back onto a server. The restore assistant in the administration creates a download link for the server and the exact commands for the file: download, checksum check, decryption, decompression and import into PostgreSQL, MySQL, a folder or a Docker volume. You copy the commands one by one; nothing has to be worked out by hand.
Backups cannot be downloaded through the API. This is deliberate: a compromised server that holds a backup key cannot read your backups. Every restore therefore starts in the administration.
What you need before you start
- A user with permission for the Backups module in the administration.
- Shell access with
sudoon the target server, andcurlandsha256sumthere. - The tools for the file:
zstd,gzip,xz,bzip2orlz4for decompression,gpgoragefor an encrypted file, andpsql,pg_restore,mysql,tarordockerfor the import. - For an encrypted backup, your own decryption key. BizKitHub never holds it.
Warning. Restoring overwrites data in the target database, folder or volume. Try the restore on a test server or into a new database first, and restore over production data only when you are sure.
Steps
- Open System → Backups and find the backup in the list or in a series. Choose the last backup you know is good; with ransomware or a damaged export, that may not be the newest one.
- Open the backup detail and click Restore to a server.
- The dialog shows what the file is (for example a PostgreSQL SQL dump or a tar archive) and the numbered steps. The download link in the steps is valid for 1 hour.
- Run the steps one by one on the target server. Fill in the values in angle brackets, such as
<database>or<volume>.
The download link is recorded in the activity log of your organisation with the user who created it. If the primary copy cannot be served, the link points to the copy in the second datacentre in Nuremberg, and the dialog says so.
What the steps look like
The assistant reads the file name from the outside in: encryption first, then compression, then the format. The series type helps to tell a PostgreSQL dump from a MySQL dump. A nightly PostgreSQL backup made by the installer, web-01-pg-20261126-023000_aB3dE5fG7hJ9kL1m.sql.zst, gives these steps:
curl -fL --retry 5 -o 'web-01-pg-20261126-023000_aB3dE5fG7hJ9kL1m.sql.zst' 'https://…'
echo '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 web-01-pg-20261126-023000_aB3dE5fG7hJ9kL1m.sql.zst' | sha256sum -c -
zstd -dc 'web-01-pg-20261126-023000_aB3dE5fG7hJ9kL1m.sql.zst' | sudo -u postgres psql -v ON_ERROR_STOP=1 postgres
| File | Restore step |
|---|---|
PostgreSQL SQL dump (.sql, type contains pg or postgres) |
Piped into psql as the postgres user, stopping at the first error. |
PostgreSQL custom dump (.dump, .backup, .pgdump) |
pg_restore --clean --if-exists --no-owner into a database you name. |
MySQL or MariaDB dump (.sql, type contains mysql or maria) |
Piped into mysql. |
| Other SQL file | Unpacked to a plain .sql file for you to import. |
| tar archive | First a preview of the contents, then extraction into /restore. Copy the files to their place yourself. |
Docker volume (.tar, type contains docker) |
Extracted into a volume you name, through a temporary container. |
| Anything else | Downloaded, and unpacked when it is compressed or encrypted. |
Checksum
When a checksum is known, the second step checks the downloaded file with sha256sum -c. The assistant uses the checksum the platform computed during the integrity check, or the one your client sent. OK means the file is exactly the stored backup; continue only then.
Encrypted files
Files ending in .gpg, .pgp or .asc are decrypted with gpg --decrypt, files ending in .age with age --decrypt -i /path/to/key.txt. Replace the key path with yours. For a backup marked as encrypted without one of these extensions, the assistant reminds you to decrypt it with your own tool first.
Download in the browser
For a quick look at a backup, the Download action in the backup list downloads the file to your computer. That link is valid for 15 minutes and is recorded in the activity log too.
Verifying it worked
- The checksum step prints
OK. - The import step finishes without an error.
psqlstops at the first error because ofON_ERROR_STOP. - The restored application starts and shows the data from the time of the backup.
What can go wrong
| Symptom | Cause and fix |
|---|---|
curl: (22) … 403 |
The link expired after 1 hour. Click Restore to a server again for a new link. |
sha256sum: WARNING: 1 computed checksum did NOT match |
The download is incomplete or damaged. Download again; if it repeats, contact [email protected] with the backup identifier. |
zstd: command not found (or gzip, xz, lz4) |
Install the tool on the target server. |
gpg: decryption failed: No secret key |
The server does not have your private key. Import it, or decrypt on a machine that has it. |
psql: … already exists errors |
The target database is not empty. Restore into a new, empty database, or drop the old one first if you are sure. |
| The restore cannot be prepared | Only completed backups can be restored. Failed and cancelled uploads have no stored file. |
Related
- Backup service
- Backup service setup
- Backup troubleshooting
- Backup and recovery: recovery of your BizKitHub data.
Související
- Backup service setupThis guide connects a Linux server to the backup service. The recommended way is one command: you choose what to back up and when in the…
- GuidesIndex of BizKitHub developer guides covering authentication, webhooks, rate limiting, error handling, and advanced filtering, with reading time and…
- Backup serviceThe backup service stores backups of your own servers and applications: database dumps, website files, Docker volumes, anything you can pack into one…
- Backup troubleshootingThis article helps you when a backup sent to the backup service did not arrive, failed, or triggered an alert. Each section starts with the symptom…
- Backup APIThe backup API lets your own scripts and applications upload backups to the backup service and read their state. It lives under…
- Backup and recoveryOverview of the upcoming BizKitHub backup and recovery documentation covering automated backups, encrypted storage, and fast restore procedures.