25.06. Backup

If your data is important, then data backups need to happen, because things can go wrong (power failures, disk failures, ransomware, etc.)

You can perform a backup manually and/or automatically. Automatic backups should be scheduled to run frequently (every day), manual backups should be done before updates or other potentially risky changes.

It is not necessary to quit the database before performing a backup.

While a backup is running, all user activity will be paused until the backup is complete. They won't even be able to log out of mSupply. So: Make sure you only run a manual backup when users are not using mSupply. Make sure you configure your automatic backups to run at a time when the system is not busy e.g. lunch time, the end of work or, if your system will stay up 24/7, the middle of the night.

The Backup function works in both single user and client / server (multi-user) environments. The main differences are that in client / server (multi-user) environments:

The configuration of the Primary backup is done on the Server computer.

The backup can be configured to include other files, such as the Index and log files, which is very handy when providing support.

The backup takes place on the server. A progress window will appear on the client to show how the backup is proceeding.

Restoration from a backup must be run from the server computer.

Running a backup manually

Choose File > Backup… to run a manual backup of your data. The backup will be carried out according to the configuration of the Preferences > Backup tab.

Backup: best practice

We recommend you set up your mSupply backups in the following manner

Disk configuration

If your machine has the capability (e.g. it is a server with multiple storage volumes), then there is additional data security in configuring a RAID array.

Use RAID 1

RAID 1 is two disks mirrored, so data is written to each disk

Advantages

if one disk fails you continue work from the other disk

if the RAID controller fails, you can directly connect one disk and continue work.

There are other forms of RAID, but their advantages are outweighed by their disadvantages, considering that even a large mSupply database will be of the order of 10 GB in size.

Use a hot spare

This is a spare disk that the RAID controller will use if a disk in the RAID set fails.

Add another single disk to receive backup data

This disk is not part of the RAID

This is still possible if your machine only has one disk drive and you can not configure a RAID array. This could be a volume attached to a USB port (e.g. a thumb drive) or a location on the network, provided that it is always available.

Configure Primary backups

We recommend that you configure the Primary backup as recommended in our user's guide section on the Preferences > Backup tab.

Configure a secondary backup

Configure a secondary backup to a destination on the same machine, or elsewhere on the network that will be synced off-site (e.g. Dropbox, OneDrive, Google Drive, etc.) - refer Preferences > Backup 2 tab.

Configure off-site backup

Use Spideroak™ or Dropbox™ to backup your secondary location to their internet servers.

If needed configure an off-site computer to also synchronise with the backup service provider so you have an off-site copy as well as the “cloud” copy.

Mirrored servers

We have the technology to provide mirrored servers when very high availability is required. Contact us if interested. A charge will apply for implementation

Use a standard place to store backups

We suggest that you store:

mSupply data in C:/mSupply_data/

Backups in C:/mSupply_backups/

Log file in C:/mSupply_data/

Backup for mSupply single user sites

If you have a synchronisation system with mSupply it's very important that the sync satellite sites have operating backups. By design, mSupply sync satellite sites can operate indefinitely without syncing to the Central server. There are numerous cases of Sync satellite sites operating for months without syncing, though this is not recommended! In such cases, a failure on the sync satellite site could result in months of lost data unless backups are operating on the such sync satellite sites. These sites are normally even more vulnerable to failure than 'Central' servers ….

Restoring your data

For data security purposes, the New data file, Restore and Open new datafile functions are disabled if you are on a satellite site in a synchronising system.

An mSupply database can be created from a backup:

Quit mSupply if it is running.

Start mSupply and then immediately hold down the Alt key. You will now be shown the following dialogue box with a number of radio buttons with the different options available:

Choose the 4th radio button Restore a backup file.

Another window will open where you can choose the backup file to restore. Locate your backup file in the Open dialog that appears. Your backup file has file extension .4BK, eg. CMS.4BK. Hit OK.

You will be prompted for where to create the data file. This should default to the location of the backup that you have selected. If you want to save it elsewhere, change the destination location of the data file by clicking on the … button. Once you are happy with the destination location, hit the Restore button.

Once the restore has completed, mSupply will Quit.

Restart mSupply

You may be prompted for a log file. In that case:

Click on the Create button. Select the suggested location, which can be the same as your new data file location. You may find that the parent location of the default location is where the log file is already created. You can overwrite it. Once you have specified a location, click on the Save button.

You will be advised that The log file will be activated after the next backup of the data file. Do you want to start the backup automatically?. If you click OK here, then a backup will be created now. This can take many minutes if it is a large data file. It is not necessary to create the backup at this stage, but the log file will not be created until you create the first backup.

After clicking OK or Cancel, the data file will open. This will take time (hours) if it is a large data file and the index file is not included with the backup.

mSupply should open your restored data file and you should be presented with the log in screen to the new data file.

Previous: 25.05. Web browser access via TSPlus | | Next: 25.07. Updating mSupply