Addons

Backup & Restore

On this page

The Backup & Restore addon takes a copy of the whole site, by hand or on a schedule, keeps it on your server, and sends a copy away to FTP, Google Drive, OneDrive, Dropbox or another server. When something goes wrong, it puts everything back in a few clicks, and it takes a safety copy of what is there first.

It is for every centre. Patient files, invoices and the ledger are the business; a backup that only lives on the same server is not enough.

Switching it on

Backup & Restore is a premium addon, so it must be in your licence.

  1. Buy it from its card on Admin → Addons (Buy this addon), or on the License Center at https://license.faruk.bd. A paid order arrives by itself at the next licence check.
  2. If you have the key already, open License, paste it under Addon keys and press Add the key. Check now asks the License Center at once.
  3. Press Enable on the Backup & Restore Addons card.

Its screen is More → Backup & Restore. The dashboard shows Last backup, in red when there has been none for more than 14 days.

What is in a backup

One .zip file holding:

  • database.sql: every table, so every patient, invoice, setting and addon record;
  • the uploads folder (logos, product photos, attachments), when Include the uploads folder is on;
  • a manifest.json describing what is inside.

If the server's PHP has no zip support, the backup is a .sql.gz with the database only.

Backups kept on the server sit in uploads/backups, a folder closed to the web, so nobody can download them by guessing the address.

Settings

Admin → Addons → Settings on the card, or Backup settings on the backup screen.

SettingWhat it does
Take a backup automaticallyNever, Every day, Every week (the default) or Every month. The cron job is what runs it.
Around which hour (0-23)Default 2, so the backup runs at night.
Include the uploads folderLogos, product photos and attachments. Turn it off if uploads are very large.
How many backups to keep hereDefault 7. The oldest are deleted once there are more. 0 keeps everything.
E-mail me when a scheduled backup runsA short report after each automatic backup.
Skip files larger than this (MB)Default 32. Keeps one huge file from breaking the whole backup.

Taking a backup

The top of the screen shows Last backup, how many are Kept here, the Schedule and the Off-site copies.

  1. Under Take a backup now, write A note, so you remember why (for example Before importing last month's dealers).
  2. Press Back up now.
  3. The panel says Backup taken with the file name and size.

The Backups list shows each file, What is in it (tables, rows and files) and when it was Taken. Each one has Download, Restore, Send off-site (when a destination is set up) and a delete button. Under each file name you see its size, whether it was Manual, Scheduled or Safety (taken by itself before a restore), your note, and where it was sent.

Where copies go

Where copies go or Manage destinations opens the destinations. + Add a destination asks for a Name and Where it goes:

DestinationWhat it needs
FTP, FTP over TLSHost, Port, User name, Password, and Passive mode (usually yes).
SFTP (SSH)Host, Port, User name, Password.
Google Drive, OneDriveClient ID, Client secret and Refresh token from the provider's console. The script swaps the refresh token for a fresh access token on every upload, so nothing expires on you.
DropboxAn Access token (Dropbox → App Console → your app → Generate access token).
WebDAVThe server address in Host, with User name and Password.

Each destination also has a Folder, Keep this many there, and Switched on?: No — set it up first or Yes — send every backup here. Press Test the connection before you switch it on. The list shows each destination's Last attempt and when it last worked.

Every backup, manual or scheduled, is copied to every destination that is switched on.

Automatic backups

The schedule runs from the cron job, so it keeps happening whether or not anybody signs in. The Automatic backups box shows the command with your cron key and a Copy button. If you set up the cron job when installing (see Cron), there is nothing more to do.

Restoring

Restoring replaces what is in the database now. Do it only when you mean it.

  1. Under Restore, choose Which backup, or pick — upload one instead — and choose the file under …or upload a backup file.
  2. Leave Put the uploaded files back too ticked to bring back logos and attachments as well.
  3. Leave Skip the safety backup (not recommended) unticked. A safety backup of what is there now is then taken first, so you can come back if the result is not what you expected.
  4. Type RESTORE in the confirm box and press Restore this backup.
  5. The panel says how many statements and files it put back.

After a restore, the backup list may be the older one from inside the backup; the script looks for the files still on disk and lists them again, so the safety backup is always within reach.

Moving to a new server

  1. Take a backup and Download it.
  2. Install the script on the new server (see Installation) and switch this addon on.
  3. Upload the backup under Restore and restore it.
  4. Activate your licence on the new domain (see The licence).

Tips

  • Set up at least one off-site destination. A backup on the same server is lost with the server.
  • Take a manual backup before an update, an import or a big clean-up. The Script & Addon Updates addon takes one for you.
  • Download a backup now and then and keep it on your own computer.
  • Try a restore once on a test copy, so you know it works before you need it.
Chat with Faruk
Faruk's Assistant Online — AI Powered