This article explains how to back up and restore the Bp Premier database.
Frequently asked questions
When and how should I back up the database?
Best Practice Software recommend that you back up your Best Practice data daily using the supplied utility BP Backup, even if you use a third-party backup utility. BP Backup provides the simplest restore of the database.
Best Practice also recommend that a test restore of the backup is performed to a separate server on a regular basis to ensure that your backups are valid and can be restored. Store backups off-site in a secure location.
You can manually back up the database at any time, but it is better practice to set up a scheduled backup to run overnight or during a time of minimal server activity.
NOTE Users performing backup and restore operations will require some or all of the Configuration, Perform a backup, and Perform a restore permissions set to 'Allow access'.
What if I use a third-party backup tool?
Your practice's IT and disaster recovery guidelines may require you to use another software tool for database backup and archive. The BP Backup utility will not interfere with any third-party archiving software. However, Best Practice Software Support are unable to provide comprehensive support to sites trying to recover a backup performed by a third-party product, only with backups from the BP Backup utility.
When using a third-party backup software that has an SQL agent, the user details required to access the database are:
User: BPSBackup
Password: Set in the Database tab of the Configuration screen
IMPORTANT Do not lose the password that you set for this account, because it cannot be reset by a Bp Premier user. Store the password in a secure location such as the practice safe.
Back up the entire database
- Log into Windows on the Bp Premier server as a Windows Administrator user. If you are not an administrator user with sufficient privileges, Windows may ask you to elevate and supply an administrator password when you run the backup utility.
- On Windows 8 or later, select the Windows logo in the bottom left > Apps > BP Backup.
- The BPS Backup Utility screen will appear. Click Backup database. Enter the username and password of a Bp Premier user with the permission Perform a backup set to 'Allowed'. A file explorer will open.
- Browse to the folder you want the Best Practice Software backup file to be stored.
- From the Save as type drop-down, select the type of compression. This step is optional.
- Click Save. The filename will default to a timestamp format, for example, 'BP_20080513105335'.
A compressed backup creates one zip file containing a file for each Best Practice database and requires free space on the Bp Premier hard disk at least three times the size of the database, to allows creation of temporary files.
An uncompressed backup creates one file for each Best Practice database.
After the backup has completed, BP Backup will notify the success or failure of the backup. Best Practice Software recommend that you copy or move the backup files to an external device that can be stored in an off-site location.
Schedule a backup
Scheduled backups allow you to back up Bp Premier data while the system is unattended, and schedule a backup several times a week or on the same day (a lunchtime and evening backup, for example). Backups are scheduled through the Bp Premier Windows service BpService.
- Select Setup > Configuration > Bp Service tab.
- Click Configure Automated backup. The Scheduled backup screen will appear.
- Tick Perform scheduled backup.
- Set a Default backup folder to store backup files in. You can override this setting when you create a schedule.
- Click Add to add a new schedule. The Backup details screen will appear.
- Select the Days of week to run the backup.
- Select the Backup time to run the backup.
- Select the Backup folder to store the backup files. Ensure the hard disk has enough space for the backup process and files. If you are running an uncompressed backup and the backup folder is on a network, you must use a mapped drive. UNC paths are not supported.
- Select Compressed to run a compressed backup. Compressed backups require free space on the Bp Premier hard disk at least three times the size of the database.
- Click Save to return to the Scheduled backup screen.
- If you do not wish to keep old backup files, tick the checkbox Delete old backups in the same folder.
- Tick Send message if backup fails and select one or more Bp Premier users if you want staff notified if a backup fails.
- Click Save to exit.
NOTE Ensure that the destination directory for backups has permissions set to allow read/write/delete. Set the permissions level to 'full control' for the 'network service' username. Your IT support can assist.
Restore the entire database
- Log all users out of Bp Premier and shut down the Bp Premier server. Restoration will replace all existing data.
- Log in to Windows on the Bp Premier server as a Windows Administrator user.
- On Windows 8 or later, select > Apps > BP Backup.
- The BPS Backup Utility window will appear.
- Click Restore database. Bp Premier will prompt that restoration will replace all current data. Click Yes.
- Log in to the restore utility with a Bp Premier username and password.
- Browse to the folder where the backup file is stored that you wish to restore.
- Select the file to restore: .bku for an uncompressed backup, or .zip for a compressed backup file.
- Click Open. The restore process will begin.
- Click Close to close the backup utility after a successful restoration.
IMPORTANT When restoring, always log in to the Bp Premier server on the local machine or through a console connection. If you attempt to restore the database through a Remote Desktop session, Bp Premier will return an SQL error and will not restore.
If you are restoring an uncompressed backup, select ‘Uncompressed file’ from the Files of type: dropdown. If you are restoring a compressed backup, select ‘Compressed file’ from the Files of type: dropdown.
Back up and restore from the command line
You can back up and restore an individual database on the Bp Premier server by using sqlcmd at a command prompt. You could also use sqlcmd if you needed to schedule backups outside of Bp Premier, for example, Your IT support can provide more assistance on using sqlcmd to back up ad restore databases.
To use sqlcmd, you will need to set up your bpsviewer account password. You may need to reapply your database browser password if you have recently upgraded, because the BPSBackup account may not yet be associated with the correct password.
The following are two examples of using sqlcmd:
Back up the active BPSPatients database:
sqlcmd -U BPSBackup -P <pwd> -S \BPSINSTANCE -Q "BACKUP DATABASE <database> TO DISK='<path>'"
Restore a BPSPatients database:
sqlcmd -U BPSBackup -P <bp pwd> -S \BPSINSTANCE -Q "RESTORE DATABASE <database> FROM DISK='<path>' WITH REPLACE"
where:
- <pwd> = the bpsviewer account password
- <database> = the name of the database
- <path> = the path and filename of the backup or restore file.
For example:
sqlcmd -U BPSBackup -P password123 -S \BPSINSTANCE -Q "BACKUP DATABASE BPSPATIENTS TO DISK='c:\backups\bpspatients.bak'"