4. Back it up, and prove the backup comes back
A nightly backup with the databases, an encrypted copy off the server, and a rehearsal that shows it restores.
Goal: a backup of your application and its database every night, a copy of each one off the server, encrypted, and a rehearsal that shows it restores.
Time: five minutes.
You need: a deployed application, ideally with a database, and for the copy off the server, an account at an object store or an SSH server you can write to. The example uses Backblaze B2.
The examples use Kelmoor's application wrenfield.io on its server fra-1.
Steps
-
Take a backup now.
Shellnoust backup create wrenfield.io -m "Before the launch" --include-databasesA backup is one file under
/var/backups/noust/wrenfield-io/, with its checksum. It holds the release that serves, the.envand a dump of each database the application uses, so it restores on a server that knows nothing about this one. -
See it.
Shellnoust backup list wrenfield.ioEach line starts with the backup's id, such as
wrenfield-io_20261029_181502, which every other backup command takes. -
Back it up every night.
Shellnoust backup schedule create wrenfield.io --schedule daily --retention-count 7A systemd timer runs it, dumps the databases with it, and keeps the seven newest scheduled backups. It never deletes a backup you took by hand.
-
Add a place off the server. A backup on the same disk is lost with the disk. Create a bucket at your provider first, then:
Shellnoust backup destination add offsite --type b2 \ --field account=0042a1b2c3d4e5f0000000001 \ --field path=kelmoor-backups/fra-1 \ --prompt--promptasks for the application key twice, without showing it; it never goes on the command line. Noust tries the destination before saving it, and encrypts everything it sends there. Give each server a folder of its own (kelmoor-backups/fra-1). -
Keep the encryption key somewhere else.
Shellnoust backup destination show-key offsiteStore what it prints in your password manager. Without it, nobody can read the backups on that destination, this server included.
-
Send every scheduled backup there.
Shellnoust backup schedule update wrenfield.io --schedule daily --destination offsite -
Rehearse a restore.
Shellnoust backup drill wrenfield.ioThe drill verifies the newest backup, unpacks it the way a restore would, and loads each database dump into a temporary database that it then drops. Nothing of the application is touched. A schedule runs one on its own every 30 days.
In the console, the same is under Backups: the list, Schedules, Destinations and, on each backup, Restore.
What you should see
noust backup list wrenfield.ioshows your backup with its size and description.noust backup schedule listshows the schedule and when it last ran.noust backup drill wrenfield.ioends without an error and keeps its report:noust backup drillslists every drill.
Restoring for real
noust backup restore wrenfield-io_20261029_181502It replaces the application's files with the ones in the backup, after asking. To restore from the
copy off the server, on this server or a new one, add --from offsite. To bring back a whole
server, see Bringing a whole server back.
A restore puts the application's files back, not its database: the dumps in the archive are loaded
with their own command, noust db import (Databases), because
putting an older database under newer code is a decision. (A Docker Compose stack is the
exception: its databases come back with its files.) Ship a change, and roll it
back says how Noust guards the code side.
If it fails
- The destination is not saved: Noust tried it and it did not answer, or the bucket does not exist (it never creates one). The error is rclone's own; fix the field it names and run the command again.
- A scheduled backup failed:
noust backup failuresprints each failure's whole output. Set up notifications so the next one reaches you. - The drill failed: the report says which step: the checksum, unpacking, or loading a dump. The backup is not one to rely on; take another and drill it.
Backups and disaster recovery covers the database schedules, volumes, Noust's own state and every provider.