Backup & Restore
On this page
A backup is one file holding everything the site knows: every table of the database (dealers, invoices, serial numbers, warranty cards, users, settings) and the uploads folder with logos, product photos and attachments. Take one by hand before a big change, let the cron job take one every day, week or month, send copies away from the server, and put any of them back in a few clicks.
Switching it on
Backup & Restore is a premium addon: it runs when your licence package carries it, or when its own addon key is activated on this site. On Admin → Addons (in the System group of the sidebar) find Backup & Restore Addons and press Enable. Not in your licence yet? Use Buy this addon or I have a key; see The licence key and addon keys.
What is in a backup
The file is named like dms-backup-20261014-020012-a1b2c3.zip and holds:
manifest.json: the script version, site name and address, the date, the list of tables and the number of rows;database.sql: every table in the site's database;uploads/…: the uploads folder, unless you switched that off. Files larger than Skip files larger than this (MB) are left out, and earlier backups are never put inside a new one.
If your host's PHP has no zip extension, a yellow note says so and backups are written as a gzipped SQL file (.sql.gz). The database is fully covered; the uploads folder is not. Ask your host to switch zip on for complete backups.
The Backup & Restore screen
Admin → Backup & Restore (in the Addons group of the sidebar; the role needs Change system settings).
Across the top: Last backup, Kept here (how many, and their size), Schedule and Off-site copies. The dashboard gets a Last backup card too, which turns red when there is none or the newest is more than 14 days old.
Take a backup now. Type a note so you remember why (Before importing last month's dealers) and press 💾 Back up now. The message gives the file name, its size, and where else it was sent.
Backups lists the newest first with size, kind (Manual, Scheduled or Safety), where it was sent, your note, any error, and its tables, rows and files. Each finished backup has:
- Download: the only way a backup leaves the server. The
uploads/backupsfolder carries its own.htaccessthat refuses direct requests, so nobody can fetch a backup by guessing its address. Every download is written to the activity log. - Restore: picks this backup in the Restore card.
- Send off-site: copies it again to every destination that is switched on.
- ×: deletes the backup and its file.
Restoring
The Restore card:
- Which backup: pick one from the list, or leave — upload one instead — and choose a
.zip,.gzor.sqlfile under …or upload a backup file. - Put the uploaded files back too (ticked) also writes the backup's
uploadsfiles back. - Skip the safety backup (not recommended): leave it unticked.
- Type
RESTOREin the box and press Restore this backup.
First a safety backup of the site as it is now is taken. Then every table in the backup is dropped and created again with the backup's rows, and the files go back into uploads. Anything entered after the backup was taken (an invoice, a new dealer, a changed password) is gone. If that was not what you wanted, restore the safety backup: after a restore the list is rebuilt from the files on disk, so it is there, marked Found on disk after a restore.
An uploaded backup has to fit within Maximum upload size (MB) on Admin → Settings → General and within your host's PHP upload limit.
Copies away from the server
A backup that lives only on the same server is not really a backup. Where copies go (or Manage destinations) opens the destinations screen. Press + Add a destination:
| Where it goes | What it needs |
|---|---|
| FTP, FTP over TLS | Host, Port (21), User name, Password, Passive mode (usually yes) |
| SFTP (SSH) | Host, Port (22), User name, Password; the host's PHP needs the ssh2 extension |
| WebDAV | Host (the full https:// address), User name, Password |
| Dropbox | Access token (Dropbox → App Console → your app → Generate access token) |
| Google Drive, OneDrive | Client ID, Client secret and Refresh token from an app you create in Google's or Microsoft's console |
Every destination also has a Folder (for Google Drive, the folder's ID) and Keep this many there, which is a note for you: old copies at the destination are not deleted by the script. Switched on? is No — set it up first or Yes — send every backup here. The form does not save Dropbox, Google Drive or OneDrive as switched on without their token.
After saving, Test the connection sends a small test file and shows the answer. The list shows when each destination last worked, or its last error, with Edit and Turn on / Turn off. Passwords and tokens are stored so the schedule can run unattended, so give each destination its own account that reaches nothing but the backup folder.
Automatic backups
Backup settings (the button at the bottom of the screen, or Settings on the Addons page):
| Setting | Default |
|---|---|
| Take a backup automatically (Never, Every day, Every week, Every month) | Every week |
| Around which hour (0-23) | 2 |
| Include the uploads folder | on |
| How many backups to keep here (0 keeps everything; the oldest go first) | 7 |
| E-mail me when a scheduled backup runs | on |
| Skip files larger than this (MB) | 32 |
The schedule is run by the cron job, and only during the hour you chose, so the cron job has to run at least once within that hour. The Automatic backups card shows a ready line with your key and a Copy button:
*/10 * * * * curl -s "https://your-site/api/cron.php?key=YOUR_CRON_KEY" >/dev/null 2>&1
More in Scheduled jobs (cron). The report e-mail goes to the company e-mail on Admin → Settings → Company (or to the sender address when that is empty) and gives the file, its size, tables and rows, or why it failed.
Tips
- Take a manual backup before an import, a price-list change or an update.
- Download one now and then and keep it on a computer at the office.
- A restore puts back the users too: after restoring an old backup, sign in with the password you had then.