CopyStorm/Medic

CopyStorm/Medic is a collection of tools for maintaining, validating, and repairing a CopyStorm database. CopyStorm/Medic can be downloaded from www.capstorm.com.

Tools provided with CopyStorm/Medic include:

Tool Tool Name Tool Path Description
Log Manager Other Tools
→Log Manager
View, manage, and export the status of a historical CopyStorm run.
Fix IsDeleted fixDeleted Other Tools
→Data Synchronization
→Fix Deleted
If a record is deleted in Salesforce and the Salesforce recycle bin entry is cleared before CopyStorm runs, CopyStorm will not know that the Salesforce record has been deleted. The Fix IsDeleted tool finds records in CopyStorm that are no longer in Salesforce and marks them as deleted in CopyStorm.
Refresh Formulas refreshFormulas Other Tools
→Data Synchronization
→Refresh Formulas
The Refresh Formulas tool updates all formula columns in a CopyStorm database with fresh data from Salesforce. This tool is needed when a formula definition changes in Salesforce.
Scan Timestamps scanTimestamps Other Tools
→Database Validation
→Scan Timestamps
The Scan Timestamps tool does an exhaustive comparison of Salesforce versus CopyStorm record modification timestamps. Capstorm provides this tool for two reasons:

  • To provide assurance that CopyStorm is copying all records properly.
  • To assist in tracking down “after update” triggers on a table that updates the source table.
Refresh Column(s) refreshColumns Other Tools
→Data Synchronization
→Refresh Columns
The Refresh Column(s) tool updates any column in a CopyStorm database with fresh data from Salesforce. It’s primary purpose is to update a particular formula column but can be used for any column type.
Table Editor tableEditor Other Tools
→Rarely Used
→Table Editor
Manually truncates or deletes CopyStorm tables. Note that CopyStorm will recreate the tables the next time it runs.
Count Records countRecords Other Tools
→Database Validation
→Count Records
Count the number of records in a Salesforce table and the corresponding CopyStorm table and compare the results.
Find Dirt Other Tools
→Salesforce Data Quality
→Find Dirt
The Find Dirt tool finds data in Salesforce fields that should not be possible and does not match the field definition.
Permission Checker findPermissionErrors Other Tools
→Database Validation
→Permission Checker
The Permission Checker tool discovers tables and fields that are defined in Salesforce but not visible to the current Salesforce user.
SQL Runner Other Tools
→Rarely Used
→SQL Runner
Can be used to run any SQL statement against the CopyStorm database. This is not a substitute for a fully-featured tool (e.g. MySQL Workbench) but is useful when a fully-featured tool is not available.
Fix Base64 fixbase64 Other Tools
→Data Synchronization
→Fix Base64
Find all null base64 columns in the CopyStorm database and update with the latest value in Salesforce.
Base64 Sanity Checker base64LinkChecker Other Tools
→Salesforce Data Quality
→Base64 Sanity Checker
Discover Attachment/Content/etc. base64 columns where Salesforce returns an error when attempting to read the associated data.
Purge Orphan base64 purgeOrphanBase64 Other Tools
→Data Synchronization
→Purge Orphan Base64
When large Base64 field values are added to the CopyStorm database, and chunking of that data is enabled, then those field values are broken down into segments that span an auxiliary table called CopyForceTableFieldChunks. It is not possible for the database to do a CASCADING delete on the CopyStorm tables to purge those data chunks when a record is deleted so this tool is provided to purge those orphaned data chunk records.
Image Scanner imageScanner Other Tools
→Data Synchronization
→Image Scanner
This tool scans for Salesforce images not stored in the CopyStorm Database. Tool scans for columns in selected tables which contain HTML (RichText) data. When HTML contains a reference to an image the image will be read and stored in the CopyStorm database.
Fix DocLinks fixDocLinks Other Tools
→Data Synchronization
→Image Scanner
The Fix DocLinks tool repairs records in the Salesforce ContentDocumentLink table. The Salesforce ContentDocumentLink table has query restrictions that make it impossible to efficiently perform an 100% accurate incremental backup
Base64 Export base64Export Other Tools
→Data Synchronization
→Export Base64 Objects to File System
The Base64 Export tool converts document records in the CopyStorm database into files in a file system.

Running CopyStorm/Medic in UI Mode

CopyStorm/Medic can be started as a graphical application by running CopyStormMedic.bat (or “sh CopyStormMedic.sh” on Linux). The UI mode is often the only way a site will use the tool, but it can also run as a batch job (details later in this article).

The CopyStorm/Medic UI is subdivided into several tabs — the Main tab contains Salesforce and CopyStorm connection credentials and other tabs contain individual CopyStorm/Medic tools. Like other Capstorm applications, a CopyStorm/Medic configuration can be saved/restored to/from an encrypted text file. Saved CopyStorm/Medic configuration files can be used to run CopyStorm/Medic as a batch job.

Running CopyStorm/Medic in Batch Mode

After saving a CopyStorm/Medic configuration file, it can be used to launch CopyStorm/Medic in batch mode.

The syntax for starting CopyStorm/Medic in batch mode is:

  • Windows: “CopyStormMedic.bat -tool ToolName -run configFile.CopyStormMedic”
  • Linux: “sh CopyStormMedic.sh -tool ToolName -run configFile.CopyStormMedic”

The value for ToolName must be selected from the table at the beginning of this article. For example, to run the Fix isDeleted tool on Windows:

  • CopyStormMedic.bat -tool fixDeleted -run configFile.copyStormMedic

Command Line Reference

Switch Parameter Description
-sftype Sandbox | Production Override the Salesforce instance type selected in the configuration file.
-sfuser Username Override the Salesforce username in the configuration file.
-sfpassword Password Override the Salesforce password in the configuration file.
-sftoken Security Token Override the Salesforce security token in the configuration file.
-dbconnection Connection String Override the database connection string in the configuration file.
-dbuser Username Override the database username in the configuration file.
-dbpassword Password Override the database password in the configuration file.
-dbschema Schema Name Override (or set) the database schema value in the configuration file.
-proxyHost Host Name Override the proxy server in the configuration file. Example: proxy.capstorm.com
-proxyPort Port Number Override the port number used by the proxy server.
-proxyUser Username Override the username used to authenticate with the proxy server.
-proxyPassword Password
-apiTraceFile filename Write the entire conversation with the Salesforce API to a file (the file may be huge).