Moving from Airtable? Get free migration support from our team. Get started →

Schedule encrypted backups

Updated

If you run Artavolo on your own server, it can make a backup by itself every night: one locked (encrypted) file that holds everything needed to rebuild it, both databases and every uploaded file. It keeps as many days as you choose, on the server and, if you like, in online storage elsewhere. One command puts a backup back.

The Scheduled encrypted backups settings: Run a backup every day, Run from 03:00 server time, Local folder, Keep backups for 14 days, Include uploaded files switched on, and on the right the S3-compatible off-site copy with Endpoint, Bucket, Region, Key prefix, Access key and Secret key with a Save secret button

In our cloud you do not need this: we back up everything for you. A base's own restore points are under Settings, Backups in the base.

Step 1: Set the encryption key

Backups are locked with a key that only you hold. Until it exists, the Backups page shows a red warning and backups are refused.

The red warning BACKUP_ENCRYPTION_KEY is not set, explaining where to add it and that backups are refused until the key exists

  1. Make up a key of 32 or more random characters, for example with a password manager.
  2. Add it to includes/config.php as define('BACKUP_ENCRYPTION_KEY', '...');, or in Docker as ARTAVOLO_BACKUP_ENCRYPTION_KEY in the .env file.
  3. Keep a copy of the key away from the server, in a password manager or a safe. A backup cannot be opened without it, and there is no way round that.

Step 2: Turn on the daily backup

  1. Sign in as an administrator. Click the round button at the top right and choose Control panel.
  2. In the Control panel's top menu, open Settings and choose Backups.

The Settings menu of the Control panel, with Backups in it

  1. Switch on Run a backup every day, and under Run from (hour of day, server time) choose a quiet hour.
  2. Under Local folder, type a folder outside the website, ideally on a separate disk. Leave it empty to use data/backups.
  3. Under Keep backups for (days), type how many days to keep. 0 keeps everything.
  4. Leave Include uploaded files (attachments, avatars) on, unless you copy the files another way.
  5. For a copy off the server, fill in S3-compatible off-site copy (optional): Endpoint, Bucket, Region, Key prefix and Access key. Type the Secret key and click Save secret. Hetzner, MinIO, Scaleway, Wasabi and AWS S3 all work.

Each setting is saved as soon as you change it. Only the secret key has its own Save secret button.

  1. Click Run a backup now once. A first backup appears in the list below, with download beside it.

The Run a backup now button

The cron job, which runs every 5 minutes, starts the backup at its first run after the hour you chose.

Step 3: Check a backup, and practise restoring

To check a backup without touching anything, run php utilities/restore.php /path/to/backup-file --dry-run. It checks the file, unlocks it into a temporary folder, lists what is inside and cleans up. Do this once a month.

To restore, stop the web server, then run the same command with --yes instead of --dry-run. It replaces both databases and copies the uploaded files back. Practise once on a spare machine now, while nothing is wrong: it is the only way to know the procedure works for you.

Good to know

  • Run a backup now stays greyed out until the encryption key is set and a licence key that includes backups is in place.
  • Each backup is encrypted with AES-256 and sealed with an HMAC-SHA256 check over the whole file, which is verified before anything is unlocked. A wrong key or a damaged file is refused, never half restored.
  • A failed backup e-mails every administrator. Every run, good or failed, is in the audit log.
  • The daily schedule is part of Pro on your own server and needs a licence key that includes it. Without one, php utilities/backup.php makes the same backup from the command line in every edition.
  • The backup does not hold includes/config.php, because it contains your database passwords and secrets. Keep a copy of that file with the key.
  • Backups older than the days you keep are removed after each successful run, on the server and in the online storage.
  • In our cloud, each base's own restore points are kept too: Free keeps 10 per base, Standard 25 and Pro 50.

Related