admin:backup_and_restore

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
admin:backup_and_restore [2020/09/15 07:00] – [Running a backup manually] Mark Gloveradmin:backup_and_restore [2022/05/30 02:03] (current) – [Restoring your data] Mark Glover
Line 1: Line 1:
 {{indexmenu_n>60}} {{indexmenu_n>60}}
-====== 23.06. Backup ====== +====== 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.) If your data is important, then data backups need to happen, because things can go wrong (power failures, disk failures, ransomware, etc.)
  
Line 23: Line 22:
  
 Choose **File > Backup...** to run a manual backup of your data. The backup will be carried out according to the configuration of the [[preferences:general#backup_tab|Preferences > Backup tab]]. Choose **File > Backup...** to run a manual backup of your data. The backup will be carried out according to the configuration of the [[preferences:general#backup_tab|Preferences > Backup tab]].
- 
- 
- 
- 
  
 ===== Backup: best practice ===== ===== Backup: best practice =====
Line 32: Line 27:
  
 ==== Disk configuration ==== ==== 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 [[https://en.wikipedia.org/wiki/RAID|RAID array]].
 === Use RAID 1 ===  === Use RAID 1 === 
   * [[https://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_1|RAID 1]] is two disks mirrored, so data is written to each disk   * [[https://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_1|RAID 1]] is two disks mirrored, so data is written to each disk
Line 46: Line 43:
 This disk is not part of the RAID 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:general#backup_tab|Preferences > Backup tab]].
  
-==== Configure a secondary backup location in mSupply ==== +==== Configure a secondary backup ==== 
-  * Configured 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:general#backup_2_tab|Preferences > Backup 2 tab]].+  * 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:general#backup_2_tab|Preferences > Backup 2 tab]].
  
 ==== Configure off-site backup ==== ==== Configure off-site backup ====
Line 60: Line 60:
 We have the technology to provide mirrored servers when very high availability is required. Contact us if interested. A charge will apply for implementation We have the technology to provide mirrored servers when very high availability is required. Contact us if interested. A charge will apply for implementation
  
-=====  Restoring your data ===== 
-Choosing this item allows you to choose a backup data file, uncompress it and start using it as your main data file. 
- 
-  * Log in to msupply with an old data file or by creating a new data file and click menu **File > Restore...** 
-  * Locate your backup file in the //**Open**// dialog that appears. Your backup file has file extension ''.4BK'', eg. ''mSupply.4BK'' Hit **OK**. 
-  * Clicking on the small red down arrow next to the data file name will show the current destination location to where the data file will be restored.  You are being prompted for a folder where the data file will be restored to.  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. 
-  * After the file is restored, the file location is then displayed using your computer's default file manager.  You can close this window. 
-  * Now go back into mSupply and click menu **File > Open data file...** 
-  * Locate the newly restored data file in the //**Open**// dialog that appears.  Your data file has file extension ''.4dd'', eg. ''mSupply.4dd''. 
-  * Select the data file and hit the **OK** button. 
-  * You may be prompted for a log file.  Click on the **Create** button.  Select the suggested location, which is the same as your new data file location, and click on the **Save** button. 
-  * You will be prompted to do a backup.  It is not necessary to do this at this stage.  It will take a few moments to open this new data file, particularly if it is a large data file. 
-  * mSupply should open your restored data file and you should be presented with the log in screen to the new data file. 
- 
-In client/server usage this command will have no effect. 
- 
-Be very careful about restoring. We suggest you consult Sustainable Solutions before attempting a restore. 
- 
-===== Setting up backup and a log file for single user mSupply ===== 
  
-If you are using a synchronisation system with mSupply it's very important that you don't lose any data on the remote site. To ensure that power failures (or a dead battery on a laptop) don't cause mSupply to quit unexpectedly and therefore to lose data, you should configure mSupply to use a log file.  
  
 ==== Use a standard place to store backups ==== ==== Use a standard place to store backups ====
Line 86: Line 66:
   * mSupply data in ''C:/mSupply_data/''   * mSupply data in ''C:/mSupply_data/''
   * Backups in ''C:/mSupply_backups/''   * Backups in ''C:/mSupply_backups/''
-  * Log file in ''C:/mSupply_backups/''+  * Log file in ''C:/mSupply_data/''
  
-==== Primary backups ====+===== Backup for mSupply single user sites =====
  
-We recommend that you configure mSupply to  +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 ....
-  * Use the single disk as the primary backup location. +
-  * The Primary backup should be set to be carried out nightly. +
-  * Use a log (journal) file. A log file records each database action as it happens. In the event of a power failure or other adverse event, all changes can be recovered from the log file.+
  
-You can configure primary backups to run on a schedule that you set To do this go to Admin Preferences and select Backup from the left panel.  You must have an existing backup to use these features (see [[admin:backup_and_restore#running_a_backup]]).+=====  Restoring your data ===== 
 +<WRAP important center round 90%> 
 +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. 
 +</WRAP>
  
-{{ :admin:backup1.jpg |}}+An mSupply database can be created from a backup: 
 +  - Quit mSupply if it is running. 
 +  - Start mSupply and then <wrap em>immediately</wrap> 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:{{ tutorial:/new_file_option.jpg?450 }} 
 +  - 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.  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.\\ {{:admin:pasted:20220530-014805.png}} 
 +  - 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.
  
-Select Automatic Backup and schedule by hour(s), day(s) or week(s) as indicated. +In client/server usage this command will have no effect.
- +
-{{ :admin:backup2.jpg |}} +
- +
-Choose your backup folder and select Use log file. {{:admin:backup5.jpg}}   +
- +
-You will be prompted to specify the location of your log file. +
- +
-{{ :admin:backup3.jpg |}} +
- +
-Press Continue+
  
-{{ :admin:backup4.jpg?700 |}}+Be very careful about restoring. We suggest you consult Sustainable Solutions before attempting a restore, particularly in a synced system.
  
-When all settings are correct, press OK to save. 
  
 \\ \\
  • Last modified: 2020/09/15 07:00
  • by Mark Glover