Restore a backup
A restore needs a database backup (the .sql.gz file from
Database backups), your config.php, the data folder and
two folders kept next to the site folder: .clientfence-ticket-files (ticket attachments)
and .clientfence-receipts (payment receipts clients uploaded).
Restore on the same or a new server
Section titled “Restore on the same or a new server”-
Create an empty database and a user for it.
-
Import the backup:
Terminal window gunzip < your-backup.sql.gz | mysql -u USER -p DATABASE -
Upload the ClientFence files of the release you were running, including
.htaccess. -
Put back your
config.php. If the database name, user, password or address changed, update them in itsdbsection, andurlif the domain changed. -
Put back the
datafolder (uploaded files and logs). -
Put back
.clientfence-ticket-filesand.clientfence-receiptsnext to the site folder (not inside it). The database backup does not hold these files. -
On a new server, add the cron line.
-
Sign in again (sign-ins are not in the backup) and open System health. Encryption key must pass.
Go back after an update
Section titled “Go back after an update”Before an update, ClientFence saves a backup in .clientfence-backups/<site folder name> next to the site
folder, in a folder named update-<old>-to-<new>-<date>-<time>. Only the newest one is
kept. It holds:
| File | What it is |
|---|---|
database.sql.gz |
The database just before the update. |
files.zip |
Every file the update replaced. |
added.json |
The files the update added. |
- Put the site into maintenance. Save a copy of the current database and site files before
replacing them. Import
database.sql.gzinto a separate empty database first. - Unzip
files.zipover the site folder. - Delete the files listed in
added.json. - Point
config.phpto the restored database. Sign in, follow any Finalize Update prompt, and check System Health. Confirm a recent invoice and a file attachment open before taking the site out of maintenance.

