Database Backup/Restore (via Dropbox)


Nobody likes to plan for disaster recovery, but the fact is that accidents happen – a phone gets lost or dropped, an iOS has to be reinstalled, a database gets corrupted, etc. Although the chances are small, any of these events can result in a loss of your pain diary information. So how can you protect your valuable data?

That’s easy! Just use our built in Backup/Restore functionality that leverages our integration with Dropbox. From within the app, you can quickly create a backup of your active CPT database which will then be saved in your Dropbox cloud repository.

If you ever need it, the backed up database can be restored just as easily. Just point to the database file you want to restore and in seconds it will be loaded in the app. Let’s take a closer look at the steps for each operation.

Before we do, if you haven’t already linked CPT to your Dropbox account, you need to do that. Here’s a link to our FAQ that describes the Dropbox linking process in more detail.

Backup Operation

Dropbox Backup & RestoreWhen you’re ready to make a backup of your current database, you need to follow these steps:

  1. While in CPT, go to the Settings tab -> Cloud Services -> Backup & Restore Database
    • You’ll now see a screen similar to the one to the right here. From this screen you can initiate both the backup and restore processes.
    • The upper portion contains the Backup button to initiate the backup process
    • The lower portion contains a table showing previously created backups (your table may be empty currently). Each file is named with a timestamp so you can determine the date the backup was created.
  2. Tap the Backup button to begin the operation.
    • The process will begin and you’ll see the progress bars advancing.
    • Behind the scenes, CPT is disconnecting the database, making a copy of it, compressing that copy, and then moving that zip file to the Dropbox container.

That’s it. Your data is now safely protected. We’ve made this process as simple as possible because we don’t want to see our users loose any data – for any reason. So, please, make a backup every now then. You’ll may be thankful you did one day.

Restore Operation

If you do need to restore one of your backup files, then you’ll come to the same location in the app. Follow these steps to restore a database:

  1. Locate the desired backup file in the table. Generally you’re going to want the most recent backup file. Tap on that file name to select it.
  2. Now tap the Restore button to begin the process.
    • You’ll see the progress indicator run while the database is restored.
    • Behind the scenes we’re disconnecting the current database, copying over the backup file, decompressing it and replacing it as the live database.

Once the process is completed, you can immediate begin using CPT like normal.

NOTE: Keep in mind that the Restore process deletes the existing database file and cannot be undone. 

Backup File House Keeping

Removing a Backup FileIf you’re diligent in making an occasional backup, you’ll start to accumulate a lot of older backup files that you probably don’t need – again, only the latest backup is usually considered the key file.

To remove some of the older backup files, just touch/drag-right along the file name to display the delete button. Tap the delete button to confirm the removal.