Docs: Off-site backups

Off-site backups

Encrypted nightly copies of your whole site to S3-compatible storage, each one proven by a restore test.

Since 1.15.0 Tilspire can send an encrypted copy of your whole site to storage you control every night, and then prove the copy restores. It's off until you set it up. It runs only from the scheduled task (php core/cli/cron.php, or php update.php --auto); the site's own web runs never start it, and the dashboard's health check says so.

Off-site backups have their own permission, Configure off-site backups, which only the top role has at first.

What a copy holds #

Every table Tilspire and your modules own, your uploads, your themes and your modules, as one compressed archive. Protected files, such as ticket attachments, sit inside uploads, so the copy carries them. Since 1.21.0 it also carries the Recycle bin and the direct messages, which are not encrypted in the database but are encrypted in the archive. Export files are never in it, and a social sign-in is never written into the copy's rows. Whoever holds Configure off-site backups and downloads the recovery kit can reach message text. It's encrypted on your server before it leaves, with AES-256-GCM under a key only your site holds, so the storage provider sees nothing but the archive's size. Secret settings are left out unless you choose otherwise, and your AI provider keys never go in.

Setting it up #

  1. Turn on two-factor sign-in on your Profile first. Then open System ▸ Backup, and under off-site backups enter an S3-compatible destination: the endpoint, bucket, region and an access key that may write to it. Test connection checks it.
  2. Download the recovery kit and keep it somewhere safe, away from the server. It holds the key, BACKUP_KEY, without which no copy can ever be opened. Type its check code to confirm you have it.
  3. Turn off-site backups on. Back up now and Test restore now queue the work: the next run of the scheduled task does it.

Saving the destination, downloading the recovery kit and showing the key line ask for your password and a code from your authenticator app.

Schedule and retention #

Pick the hour for the nightly copy, in the site's time zone. Tilspire keeps the newest copy of each day for 7 days, of each week for 4 weeks and of each month for 6 months; you can change these. Tick The provider keeps old copies by its own rule if your storage deletes old copies itself or your access key may not delete. The newest copy that passed its test is never deleted.

The nightly restore test #

After each copy, Tilspire downloads it again, decrypts it and loads it into scratch tables beside your own, then removes them. A copy only counts as good once that test has passed, and old copies are pruned only when a newer one has passed. The dashboard's health check and an email tell you when a step fails.

Restoring #

From the site's root folder, php core/cli/offsite.php can decrypt a copy, inspect it, and restore it. A restore checks the whole copy before it changes anything, then swaps every table in one step. The old tables are kept as _tsold_ tables until you drop them. Uploaded files come back only with --files. It lists what it left out, such as the AI provider keys you will need to add again.

On a MySQL site #

Archives made on MySQL since 1.15.0 lacked a few columns (users.user_registered, users.user_lastseen and reactions.created_at). That is fixed in 1.21.0. Make a fresh archive after updating. MariaDB sites were not affected.

Keep the key apart #

Keep the recovery kit together with a copy of site/config/config.php, which holds the keys for two-factor sign-in, your AI providers and, since 1.21.0, social posting (SOCIAL_KEY; without it social accounts must be connected again), and never on the server the copies are made from.