The CopyStorm/Medic Scan Timestamps tool performs an exhaustive comparison of Salesforce versus CopyStorm record modifications timestamps. This tool is provided for two reasons:
- It can be used to provide assurance that CopyStorm is copying all records properly.
- If Salesforce has an “after update” trigger on a table where the trigger updates the source table, this tool can be used to help track down the problem trigger.
Comparing modification timestamps from Salesforce with CopyStorm is a trickier task than one might think — here are a few of the reasons why:
- Salesforce stores timestamps to the nearest millisecond.
- Microsoft SQL/Server stores timestamps to the nearest 3 milliseconds.
- MySQL stores timestamps to the nearest second.
- Database to GMT time conversion works differently on different databases.
The Scan Timestamps tool will report the table, record id, timestamps, and timestamp difference for each record in Salesforce whose timestamp does not match CopyStorm and for records that are missing from CopyStorm. Records may be missing from CopyStorm due to being missed in a sync or because they will be synced in the future.
Run Scan Timestamps in a GUI
The UI for the Scan Timestamps tool contains four parts:
- The side if the dialog is used to select the tables to scan.
- The top part of the dialog has parameters that determine the date range of records to be updated. Leave these parameters blank to scan all records.
- The lower part of the dialog displays the progress of a scan as it happens.
- If an error is detected a button will appear in the lower right hand corner. Click on the button to see error details and/or export the errors to a file.
NOTE: We purposefully corrupted the CopyStorm database so the “Show Problems” button would appear in the following screen shot.
If the Show Problems button appears, it can be clicked to show the details for each problem record.
In this example we corrupted the CopyStorm database by hand so the Salesforce database would contain records missing from CopyStorm. The following screen shot is the result of clicking on the “Show Problems” button:
Running Scan Timestamps as a Batch Job
The Scan Timestamps tool can be run as a batch job using the following syntax:
- CopyStormMedic.bat -tool scanTimestamps -run configFile.copyStormMedic
- sh CopyStormMedic.sh -tool scanTimestamps -run configFile.copyStormMedic