Skip to content

Backups and moving servers

CVN ERP backs up its database on a schedule, keeps copies on the server and can send encrypted copies off-site. Open Backups in the admin console, and Settings & Secrets › Backups & Data for the schedule.

What a backup contains

A backup is a compressed export of every database table: customers, repairs, sales, the books, staff, website pages and settings.

It does not contain:

  • the uploads/ folder (product photos, repair photos, documents you uploaded),
  • secure_data/ (the secrets file, the backup key and logs).

Back those two folders up with your own server backups or file copies.

Schedule and retention

  • Set how often backups run and at what time, and how many days to keep them (30 by default). Older backups are pruned automatically.
  • Scheduled backups need the database backup job from Scheduled jobs.
  • Back up now runs one immediately. Do this before an update, a large import or a settings overhaul.

Where copies go

Destination What is stored
This server Compressed backups under secure_data/, never reachable from the web
Google Drive, OneDrive or S3-compatible storage Optional off-site copies, encrypted before they leave the server

Connect a destination on the Backups screen and use its test button to check the connection.

Encryption and the backup key

Off-site copies are encrypted with XChaCha20-Poly1305. Credentials stored in the database are removed from those copies row by row before encryption.

The key is never stored in the database. It comes from CVN_BACKUP_KEY in secure_data/secrets.php if you set one, or from secure_data/backup.key, which is created on the first backup. A full administrator can show the key and its fingerprint on the Backups screen. Viewing it is recorded in the audit log.

Restoring

Pick a backup on the Backups screen and restore it. You can also download a backup, or export the whole database as a file.

To read an encrypted backup on another machine with PHP and the key:

php api/lib/backup_stream.php decrypt backup.json.gz.enc backup.json

Moving to a new server

  1. Take a fresh backup and copy uploads/ and secure_data/ from the old server.
  2. Set up the new server as in Requirements, with the same release.
  3. Copy secure_data/ and uploads/ into place, then point secure_data/secrets.php at the new database.
  4. Restore the backup from the Backups screen.
  5. Point your domain at the new server. If the domain changes, move the licence too. See Licensing.

Edit or report a problem