Backups and moving servers
CVN PSA backs up its own database and files on a schedule. A backup you have never restored is not proof of anything, so the app can also test-restore one for you.
Set up backups
- Open Configuration › Maintenance › Backups.
- Choose how often to run: every six hours, daily or weekly, and the time of day.
- Include stored files as well as the database. A database-only backup restores a system with no documents or attachments.
- Set an encryption passphrase. Backups are compressed and encrypted with AES-256. Without a passphrase they are written unencrypted, and the backups screen says so.
- Store the passphrase outside the server. A key kept only on the machine you need to restore is no help.
- Set how many days to keep archives. The default is 30. Older archives are deleted after each run.
The backups screen lists every run, and lets you start a backup, verify an archive or download it.
Test restores
Verify checks that an archive file is intact. Restore test goes further: it restores the database into a scratch database and checks that it comes back. Turn on the weekly restore test in the backup settings, or start one from the backups screen.
Time a full restore once a quarter and write the number down. That is your real recovery time.
Restore a backup
Restoring over a live database is deliberately a command-line job, so it cannot happen from a stray click:
- Sign in to the server and change to the app's directory.
- Put the app into maintenance mode with
php artisan down. - Run
php artisan psa:backup:restoreand pick the backup from the list. Add--id=or--file=to name one directly. - Confirm. Run it with
--forcein a script. - Run
php artisan upand check a few recent tickets and invoices.
Move to a new server
- Prepare the new server. Run the installer (ships with version 1.0) on it using the same release version as the old server.
- Copy the keys. Copy the application keys from the old server's
.envfile to the new one:APP_KEY,SETTINGS_KEY, andPASSWORD_VAULT_KEYif it is set. Settings, stored credentials and the password vault are encrypted with these keys and cannot be read without them. - Take a final backup on the old server, with files included, and stop the old app.
- Restore the database backup on the new server, then copy the app's
storagedirectory across so documents and attachments come with it. - Point DNS at the new server and get a certificate.
- Check sign-in, a ticket, an invoice PDF, outgoing mail and email-to-ticket.
If the domain stays the same, your licence needs no change. If it changes, move the licence to the new domain from your account first. See Licences, domains and renewals.