Restore a backup
Copies this page as Markdown with context, so an AI can walk you through your case step by step.
A backup you've never restored is an assumption. Restoring takes two commands.
Option 1: with the agent
restore downloads the snapshot, checks it wasn’t tampered with, decrypts it and decompresses it into the file you give it:
sudo ganyant-agent restore shop_prod --at latest --to ./shop_prod.dump
--at takes latest or a date, for example "2026-11-14 03:00": it gives you the snapshot that was current at that moment. --to is always a file.
It works on any server with the agent from the same workspace and the same passphrase, so it’s also how you move data to a new machine.
Option 2: from the dashboard
- In Backups → Snapshots, click Download next to the snapshot. You get an encrypted
.gyafile. - On a machine with the agent installed, decrypt it (it asks for the passphrase):
ganyant-agent decrypt snapshot.gya --out shop_prod.dump
Load the dump
PostgreSQL
pg_restore --clean --if-exists --no-owner --dbname shop_prod ./shop_prod.dump
MySQL / MariaDB
sudo ganyant-agent restore wordpress --at latest --to ./wordpress.sql
mysql --defaults-extra-file=/etc/ganyant/mysql.cnf wordpress < ./wordpress.sql
MongoDB
sudo ganyant-agent restore app --at latest --to ./app.archive
mongorestore --archive=./app.archive --drop
SQLite
The restored file is the database:
sudo ganyant-agent restore app_db --at latest --to ./data.db
Folder
It’s restored as a .tar:
sudo ganyant-agent restore uploads --at latest --to ./uploads.tar
mkdir -p /srv/restore && tar -xf ./uploads.tar -C /srv/restore
If something doesn’t match
If the file was altered or is incomplete, verification fails and nothing is written. If the passphrase is wrong, decryption fails with a clear error: check it’s the same one that was in agent.toml when the backup was made.
Good practice
Test a full restore in a separate environment at least once, and after every big change to your database.