Device to Device Synchronization


If you have more than one device running Chronic Pain Tracker, you can now establish a synchronization service which will maintain data across the devices. Enter a new Diary Entry on your iPhone and it will appear on your iPad automatically.

This feature utilizes the Dropbox Synchronization Services to facilitate the automatic sharing of data between the devices. You may already be using Dropbox with CPT as we have previously offered integration that supported Database Backup/Restore operations and synchronization of PDF report files. If you already have Dropbox linked on your device, you can proceed to the next step. If not, then you will need to first signup for a Dropbox account, and link Chronic Pain Tracker to the service.

Activating the Synchronization Services

When you are ready to activate the synchronization services, you’ll want to begin with your device that has the most up to date CPT database. For now we’re going to call this device your “Primary” device and it is this version of the database that is going to be used as the starting point for all of your other devices.

Open CPT on your Primary device and go to the Settings tab -> Cloud Services -> Device Sync Services

Here you should see a button labeled “Activate Sync Services”. Tap the button to begin registering the services and building the synchronization data structure in Dropbox. Note: This step may require you to log into Dropbox and/or approve the connection between CPT and Dropbox before continuing.

Once the synchronization services have been established, you’ll get a message indicating that “Sync Services are Now Active”. You can tap on the “Return to Settings” button to exit the dialogue box. If this is the first time you have activated the synchronization services, the services will immediately begin uploading a copy of your database to your Dropbox account. This will be used as the starting point for your other devices.

Activating Secondary Devices

Now that your Primary device is running, you can move to your other, “Secondary” devices. Open Chronic Pain Tracker on one of the devices and go to the Settings tab -> Cloud Services -> Device Sync Services option.

You now will need to tap the “Activate Sync Services” button to initiate the sync processes. Once this is done, you will most likely want to set the database on your Secondary device to be the same as the database on your Primary device. This will ensure that both devices contain the same content going forward. To do this, select the “Download Master DB to Device” option.

If you have additional devices, perform the same steps on each device.

Synchronization Operations

For the most part, the Synchronization Services should not require manual interactions on your part. The system is designed to take changes made to the database on one device and propagate those changes to the other devices in the synchronization pool. Most of this work happens in the background with only the occasional status message posted along the top of the screen to let you know what is going on.

When you create and save a new Diary Entry on a device, the sync services will come alive to figure out what has changed and communicate those changes to the central Dropbox repository. Your other devices will periodically poll the repository to see if new changes have arrived. When there are new changes, the other devices will pull those changes down from the repository and will apply them.

This process is meant to be automatic, so you will not normally need to interact with the sync system.

Synchronization Maintenance

In the event that your devices become out of sync with one another, we do include several options for resolving sync conflicts First, it is possible to manually initiate a synchronization action by tapping the “Synchronize DB Now” button in the Settings tab -> Cloud Services -> Device Sync Services screen. This will cause the device to contact the remote repository and request any unapplied database changes that it may have missed previously.

If you are still see discrepancies between the devices, then we recommend selecting one of the databases as the new baseline database and using the Upload Master DB to Cloud option to send a copy of that database to the Dropbox repository. You can then use the Download Master DB to Device option to apply this database to your other devices. Once complete, all your devices will be back in alignment with one another.

Disabling Synchronization Services

If you ever need/want to disable the synchronization services, you can disconnect the sync processes by going to the Settings tab -> Cloud Services -> Device Sync Services and choose the “Turn Off Sync Services for Device” option. This will shutdown the sync processes for this device only. Any other devices you have enabled will continue to sync between themselves.

A second alternative is to use the “Delete All Local & Remote Sync Data” option which will disable sync for this device PLUS it will remove all synchronization data from your Dropbox repository. You should only use this option if you intend to disable sync across all of your devices.