Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Prior to running CopyStorm for the first time, create a fresh SQL/Server database.
The only difficult part when copying Salesforce to SQL/Server is constructing the connection string. Clicking on the Connection String Builder will open a form that, if you are running SQL/Server using a standard configuration, will construct a connection string for you.
The connection string can be verified by pressing the “Test SQLServer Connection” button.
The general form of a SQL/Server connection string is:
[server-name[\instance-name][:port-number]][;property=value]*
If you would like to see more information regarding SQL/Server connection strings or are not familiar with Microsoft’s type 4 JDBC driver, these resources may help:
Capstorm includes a MySQL driver from the to communicate with both Oracle’s MySQL product and with MariaDB.
Since MariaDB is provided by the original authors of MySQL and strives to maintain compatibility with Oracle’s MySQL, the driver packaged with CopyStorm is probably the only driver you will need. However, if you are encountering compatibility issues or other problems with MariaDB’s MySQL driver, you can download and install Oracle’s MySQL driver by hand.
CopyStorm does not package this driver with the product due to Oracle’s licensing policy for ISV’s, which makes it difficult to package the Oracle MySQL JDBC driver with a product.
To install the Oracle MySQL JDBC driver:
Delete the file lib/mariadb-java-client-*.jar from the CopyStorm installation directory.
Prior to running CopyStorm for the first time, create a fresh Oracle database.
The only complicated configuration required in the CopyStorm Main tab is the Oracle connection string. Clicking on the Connection String Builder button will open a form that will construct the connection string for you, given database information.
You will likely need one of these forms:
myDomain.com:1521:orcl
myDomain.com:1521:xe
localhost:1521
The connection string can be verified by pressing the “Test Oracle Connection” button.
The following is a screen shot of a working Oracle setup on one of our test computers:
Prior to running CopyStorm for the first time, create a fresh PostgreSQL database.
The only complicated configuration required in the CopyStorm Main tab is the PostgreSQL connection string. Clicking on the Connection String Builder button will open a form that will construct the connection string for you, given database information.
The general form of a PostgreSQL connection string is:
[//host[:port]][/database-name]
Example:
//localhost/CopystormBackupDatabase
By default, a PostgreSQL connection will use the public schema. This can be overridden by entering a schema name.
The following is a screen shot of a working PostgreSQL setup on one of our test computers:
Before running CopyStorm for the first time, create a dedicated Snowflake database for your Salesforce data.
Compared to the other Database types, Snowflake’s connection string is more complex and carries more information. For this reason, it is recommended to use the Connection String Builder to create a valid Connection String.
After clicking on the “Connection String Builder” button, a dialog menu will open, as seen below.
The Configuration Tab contains options to modify the CopyStorm runtime, including the list of Salesforce Objects/Tables to copy.
The default view of the Configuration Tab contains core configuration options that are commonly modified.
To view additional options, change the “Configuration Level” dropdown:
Standard
Core CopyStorm configuration and performance tuning.
Options used to ensure that CopyStorm does not interfere with other operations (e.g. limiting Salesforce API Call consumption).
Advanced
CopyStorm troubleshooting and logging options.
Developer
CopyStorm application tuning options, advanced network configurations, and query optimization options.
The Guardrails Tab is used to limit the potential impact of individual CopyStorm runtimes and to ensure that CopyStorm jobs do not interfere with other operations.
The Maintenance Configuration Editor is used when troubleshooting replication issues.
The Database Reset Configuration Editor is used to delete and rebuild portions of the CopyStorm database.
Options within the Database Reset Configuration Editor are only used in specific circumstances and should not be left enabled as part of normal backups.
The External Configuration Editor is used to provide external folders used by CopyStorm to read configurations and to store temporary files.


The All Changes Filter Rul e always indicates that a record should be snapshot for a change to any field. Basically, if a caller asks if a record should be snapshot then the All Changes Filter Rule will always respond with “Yes.”
This rule is useful for any table where all changes should be included in the snapshot.
Since the All Changes Filter Rule always says “Yes, this record should be snapshot”, naturally its only configuration parameter is which tables to include in the snapshot.

The Deleted Records Filter Rule indicates that a CopyStorm record should be snapshot only when its IsDeleted flag is set to true. The primary use of the filter is to manage the records added to a recycle bin.
Though CopyStorm is initialized with a policy, Default Recycle Bin, that uses this filter rule, a user can added additional snapshot policies based on a Deleted Records Filter Rule if a non-standard recycle bin is desired.
The only configuration for a Deleted Records Filter Rule is which tables to include in the snapshot.

Welcome to the CopyStorm/View Learning Center.
In this area you will find articles explaining how to quickly create a database combining one or more tables from multiple CopyStorm backups.

CopyStorm/View builds SQL which combines tables from multiple CopyStorm backups into a new database built from database views.
For example:
Suppose an organization has three divisions: Americas, Europe, and South America. Each division has its own Salesforce instance, using CopyStorm for backups.
The CEO is asking for daily reports on opportunity generation and wants to see it across all divisions.
CopyStorm/View helps solve this problem by creating a single database including data from all three divisions by creating views for selected tables that look like:
CREATE VIEW Opportunity( CopStormDatabase, Id, Name, …) AS SELECT ‘Americas’, Id, Name, … FROM AmericasBackup UNION ALL SELECT ‘Europe’, Id, Name, … FROM EuropeAmericasBackup UNION ALL SELECT ‘SouthAmerica’, Id, Name, … FROM SouthAmericaAmericasBackup
This makes finding the answer for the CEO as simple as:
SELECT CopyStormDatabase AS Division, Name, Amount WHERE CreatedDate >= TODAY
Server Name
The IP Address, URL, or server name of the snowflake instance. Port number is optional.
Database Name
The name of the Snowflake database that CopyStorm will populate with Salesforce data.
Private Key File
The file path to the Snowflake Private key. For more information on Private Keys and Snowflake’s key-pair authentication, refer to Snowflake Documentation.
Key File Password
If your Private key was configured to require a password for use in authentication, enter it here. If your Snowflake Private key was configured as to not require a password, this field can be left blank.
Warehouse (optional)
The name of a Warehouse in Snowflake that you wish to use. For more information on Snowflake Warehouses, refer to Snowflake Documentation.
Proxy Host (optional)
The IP address, or URL of a proxy used to connect to a Snowflake instance.
Proxy Port (optional)
The port number associated with a proxy used to connect to a Snowflake instance.
Proxy User (optional)
The username to authenticate a request with a proxy used to connect to a Snowflake instance.
Proxy Password (optional)
The password used to authenticate a request to a proxy used to connect to a Snowflake instance
Proxy Protocol (optional)
The protocol by which a connection will be made to a proxy used to connect to a Snowflake instance. Select either HTTP, or HTTPS.




No
By default, CopyStorm will look for configuration file overrides in the directory “config” within the CopyStorm installation directory. If this value is set then CopyStorm will also look in this directory for configuration file overrides.
Temp Directory
Blank
No
By default, CopyStorm will store temporary files containing Salesforce Files and Attachments in the default Java temporary directory. If this value is set then CopyStorm will instead store temporary files in the provided directory. Note: If large files are being downloaded from Salesforce, this directory can become many GB in size.
Config Directory

Blank
No
Limits the maximum number of transactions (queries) to send to Salesforce. This option can help avoid exceeding your organizational limit for transactions per 24-hour period. CopyStorm will stop when this value is exceeded. Usually this parameter is only set for the initial load of the CopyStorm database.
API Threshold
Blank
No
Maximum starting API utilization. When CopyStorm is initializing the data copy, if the current Salesforce API usage is above the provided percentage, the copy job is not started.
Maximum Runtime
Blank
No
The maximum number of minutes CopyStorm will run before gracefully shutting down. Leave this blank to disable the time limit.
Production Database Protection
Checked
No
If Checked, CopyStorm will not allow a production Salesforce database to be overwritten by another Salesforce’s data.
Schema Only Backup
Unchecked
No
If Checked, CopyStorm will back up the Salesforce schema, but Salesforce data will not be included. This option is typically used during Salesforce migrations.
API Call Limit

Blank
Unchecked
No
If checked, CopyStorm will truncate all data from each table and start the backup of records from scratch.
Force Rebuild
Unchecked
No
If checked, CopyStorm will drop each table and rebuild it from scratch.
Keep Deleted Columns
Unchecked
No
If checked, CopyStorm will retain a column in the target database if it has been dropped in Salesforce. By default CopyStorm will drop a column in the target database if it is dropped in Salesforce.
Refresh Columns on DDL Error
Unchecked
No
If checked, CopyStorm will rebuild and refresh columns if an unrecoverable DDL exception occurs. CopyStorm will create a new column, requery Salesforce for the column's data, and will rename the new column to replace the old column. This toggle is useful when Salesforce field definitions change in such a way that the corresponding Alter Column SQL commands fail.
Rebuild on DDL Errors
Unchecked
No
If checked, CopyStorm will drop and rebuild a table if an ALTER statement on the table causes a DDLexception.

Force Truncate
Choose MySQL as the database type.
CopyStorm will ask you if it’s OK to download and install Oracle’s JDBC driver.
If you would prefer to install Oracle’s JDBC driver by hand:
Go to Oracle’s download page
Download and unzip the driver.
Copy the jar file to CopyStorm’s lib directory.
Restart CopyStorm
All MySQL JDBC drivers communicate with MySQL using TCP/IP. If CopyStorm is having trouble connecting to the MySQL database, you may not have TCP/IP enabled. If so, there are a number of resources providing instructions on enabling this feature (the manual for your version of MySQL, running a web search for “MySQL enable TCP”, etc…).
The only complicated configuration required in the CopyStorm Main tab is the MySQL connection string. Clicking on the Connection String Builder button will open a form that will construct the connection string for you, given database information.
The connection string can be verified by pressing the “Test MySQL Connection” button.
The format of a MySQL connection string is:
//[host][:port]/[database-name]
Example:
//localhost/MyCopyStormDatabase
If your site does not permit communication with the default Capstorm license server located at https://license.capstorm.com, the configuration file “Capstorm.xml” allows overriding the endpoint.
An example that changes CopyStorm to use a http (non-SSL) endpoint for license management is:
<Capstorm>
<licenseServer url="https://license.capstorm.com/LicenseStore/GetLicense" />
</Capstorm>There are a number of other elements that can appear in a Capstorm.xml file, but you should not change without being instructed to by Capstorm. However, if you want to confuse your colleagues you can change CopyStorm’s background color:
<Capstorm>
<backgroundColor red="255" green="100" blue="15" />
</Capstorm>Internally, CopyStorm replicates data to Snowflake by creating a CSV file of the records being backed up and uploading the CSV file to Snowflake. It may be required to change this staging location to meet business requirements. CopyStorm allows customers to specify a different Snowflake stage by following this process:
Create a xml file named “SnowflakeDatabaseBuilder.xml”
Then place the contents below into the xml file.
<SnowflakeDatabaseBuilder>
<SnowflakeStage value="@clientProvidedStagePath"/>
</SnowflakeDatabaseBuilder>You will need to replace “clientProvidedStagePath” with the Snowflake stage’s path, then place this file into CopyStorm/config directory and relaunch CopyStorm.
Note: This feature is available in CopyStorm versions 10.56.5 and above.
The CopyStorm/Medic Delete Salesforce Records tool has the ability to run batch mode without the need of opening the application GUI and click through the steps of the tool. Execution of the tool in this manner requires a CopyStorm/Medic configuration file that already has all desired configuration options and filters selected and saved. For more information regarding the setup of this tool, see here.
When executing the Delete Salesforce Records tool through the CopyStorm/Medic GUI, there is a security pop-up that requires users to type the name of the target Salesforce org before beginning the deletion process. This security feature does NOT occur when executing in batch mode.
Example Usage
This example is for Windows installations of CopyStorm/Medic. For Linux/Mac installations, change CopyStormMedic.bat to CopyStormMedic.sh
CopyStormMedic.bat -tool deleteTool -run "/path/to/config.copyStormMedic"While commonly used schema options within CopyStorm are directly exposed in the CopyStorm GUI, a number of schema initialization parameters can only be provided by providing CopyStorm with a JDBCDatabaseBuilderConfig.xml file.
To use the options detailed in this page, create a JDBCDatabaseBuilderConfig.xml file and copy it to one of the CopyStorm Configuration File Directories.
The following XML will cause CopyStorm to create a Salesforce data table and column names in ALL CAPS.
<JDBCDatabaseBuilder>
<!--
Set these values to "true" to capitalize table and column names.
-->
<CapitalizeTableNames enabled="true" />
<CapitalizeColumnNames enabled="true" />
</JDBCDatabaseBuilder>The following XML will cause CopyStorm to remove Salesforce-standard postfixes from database table and column names.
Oracle 12c added support for extending the allowed length of VARCHAR2 columns from 4000 to 32,767 bytes but made the discovery of whether this feature is enabled require privileges that a normal Oracle user is not granted. This article explains how to tell CopyStorm that the Oracle feature “max_string_size=EXTENDED” is enabled without requiring special Oracle permissions.
For your reference, if an Oracle user has enough privileges then a simple query can be used to determine if the EXTENDED Varchar2 feature is enabled.
SELECT name,value FROM V$PARAMETER WHERE name=’max_string_size’
It is likely that your account will return a “Table or View not Found” when running this query because of your limited permissions.
To inform CopyStorm that the EXTENDED feature is enabled simply create a file named Oracle.xml and drop into the your private CopyStorm configuration directory specified on the Advanced tab or into the directory [CopyStormRootDir]/config. The content of the Oracle.xml file should be:
<Oracle>
<DatabaseProperty name="max_string_size" value="EXTENDED" />
</Oracle>Restart CopyStorm and future VARCHAR2 columns will be up to 32,764 bytes in length. You may wonder why the limit is 32,764 rather than 32,767. The reason is that Salesforce defaults to a UTF-8 Extended character set and each character can take up to 4 bytes.
<JDBCDatabaseBuilder>
<!--
Remove the following postfixes from Salesforce data tables and columns
-->
<RemovePostFixFromTableName postfix="__c,__ka,__kav,__b,__x" />
<RemovePostFixFromColumnName postfix="__c" />
</JDBCDatabaseBuilder>Though every Snapshot Policy has a default record retention rule, it is often convenient to have a custom retention rule for specific tables. Example:
By default, retain records in a snapshot for 90 days.
Retain Account, Contact, and Opportunity records for 365 days.
Retain Case records for 2 years.
Do not retain EmailMessage records.
The following two screens illustrate how to set up this policy.
Clicking on the Advanced button launches an editor to override the default record retention rule. The following example sets up the scenario described at the top of this page.
A SQL Predicate Filter Rul e is useful when other filtering techniques are insufficient and it is possible to write a database SQL fragment to identify records that match a snapshot policy. It is rare to need this filter rule because filtering can typically be accomplished using the graphical Column Expression Filter Rule.
A SQL Predicate Filter Rule has a single configuration parameter: a fragment of database specific SQL will be added to the WHERE clause of a SQL statement generated by CopyStorm. Example:
SELECT Id FROM Account WHERE Id IN (…) AND (configuration parameter from SQL Predicate Filter)
If the argument to a SQL Predicate Filter Rule was “RecordAge__c>46 OR alwaysSnapshot__c=1” then SQL statements generated by CopyStorm would look like:
SELECT Id FROM Account WHERE Id IN (…) AND (RecordAge__c>46 OR alwaysSnapshot__c=1)
A SQL Predicate Filter Rule also includes a rule for which tables to include in the snapshot.
The Run Snapshot Policy Retention Rules feature is used to force a snapshot to look for records that should be deleted from the Snapshot based on its retention rules and then delete the records. This happens automatically for active Snapshot Policies as part of the regular CopyStorm backup process, so this feature is most useful for inactive Snapshot Policies.
The Run Snapshot Policy Retention Rules feature is accessed from the right-click context menu on the CopyStorm Snapshot tab.

There are only two parameter options when running retention rules.
Search Batch Size — number of records that will be searched at once for potential deletion.
Deletion Batch Size — number of records that will be deleted in a single database transaction.
Like most database systems, the CopyStorm Snapshot system will operate most efficiently when its has statistics about what is stored in snapshots. Example:
If CopyStorm knows what tables have been snapshot by a policy then it can limit searches to just these tables.
If CopyStorm knows how may records are in a snapshot it can generated more efficient SQL queries.
For the most part, CopyStorm Snapshot updates statistics without any user intervention. This page, however, describes how to force CopyStorm Snapshot to update statistics if the most accurate statistics possible are desired or if the statistics have been corrupted. Note: it is unlikely that you will ever need this feature.
The Update Statistic s feature is accessed from the right-click context menu on the CopyStorm Snapshot tab.
In the Refresh Statistics dialog there is the option to refresh statistics for a single snapshot or for all snapshots in the system. The following image illustrates what the screen may look like after refreshing statistics for a single snapshot.
No
If a date is specified, then only records created or modified on or after the specified date are copied. Built in relative dates are available from a pull-down menu or a fixed date can be entered. When entering a date, the interface will have a yellow background which clears when a date is recognized.
Fixed date formats are:
dd-MMM-yy (19-May-1984)
M/d/y (5/19/84)
dd.MM.yy (19.5.1984)
Modified Thru
Blank
No
If a date is specified, only records created on or modified up to or on the specified date are copied. See format notes above.
Ignore Timestamps
Unchecked
No
If checked, CopyStorm will retrieve records in ID order rather than timestamp order.
WARNING: unless a CopyStorm job runs to completion without errors, using this option will make subsequent incremental updates fail to fetch the proper records.
Analyze UNKNOWN_EXCEPTION
Unchecked
No
When Salesforce returns an UNKNOWN_EXCEPTION this generally indicates that a SOQL query failed in a way the Salesforce infrastructure did not expect. When this option is checked and CopyStorm is running in GUI mode, CopyStorm will do a rather expensive analysis of the failed SOQL and attempt to determine a very small SOQL statement which exhibits the problem. The very small SOQL statement is what Salesforce support will require (even demand!).
Modified Since

The Database Networking Configuration Editor contains networking and SQL parameters used when communicating with the CopyStorm database.
Destination Batch Size
The CopyStorm Snapshot tab is the launch point for creating, editing, using, and exploring CopyStorm snapshot data sources. A CopyStorm Snapshot is a database store containing tamper-proof snapshots of records from any Salesforce table where the snap-shots are taken based upon rules specified by a user.
CopyStorm Snapshots can be used to store many types of data.
A Snapshot can be used to create a unlimited duration recycle bin or a recycle bin where data retention policies vary by table.
A Snapshot can be used to permanently save a copy of Salesforce records on demand.
A Snapshot can be used to track all versions of critical Salesforce records.
Each CopyStorm Snapshot has policies which determine which table and which records should be snapshot. Like the core CopyStorm backup process, Snapshot policies can be applied automatically as a regular part of a backup or can be applied on demand.
The CopyStorm Snapshot tab lists all currently defined snapshots, can be used to create a new snapshot, and is the launch point for most Snapshot operations including:
To get started with CopyStorm Snapshots, please review the following:
Once you have the basics down try one of these tutorials:
Finally, jump to any of the following reference articles:
The Database Indexing Configuration Editor is used to enable or disable automatic database index creation.
Create Indexes
A Snapshot Policy Filter Rule contains the logic which determines if a database record should be processed by the snapshot policy. There are several types of policy filters built into CopyStorm Snapshot.
All Changes — this filter always indicates that a record should be processed. Use it when all changes to records should be snapshot.
Column Expression — with this filter a rich expression based on columns in a record can be used to determine if a record should be snapshot.
Deleted Records — this filter only matches records that have been deleted in Salesforce. This filter is used to build recycle bin type policies.
— this advanced filter supports injecting user specific SQL fragments into a query that determines if a record should be snapshot.
The Filter Rule for a Snapshot Policy is specified on the Main Tab of the snapshot editor.
Parameters specific to the selected Filter Rule Type can be set on the Filter Rule Parameters tab.
Nearly all Filter Rule Types support the concept of a White and/or Black list for selecting the tables to be processed by the policy.
A White List indicates tables to include in the snapshot.
A Black List indicates tables to exclude from the snapshot. All tables not on the black list will be included.
Typically the technique used for selecting tables for a snapshot is either by White List or Black List. However, if you are brave (and using regular expressions) both a White and Black list may be useful.
The following example (from the All Changes filter rule type) illustrate the components of the White/Black list editor.
The pull-down menu indicates whether tables should be selected by White list, Black list, or both.
The dialog for selecting tables is nearly the same for a White or Black list. The following example is for a White list.
A Column Expression Filter Rule is a rich graphical tool for specifying the conditions under which a record should be added to a CopyStorm snapshot. The interface is patterned after the Salesforce Report Writer expression builder and should feel familiar to most users.
The first step, after selecting the Column Expression option from the Filter Rule Type pull-down, is to launch the column expression filter editor.
Clicking on the Edit Column Expression Filter button will launch the editor.
The following example creates a filter that finds records where:
the Name field contains “Louis”
The screen image shows the dialog after the Refresh Preview button has been clicked. Notice that the searched database has multiple accounts with the similar names that matched the filter.
After saving changes and returning to the policy editor, a summary of the filter will be shown. To change the filter simply click on the Edit Column Expression Rule again.
The list of available columns is determined as the intersection of all columns from table names matched by the policy’s Include Tables list. If you see a single column named Id then the policy is including all tables in Salesforce and the only common column name is Id. To increase the number of available columns return to the policy editor page and adjust the list of included tables.
This issue only occurs when there are no matching records in the CopyStorm database in any of the selected tables. The solution is to modify the query.
The Snapshot Explorer is a tool for viewing and exporting data from a CopyStorm Snapshot. The tool is launched from the CopyStorm Snapshot tab.
The Snapshot Explorer has four stages, indicated by the navigation bar at the top of the dialog.
Start — Select the snapshot to explore.
Select Table — Select a table from the Snapshot to explore.
Preview — Build a query and preview the selected data from the Snapshot.
Export — Export the data from the snapshot in a variety of formats.
In the Select Table stage, select the table you wish to explore and optionally select the columns in the table to view. Note that you can always return to this stage in order to update the selected columns.
In the Preview Stage, optionally create a filter that limits the records to view or export. The filter is created by dragging and dropping elements from the left hand side of the screen to the big white box on the right.
In the example screen shot a filter for finding records with a capstorm email domain has been specified and then the Refresh Preview button was clicked.
In the Export Stage:
Review and update the list of columns to export.
Click on the Start Snapshot Export button and the system will display a typical Save As dialog.
By default, only the most recent version of a record will be written in the export. To override this behavior and write ALL VERSIONS of a record to the export check the box to Include All Snapshot Record Versions of a Salesforce Record. Of course, even if this option is checked, a record still has to pass the filter criteria from the Preview stage.
The Save As dialog which appears after clicking on Start Snapshot Export will look like your system’s default dialog with the addition of a file format selection section.
When the result of an export is loaded into your favorite spreadsheet it will look like:
The Run Snapshot Policy feature is used to run a snapshot policy against existing data in a CopyStorm snapshot on demand. This process is useful in a number of circumstances.
Suppose a new snapshot for all Cases older than 2 years was just defined. Before activating the snapshot policy (so it will run automatically when a backup happens) you may want to snapshot all existing cases in the CopyStorm database that are older than 2 years.
Your compliance department has told you to snapshot all records related to ACME, Inc. because they have filed a breach lawsuit against the company. In this case the snapshot policy that you define may run just once — on demand — and never be scheduled to run automatically.
The Run Snapshot Policy feature is accessed from the right-click context menu on the CopyStorm Snapshot tab.
There are just a few options to run a Snapshot Policy by hand.
Scan Records From sets a start date from which records will be searched. By default the start date will be the date of the earliest record in the corresponding CopyStorm table.
Scan Records Thru sets the last date on which records will be searched. By default the end data will be the most recent date in the CopyStorm database.
# Concurrent Searches limits the number of tables that will be processed concurrently. You can set it to a large value (like 200) but be aware that a large number will consume considerable database resources.
While a Snapshot Policy is running the screen will continuously update with progress information. At any point in time you can cancel the snapshot process and only records snapshot so far will be preserved in the database.
The following screenshot illustrates how the dialog will appear after a snapshot policy has run to completion. Note that are several reasons that a record may be processed but not snapshot.
If a record fails to match the filter associated with the snapshot policy then it will be skipped.
If a record matches the filter associated with the snapshot policy but is already in the snapshot with exactly the same data then it will be skipped.
The Batch File tab is used to generate a script that can be used to launch CopyStorm as a batch job. Generated scripts encapsulate everything needed to run a CopyStorm job, including:
The location of CopyStorm.
The location of the configuration file defining backup parameters.
For many sites a generated batch file is not necessary due to built-in command line options in the main CopyStorm launch script allowing batch mode execution. Example command lines include:
sh CopyStorm.sh -run /path/to/my/configFile.copyStorm
CopyStorm.bat -run C:\path\to\my\configFile.copyStorm
The core function of the Batch File tab is to generate a script file that will:
Run CopyStorm using a specific configuration file from any directory using just the name of the script file.
Capture any exception information from CopyStorm to “do something” with the data. By default the script emails exception information to a user but this can easily be adapted to other purposes.
If you have configured the , the process for generating a script file is simple. This is the approach used nearly 100% of the time:
Use the “Script Format” menu to specify the desired scripting language — bash, bat, python, or vbs.
Click on the “Generate Script” button.
Click on the “Save Script” button and save the script to a file.
If your site cannot use the built-in Notification system the process for generating a script file is:
Use the “Script Format” menu to select one of the script formats marked as Advanced.
Enter an email address for the notification sent each time the script runs.
Enter an email address for the notification sent if CopyStorm reports an exception.
Enter the name of your local SMTP server.
After these steps are completed, you own the generated script file and can change it in any way you prefer.
If you have trouble getting the email portion to work properly, please read .
The Core Configuration Editor is used to specify which objects should be replicated to the database, and to control how long records will be retained in the database after being deleted in Salesforce.
The “Select Objects” dropdown selects the objects which will be copied from Salesforce to the database.
The easiest way to configure which objects to copy is to select one of the pre-configured options:
All Objects
Copy all Salesforce objects that the CopyStorm Salesforce User has access to.
Automatically copy newly created Salesforce Objects when they become visible to the CopyStorm Salesforce User.
All Objects Except for Files
Copy all Salesforce objects that the CopyStorm Salesforce User has access to, except for Base64/File objects (e.g. Attachment, ContentVersion).
Automatically copy newly created Salesforce Objects when they become visible to the CopyStorm Salesforce User.
All Objects That Can Be Restored
Copy all Salesforce objects that the CopyStorm Salesforce User has access to, except for objects that are known to not be recoverable (e.g. External objects, History objects).
Automatically copy newly created Salesforce Objects when they become visible to the CopyStorm Salesforce User.
To configure CopyStorm to copy specific objects, select from the “Manual Selection” options. Selecting a “Manual Selection” will show an “Include” or “Exclude” list. To configure the list, either:
Type or copy-paste the API names of selected objects into the “Select Objects…” section as a comma separated list.
Click on the “Select Objects…” button.
This will cause CopyStorm to connect to Salesforce to determine the Objects available.
A dialog will open allowing selection of available Salesforce Objects.
Manual selection options include:
Manual Selection – Include List: Choose Objects to Include
All selected objects will be copied.
Manual Selection – Exclude List: Choose Objects to Exclude
All objects visible to the CopyStorm Salesforce User will be copied, except for selected objects.
The “Delete Older Than” input controls when to remove records that have been deleted from Salesforce from the target database.
0 (zero): This is the default value. Remove deleted records immediately from the target database.
Blank (no value specified): Mark deleted records as IsDeleted, and never remove deleted records.
A non-zero number: Mark deleted records as IsDeleted, and remove records when they have been deleted from Salesforce for the number of days specified by “Delete Older Than”.
CopyStorm discovers deleted records by reading the Salesforce recycle bin. If the recycle bin is emptied before CopyStorm discovers the deletion, or if records have been removed with a hard delete, CopyStorm will not know that the records are deleted. This method is used by some applications. If this is occurring, please use Capstorm’s CopyStorm/Medic tool to discover the deleted records and mark the records as IsDeleted in the target database.
If the “Include Metadata” checkbox is checked, CopyStorm will include selected metadata components in the backup. By default, if checked, all metadata components are included.
Clicking the "Edit" button next to this checkbox opens the metadata selection dialog.
The Metadata Selection Mode dropdown offers three options:
All Metadata Types — All available Salesforce metadata types are backed up. This is the default. Any new metadata types added by Salesforce in the future will automatically be included.
Include Selected Types — Only the specific metadata types selected from the list will be backed up. Use this to back up a small, known set of types and ignore everything else.
Exclude Selected Types — All available metadata types are backed up except the ones selected from the list. Use this for broad coverage but need to omit a few specific types. Like "All Metadata Types," any new metadata types added by Salesforce in the future will automatically be included. The exclusion list is applied against whatever is currently available, not a fixed snapshot.
The dialog also includes:
Include Managed Packages — When checked, metadata from managed packages is included in the backup.
Delete Metadata History after N days — Controls how long historical versions are retained. Leave blank to keep history indefinitely; set to 0 to keep only the current version with no history.
The Salesforce API Configuration Editor is used to choose which Salesforce API will be used to copy data.
The Data API Options section is used to configure the primary Salesforce API that will be used to copy data.
Salesforce Threads
The number of Salesforce Objects that will be backed up at the same time by CopyStorm.
The default number is 3, allowable values are 1 – 20. For maximum performance, the optimal value for this parameter is typically 10.
Salesforce API
The default API to use when querying Salesforce. The default API is REST.
Note that CopyStorm will, by default, use REST of any table containing a BASE64 column because this minimizes memory usage for most databases. Common BASE64 tables include Attachment and ContentVersion.
The Bulk API parameters section controls when CopyStorm will use the Salesforce Bulk API rather than the default API.
Note that:
A Salesforce organization has a limited number of Bulk API calls per 24 hour rolling period. Be aware of your limit.
The SOAP or REST API will almost always perform better than the Bulk API if performance is measured in the amount of time a user has to wait for a backup to complete.
We suspect that this is because Bulk API queries run on a reduced priority thread within the Salesforce infrastructure.
The Metadata Data API Options section is used to configure the primary Salesforce API that will be used to copy Metadata.
Metadata Threads
The number of Salesforce Metadata Types that will be backed up at the same time by CopyStorm.
The default number is 5, allowable values are 1 – 10. For maximum performance, the optimal value for this parameter is typically 5.
To configure a S3 partition in CopyStorm/Medic, provide connection information for the target S3 bucket.
CopyStorm will use the AWS Default Credential Provider Chain to connect to S3. Environment variables, Java Properties, IAM Roles, etc… can be used to authorize CopyStorm for S3 access.
To initialize the partition, CopyStorm/Medic will:
Copy field data for the selected fields into the target bucket, using the folder name as a prefix.
DROP the database storage used by the selected fields.
When CopyStorm replicates new or updated records, field values for the selected fields will be kept in files in the target bucket.
Record data is kept in a nested structure generated using Salesforce Ids.
CopyStorm supports saving a backup configuration to a file in two formats:
Plain-text XML.
Encrypted text (256-bit DES encryption).
Both formats support the optional saving of Salesforce and database credentials. A CopyStorm backup configuration can be completely restored by going to File/Open in the application menu. To save a configuration, go to File/Save in the application menu:
The plain-text XML version of the file is fairly complex and not intended to be edited by hand, but it is possible. However, Capstorm may not provide support for problems arising from a hand-edited configuration file.
To configure a Folder partition in CopyStorm/Medic, provide the target folder:
To initialize the target directory, CopyStorm/Medic will:
Copy field data for the selected fields into the target folder.
DROP the database storage used by the selected fields.
When CopyStorm replicates new or updated records, field values for the selected fields will be kept in files in the target directory.
Record data is kept in nested folders generated using Salesforce Ids.
The Database Query Optimization Parameter Editor controls optimizations used when generating SQL queries for the CopyStorm database.
The Salesforce Network Configuration Editor contains networking and SQL parameters used when communicating with Salesforce.
The SOQL Query Optimization Parameter Editor controls optimizations used when generating SOQL queries for Salesforce.
The Main Tab is used to manage connection information and credentials for Salesforce and the target database.
Specifies the type of target database. Available database targets depend on the version of CopyStorm you have installed.
These parameters are used when authenticating with Salesforce using a Username and Password.
For certificate based authentication, see the .
For SSO-based authentication, see .
The Field History Configuration editor is used to enable and configure CopyStorm field history tracking.
CopyStorm field history tracking supports the tracking of nearly all field changes in every Salesforce object.
If the “Track Field History” checkbox is selected, the default behavior is to track all changes to all fields. To limit field history tracking or to customize retention periods for field history changes, click on the “Edit” button for advanced Field History configuration.
Field history changes are kept in a database table named “CopyForceFieldHistory”. For details see:
Field History is controlled by three major elements:
CopyStorm includes a number of useful tools that can be found under the “Tools” menu in the top-left corner of the application GUI.
The following tools are included:
SOQL Query Tool (Salesforce)
SQL Query Tool (Database)
Skipped Record Log Explorer
The CopyStorm/Medic Refresh Formulas tool replaces the values of formula columns in CopyStorm with their current value in Salesforce.
This tool is typically used when the definition of a formula is modified in Salesforce.
CopyStorm minimizes the amount of records copied from Salesforce by only copying records whose modification date has changed. When a formula column is modified in Salesforce record modification times do not change so CopyStorm does not pick up the new formula values for older records. There are two ways to update this data in the CopyStorm database:
Performing a forced update on the CopyStorm database using CopyStorm. This technique works but will cause every column in the CopyStorm tables to be read from Salesforce and written to CopyStorm.
Using this tool to limit reads and updates from Salesforce to formula columns. This technique can be many times faster than a forced update.
The CopyStorm/Medic Fix IsDeleted tool identifies records that have been deleted in Salesforce, removed from the Salesforce recycle bin, but not marked as deleted in CopyStorm.
This situation occurs when:
A user deletes records in Salesforce and empties the recycle bin BEFORE CopyStorm has run.
A system administrator empties the global recycle bin.
A Salesforce API program does a hard delete on Salesforce records. A hard delete bypasses the Salesforce recycle bin mechanism.
The CopyStorm/Medic Refresh Columns tool replaces the value of one or more columns in CopyStorm with their current values in Salesforce.
This tool is typically used when the definition of a formula is modified in Salesforce or when a previously hidden column becomes visible to the user CopyStorm uses to authenticate with Salesforce.
When one or more columns in CopyStorm do not match the current value in Salesforce there are two methods which can fix the problem:
Perform a forced update on the CopyStorm database using CopyStorm. This technique works but will cause every column in the CopyStorm tables to be read from Salesforce and written to CopyStorm, including columns whose data is already synchronized.
Use this tool to limit reads/updates from Salesforce to specific columns. This technique can be many times faster than a forced update, and does not re-synchronize data that is already synchronized.
When the Salesforce REST API returns a record with a BASE64 column, the BASE64 data is returned as a hyperlink that can be used to read the raw bytes. Experience has shown that it is possible for the hyperlink returned by Salesforce to return a HTTP 404 (not found) or an HTTP 500 (internal lightning platform error) rather than the expected HTTP 200 (OK). When this happens:
The BASE64 data cannot be read by the REST API.
The same operation using the SOAP API results in an UNKNOWN_EXCEPTION or an unparsable SOAP body
The Base64 Sanity Checker tool tests the hyperlinks returned by the REST API and reports the ID of records where the hyperlink fails (e.g. Does not return a HTTP 200). It is often wise to check each reported record using the Salesforce GUI to make sure that the data is really available. If you find a corrupted Attachment record report it to Salesforce.
The CopyStorm/Medic Table Editor tool is for non-DBA people who want to remove data or tables from a CopyStorm database. Why would someone want to do this?
You may want to drop a specific table so CopyStorm will rebuild it the next time it runs. This case comes up when a column definition in Salesforce has changed and the corresponding change is not supported by the target database.
You may want to drop a Salesforce Feed table, like AccountFeed, so CopyStorm will replace it with a database view the next time it runs.
You may want to make CopyStorm completely forget about a database table it created. This action drops a table and all references to it in the CopyStorm metadata.
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. There are two primary reasons that block an 100% accurate backup.
The ContentDocumentLink table cannot be queried only on its SystemModStamp field.
ContentDocumentLink permission values can be changed and there is no way to find the changes efficiently because of reason #1.
In practice most customers will either never run this tool or run it on a weekly basis.
To access the Fix DocLinks GUI:
When partitioning tables containing large volumes of data or Base64-encoded content, the partition creation process can fail mid-way due to various issues, such as:
Application freezes or crashes
Transient network errors
Resource exhaustion (e.g. memory or CPU spikes)
The CopyStorm/Medic Find Dirt tool finds data in Salesforce fields that should not be possible. Capstorm provides this tool because, as a Salesforce instance ages, it will often accumulate data that does not match the field definition. Here are a few examples:
A string field is limited to 80 characters but has a few records where 96 characters are stored.
A numeric field is limited to zero digits after the decimal point but Apex code inserted records where digits appear.
This tool will report the table, record id, column name, and problem description for any field that does not match the Salesforce field definition.
To access the Find Dirt GUI:
Though MySQL claims support for all UTF-8 characters, experience indicates that not all MySQL variants support the full extended 4 byte UTF-8 character set. When MySQL fails to recognize an extended UTF-8 character and error like this will be displayed:
java.sql.BatchUpdateException: Incorrect string value: ‘\xF0\x9F\x98\x8A’ for column ‘CommentBody’ at row 48
To get around this issue, you can configure CopyStorm to replace unsupported 4 byte UTF-8 characters with a substitution.
Note: The extended 4 byte UTF-8 character set contains like 100 variations of a smiley face, trees, hamburgers, etc…
Character mappings are defined in a “UTF8Tool.xml” configuration file that can be placed in either the “config” subdirectory of the CopyStorm installation or in a custom config directory you have created. The following UTF8Tool.xml will cause CopyStorm to replace the 4 byte UTF-8 characters for two smiley faces to be converted to their more old fashioned counterparts:
On rare occasions a site may receive an UNKNOWN_EXCEPTION from CopyStorm. In CopyStorm’s log, the error will look like:
10-Feb-17 09:02:11: [UnexpectedErrorFault [ApiFault exceptionCode=’UNKNOWN_EXCEPTION’ exceptionMessage=’An unexpected error occurred. Please include this ErrorId if you contact support: 303701882-51722 (1187285824)’ extendedErrorDetails='{[0]}’
This error is generated by Salesforce’s server when it encounters a problem that Salesforce code does not know how to handle. Most of the time the issue will resolve itself after a couple days as Salesforce fixes their own internal problems. If the problem does not clear up automatically then this article may help you resolve the issue.
In Capstorm’s experience, to get Salesforce support to pay attention to UNKNOWN_EXCEPTION issues a problem has to be reproduced in an application supplied totally by Salesforce. When this error is being given by Salesforce we need to:
Isolate the SOQL query in CopyStorm that is causing the problem.
If CopyStorm is reporting an OPERATION_TOO_LARGE error, it will be included in the CopyStorm log. The error will look like this:
09:02:11: [UnexpectedErrorFault [ApiFault exceptionCode=’OPERATION_TOO_LARGE’ exceptionMessage=’exceeded 20000 distinct ids’ extendedErrorDetails='{[0]}’ ] ] Before diving into the root cause, this is the most common solution:
Grant the ViewAllData privilege to the Salesforce credentials being used with CopyStorm.
The root cause of this exception can be found in the Salesforce description of the error:
OPERATION_TOO_LARGE
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:
There are a number of XML configuration files that can be used to override default CopyStorm behavior. This article describes the approach CopyStorm uses to find configuration files.
When CopyStorm searches for a configuration file, it looks in four places:
Configuration files embedded within the CopyStorm application.
CopyStorm always looks here first.
The CopyStorm/Medic Log Manager tool supports the viewing, management, and exporting of the results of previously run CopyStorm jobs.
Starting with version 7.*.*, CopyStorm stores the status of each job into tables in the CopyStorm target database. The CopyStorm/Medic Log Manager is a convenient tool for viewing, managing, and exporting the contents of these tables. In addition to Log Manager, regular RDBMS tools can be used to access CopyStorm’s logs.
Full documentation for the CopyStorm/Medic Log Manager tool can be found .
The database tables used for RDBMS access to CopyStorm and CopyStorm/Medic logs can be found .
Though it is possible to delete a Snapshot Policy, usually a site will simply want to make the policy inactive. When a Snapshot Policy is deleted both the policy definition and all data snapshot by the policy are deleted from the CopyStorm database.
The Snapshot policy deletion tool is launched using right-click context menu on the CopyStorm Snapshot tab.
The CopyStorm/Medic Permission Checker will find Salesforce tables and fields that are visible using the Salesforce metadata API but are not visible for backup using the current Salesforce credentials.
It is a common misconception that a member of the Salesforce Administrator group can see all table and fields in a Salesforce instance. In practice, there are even many standard Salesforce fields that a Salesforce Administrator cannot view by default. The Permission Checker helps you find these tables and fields.
Running the Permission Checker involves clicking on a single button – Start Scanning Metadata.
The Salesforce user credentials provided to the Permissions Checker must have access to read the Salesforce metadata definitions for each object.
Use of the metadata API requires the system permission “Modify Metadata Through Metadata API Functions.”
The CopyStorm/Medic Global Parameters page sets parameters that apply to all CopyStorm/Medic jobs.
The Global Parameters page can be found by selecting the “Other Tools” dropdown in CopyStorm/Medic, and clicking “Global Parameters” in the dropdown list.
In certain configurations it may be necessary to run specific SQL statements or set database specific options each time a connection to a database is established.
The configuration file “Oracle.xml” contains parameters that control connections made to Oracle. The following configuration directives are supported:
InitSQL — specify a line of SQL that will be run each time a new connection to Oracle is established. There is no limit to the number of InitSQL elements.
The following Oracle.xml file will cause CopyStorm to run the command:
alter session set ‘_optimizer_rownum_pred_based_fkr’=FALSE
Blank
dd-MM-yy (19-5-84)
yyyyMMdd (19840519)




In the example a public server hosted by Google is used.
Enter the email address that will send the email.
Click on the “Generate Script” button.
Click on the “Save Script” button and save the script to a file.
Edit the generated script’s code to implement your custom notification requirements.



API Threshold
Do not run CopyStorm/Medic jobs if Salesforce API usage is above the provided percentage when the job is starting. For example, if you enter “50” in this input then CopyStorm/Medic will not run jobs if Salesforce API usage is above 50% of the maximum.







100
No
Limits the number of rows that will be written to the target database in a single batch. A smaller number minimizes memory requirements but increases run time. A larger value increases memory requirements and decreases run time.
DDL Timeout (seconds)
Blank
No
Set the number of seconds CopyStorm will wait for a DDL operation to complete. DDL operations, like CREATE INDEX, may take considerably longer than DML operations and thus have their own timeout parameter.
# Database Buffers
10
No
Sets the number of output buffers to use when running in multi-thread mode. A larger value increases memory requirements but allows Salesforce to read more records before they are written to the target database.
Rows Per Multi-Insert
Blank
No
If specified then multiple rows will be sent to the database in a single INSERT statement. Please note that not all databases support this feature and when the database is on a local network there is unlikely to be any performance gain by enabling this feature.
Enable CSV Bulk Import
Checked
No
If set and is supported by the database then CSV bulk imports will be used. For analytical databases like RedShift or Snowflake this option should almost always be selected.

Checked
No
If checked, CopyStorm will create database indexes for each reference field. Enabling index creation will significantly improve the table join speed in larger databases. Note that an index is always created on each table’s “timestamp” column.
Create Indexes Early
Checked
No
If checked then CopyStorm will create indexes on Salesforce reference fields when a table is initially created. If not checked then reference field indexes will be created after the first backup of a table. This option can avoid a long delay or timeout when indexes are originally created on tables with many rows.
Create IsDeleted Index
Checked
No
If checked then CopyStorm will create an index on the fields (IsDeleted, SystemModstamp).
Rebuild Timestamp Index
Unchecked
No
If checked, the index on the SystemModstamp column will be rebuild if enough new records are inserted. In some database configurations, this can increase performance dramatically.













# Snapshot Per Batch limits the number of records that will be written to a snapshot in a single database transaction.



Automatically copy newly created Salesforce Objects when they become visible to the CopyStorm Salesforce User.
Manual Selection – Advanced: Choose Objects to Include and Exclude
If the Include list is empty, all Salesforce Objects will be copied, except for objects selected in the Exclude list.
If the Include list is not empty, all selected objects will be copied.





Optimize Update SQL
Checked
If checked, CopyStorm will compare data from Salesforce with existing data in the CopyStorm database and build minimal SQL UPDATE statements. For wide tables with few changes this may be considerably faster than unoptimized UPDATE statements.
Optimize Timestamps
Checked
If checked, then use the time of the most recently complete CopyStorm job to reduce the number of records read from Salesforce. If not checked, then the timestamp of the newest record in Salesforce is used to build SOQL queries, and at least one record from each table will always be read.
Force Updates
Unchecked
If checked, CopyStorm will write all records read from Salesforce to the target database. Records will be updated even if the timestamp is the same as the Salesforce timestamp. This option can be used in conjunction with the “Modified Since” and “Modified Thru” parameters to force CopyStorm to re-read records from Salesforce and update any fields that are out of sync.
Optimize Deleted Record Scan
Checked
If checked then CopyStorm will use information from the previous backup to minimize the number of records scanned when searching for deleted records. This option is ignored if the Delete Older Than option is blank.
Update Using DELETE/INSERT
Unchecked
If checked then CopyStorm will UPDATE records by first deleting them and the re-inserting them. This option is ignored if the Optimize Update SQL option is checked.
Optimize Update Classification
Checked
If checked, CopyStorm will try to avoid database queries used for deciding if records are inserts or updates. If this parameter is unchecked, CopyStorm will always query the database to decide if a record should be inserted or if a pre-existing record should be updated in the database. For example, if a table is empty when CopyStorm starts to copy data, then there is no reason to look for updates - all records will always be inserts.
Optimize Snapshot Purge
Checked
When checked, Snapshot record cleanup will happen after all records are copied from Salesforce. When unchecked, Snapshot records will be cleaned up after each object is replicated.
Optimize Insert SQL
Unchecked

If checked, CopyStorm will not include NULL data in generated INSERT statements. For wide tables with many NULL values this may be considerably faster than unoptimized INSERT statements.
No
The number of times to try to automatically reconnect with Salesforce if the connection to Salesforce has dropped.
Reconnect Delay
15
No
The number of seconds to wait between attempts to reconnect to Salesforce.
Backup Rich Text Images
Checked
No
If checked then CopyStorm will replicate images embedded in Salesforce Rich Text fields and Knowledge Articles. Images are stored in the tables CopyForceRtImage and CopyForceImageData.
Backup URL Images
Checked
No
If checked then CopyStorm will replicate images linked to in URL Image fields. Images are stored in the tables CopyForceURLImage and CopyForceImageData.
Ignore Numeric Overflow
Checked
No
If checked, then if a numeric formula column contains a value which would cause a numeric overflow in the database then the database value will be set to null. The most common cause of this issue is an ill-defined Salesforce formula column with a near divide by zero error.
Max Base64 Reader Threads
Blank
No
Set the maximum number of base64 values that will be read concurrently when processing tables containing base64 columns using the REST API. This option can greatly increase the rate at which tables like Attachment and ContentVersion are backed up by downloading the raw file content for multiple records concurrently.
Continue On Missing Base64
Blank
No
If checked, then if a Base64 file body cannot be downloaded CopyStorm will report an error and continue replicating additional files. If unchecked, then CopyStorm will halt the replication for a Base64 object when the first unreadable Base64 entry is encountered.
# Reconnect Attempts

5
Run the query in the Salesforce console to prove that the query is causing the issue.
Submit a case to Salesforce.
Start CopyStorm from a command line window with the “-debug” command line switch.
CopyStorm.bat -debug
sh CopyStorm.sh -debug
On the Advanced tab, select “Debug Mode” under “Misc Options”.
You may have to select “Show All Options” to see the “Debug Mode” option.
Start a copy. The SOQL query causing the issue will appear in the command line window.
Copy the SOQL and save it to a file.
Login to the Salesforce GUI.
Choose “Developer Console” in the menu that appears when you click on your name.
Paste the SOQL query into the editor.
Press the execute button.
Copy the error text and save it.
The error should appear in the lower part of the screen.
Describe what you did in Step 3.
Include the problem SOQL and the error text from Step 3.
First level support can rarely solve this sort of issue and you should expect a request to grant access to your system so Salesforce engineers can reproduce the error.
Though we do not see this error often, it has appeared a few times when Salesforce index corruption of their Oracle database caused the issue. Truthfully we cannot know the precise root cause unless Salesforce exposes it — to any application it is only exposed as a type of error that Salesforce does not expect to occur.
CopyStorm always looks here.
Configuration files in the directory specified by the Configuration tab “Config Directory” option within the “External Configuration” section.
Configuration files in the directory specified by the “-config” command line argument.
CopyStorm looks here ONLY IF the Advanced tab setting is blank.
If a configuration file is found in multiple locations, all are loaded in the order listed above. Later loaded files will override any configuration from earlier files.
Documentation on available XML configuration files can be found on this page.
Capstorm recommends the following best practices:
Keep each CopyStorm configuration file in its own directory OUTSIDE of the CopyStorm installation directory.
This will make the CopyStorm upgrade process simpler.
If you need custom XML configuration files then:
Store them in the same directory as the corresponding .copyStorm configuration file.
Set the Configuration tab “Config Directory” parameter in your .copyStorm file to point to the directory where the .copyStorm file is located.
Since MySQL reports UTF-8 problems using a hex byte sequence, you will need a way to convert hex byte sequences to a character suitable for XML. Capstorm has used the tool located at:
To use the tool enter the hex digits from MySQL into the box labeled “UTF-8 Code” (e.g. 20 E2 88 9A) and press the Convert button. Copy the generated unicode character into the “from” parameter in UTF8Tool.xml. Note that you can use the regular UTF-8 character in the “from” parameter rather than the decimal or hex representation.
The query has returned too many results. If certain queries are run by a user without the “View All Data” permission and many records are returned, the queries require sharing rule checking. For example, consider queries that are run on objects, such as Task, that use a polymorphic foreign key. These queries return this exception because the operation requires too many resources. To correct, add filters to the query to narrow the scope, or use filters such as date ranges to break the query up into a series of smaller queries.
You can find the Salesforce documentation in the Core Data Types section.
Almost all CopyStorm sites will want to use Salesforce credentials with the ViewAllData permission because without this permission all data will not be backed up. In particular, no metadata will be backed up because the API call used to fetch metadata requires the ViewAllData permission.
If your organization does not want to give your CopyStorm backup user the ViewAllData permission and an incomplete backup is OK, you can configure CopyStorm to backup data using a sliding timebox.
For example, to backup the Note table using a 60 day sliding timebox, the following TableRule must be added to your site’s TableRuleRegistry.xml file:
This XML rule means:
Use a sliding 60 day window when backing up Note.
Start the first search on 1-Jan-2001.
Start subsequent searches at the timestamp on the most recent Note record in the backup.
The system will backup Note records in roughly the following order:
1-Jan-2001 thru 28-Feb-2001 1-Mar-2001 thru 30-Apr-2001 1-May-2001 thru 30-Jun-2001 etc… until the current date is reached.
Oracle.xml:
<Oracle>
<InitSQL sql="alter session set "_optimizer_rownum_pred_based_fkr"=FALSE" />
</Oracle><UTF8Tool>
<Map from="😊" to=":)" /> <!-- Smiley face -->
<Map from="😒" to=":(" /> <!-- Frowning face -->
</UTF8Tool><TableRule name="Note" timestamp="LastModifiedDate" timebox="60" timeboxEpoch="2001-01-01" />No
Controls the number of records that will be retrieved with each Bulk API call. A larger value will cause each Bulk API call to take longer but minimize the number of Bulk API calls. If this parameter is not specified it defaults to the SOAP Limit for the current table.
Bulk Polling Rule
No
Sets the polling rate CopyStorm uses to check if a Bulk API operation has completed. The format of this parameter is a comma separated list of numbers where each number indicates how many seconds to wait between each poll of Salesforce.
For example, the rule 1,3,5,10,10,10,30 means:
Poll Salesforce after 1 second the 1st time.
Poll Salesforce again 3 seconds after the 1st check.
Poll Salesforce again 5 seconds after the 2nd check.
Max Bulk API Calls
No
The maximum number of Bulk API calls that will be used in a single CopyStorm session.
Bulk Threshold
Yes
CopyStorm will only use the Bulk API if the number of records read for a table exceeds the “Bulk Threshold” parameter. If this parameter is left blank then CopyStorm will not use the Bulk API. Examples:
If set to 0 then CopyStorm will always use the Bulk API (when possible — not all tables are supported by the Bulk API).
If set to 50000 then CopyStorm will switch to the Bulk API after 50,000 records have been processed for a table.
To reserve Bulk API calls for tables where it may help, Capstorm recommends setting this parameter to 50,000 or above.

Bulk Limit
No
If checked and CopyStorm is running with a GUI, an extra SELECT query will be issued for each table to determine the total number of records to be copied.
SFDC Commit Latency
Blank
No
The number of seconds a Salesforce records has to be unchanged until it can be trusted that records have been written to Salesforce in timestamp order. This is a workaround for Salesforce’s belief in time travel — a record with a timestamp of 12 noon can be written to Salesforce before one with a timestamp of 11:59 am.
Timestamp Latency
900
No
The number of seconds to re-query based on the maximum timestamp from the previous CopyStorm job. This parameter is used to capture record changes that may occur out-of-order based on Salesforce record save behavior – i.e. changes that happen after SystemModstamp values are assigned, but before the record is committed. For more details on Salesforce’s record save behavior see .
Row LIMIT per Query
Blank
No
The default number of records to read from Salesforce with a single SOQL statement. A larger number may reduce the number of Salesforce API calls slightly but also may result in query time outs that CopyStorm must recover from using additional API calls. The default value is 20000.
Always Validate SOQL
Unchecked
No
If checked then CopyStorm will validate every generated SOQL statement to insure that a QUERY_TOO_COMPLEX error is not generated. Since CopyStorm dynamically recognizes QUERY_TOO_COMPLEX errors and rewrites queries to avoid them there is little need for this parameter to be set unless the user is a CAPSTORM developer.
Find Optimal SOQL
Unchecked
No
If check then CopyStorm will take extra effort to generate to optimal load balanced SOQL statements when multiple SOQL statement are needed to read a single row from a table. This parameter is for CAPSTORM developers.
Max Simple Query
Blank
No
The smallest SOQL query that CopyStorm will assume never will generate a QUERY_TOO_COMPLEX error. This parameter is for CAPSTORM developers.
Enable SOQL Query Lookahead
Checked
No
When checked, CopyStorm will read the next batch of record for a table while processing the current batch. This improves the overall performance of CopyStorm with a slightly larger load on the local computer.
Validate SOQL End of Data
Checked
No
If checked then CopyStorm will verify that the backup of a table is complete by running a single validation query. This is necessary in cases where SOQL returns no records from a query when there are records available.
Estimate Total Time

Unchecked
Parameter
Description
Instance Type
Type of Salesforce instance being copied.
Production
Sandbox
Database.com
Username
A Salesforce user. This user must have API privileges. All data visible to this user will be copied to the CapStorm database.
Password
The password for the Salesforce user.
Credential Type
Technique used to find the Salesforce password. The default, Username and Password, stores encrypted credentials in a project’s .copyStorm configuration file. To login to Salesforce using the JWT Oauth flow, change this to “Oauth 2.0 JWT” and see the . To login using an SFDX registered instance, change this to “SFDX Username or Alias” and see the .
Salesforce Batch Size
Default number of records to read from Salesforce in a single batch. The default, 2000, is the maximum supported by Salesforce and should not be changed unless the host machine has severe memory limitations. Decreasing this value will increase the number of API calls to Salesforce.
Max Timeout
Parameter
Description
Connection String
JDBC connection string required to create a CopyStorm database.
Connection String Builder
Clicking on this button launches a dialog that helps create a valid connection string.
Username

Whitelist — A Whitelist controls which tables (and optionally fields) participate in field history. An unlimited # of white lists can be defined.
Blacklist — A Blacklist controls which tables DO NOT participate in field history
Retention Days — Retention Days controls how many days CopyStorm should keep field history. This can be control on a per table basis and can range from 1 day to forever.
To setup Field History rules there are several decisions to make:
Do I want to control what tables are backed up using a Whitelist or Blacklist approach?
By default, how many days should field history records age before they are automatically deleted by CopyStorm?
Are there any tables whose field history records I want to keep longer (or shorter) than the default?
The Field History Editor has several major components:
Global Parameters specify constraints applied to all rules.
The Whitelist/Blacklist editor indicates which tables should (or should not) participate in field history tracking.
There are several global field history parameters.
Include Formula Columns parameter controls where changes to formula fields are recorded as field history changes. The default is false.
The Exclude Audit Fields parameter restricts common Salesforce auditing fields from being records in field history. There are several reasons to exclude an audit field.
A field is a timestamp field that changes on every record change.
A field is Salesforce maintained formula field (example: LastViewedDate)
A field is also recorded as separate column in CopyStorm’s field history table.
To change the list of excluded audit fields click on the Edit… link the left of the field label.
The Whitelist/Blacklist part of the editor is used to manage what tables participate in field history tracking.
The Whitelist indicates what tables should participate in field history tracking. If the whitelist is empty this means that all tables except those in the blacklists will be tracked.
The Blacklist indicates what tables should not participate in field history tracking.
Of course, in practice either the whitelist or blacklist is used but not both. When the white list is not empty the blacklist is effectively ignored.
Before configuration the editor looks like:
Select specific tables and/or table patterns to add to the white list by clicking on the appropriate button.
If the default field retention rule is too short (or long) for specific tables, an extra white can be added to change the retention rule. The example below changes the retention rule for Account and Contact to 1000 days.
It is possible to limit the fields tracked for a specific table by edit the table’s rule. Of course, doing this means that any new fields added to a table will not be tracked by default.
The following image illustrates how to limit the fields tracked for the Account table.

The SOQL Query Tool provides a convenient, in-app interface for running SOQL queries against the target Salesforce org specified on the left side of the “Main” tab of CopyStorm. To use this tool, CopyStorm must connect to Salesforce, so the Salesforce credentials specified must be valid (use the “Test Salesforce Connection” button to validate).
To use the tool, simply enter a valid SOQL query into the white text-area and click the “Execute SOQL” button. You can choose to either include or exclude Deleted and Archived records in the results with the “Include Deleted And Archived Records” checkbox. The results of the query will be displayed below.
The SQL Query Tool provides a convenient, in-app interface for running SQL queries against the target database specified on the right side of the “Main” tab of CopyStorm. To use this tool, CopyStorm must connect to the database, so the database credentials specified must be valid (use the “Test Database Connection” button to validate).
To use the tool, simply enter a valid SQL query into the white text-area and click the “Execute SQL” button. The results of the query will be displayed below.
The Skipped Record Log Explorer provides a convenient interface for exploring and analyzing the reports recorded by CopyStorm when a record has been skipped during a job due to an error caused by the Salesforce platform. Errors that are reported by this feature include:
Base64ReadErrors (potential file body corruption)
DescribeSObjectErrors (potential metadata corruption).
The top window of the interface contains a filterable search window for each skipped record, and the bottom window provides all details recorded by CopyStorm when the record was skipped:


To access the Refresh Formulas GUI:
Select “Other Tools” from the top-level menu.
Select “Data Synchronization”, then “Refresh Formulas”.
The Refresh Formulas tool contains three parts:
The side of the dialog is used to select the tables to scan. Note that if a table without formulas is selected it will be silently ignored by the tool.
The top part of the dialog is used to specify 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.
The Refresh Formulas tool can be run as a batch job using the following syntax:
Windows
CopyStormMedic.bat -tool refreshFormulas -run configFile.copyStormMedic
Linux
sh CopyStormMedic.sh -tool refreshFormulas -run configFile.copyStormMedic
Under normal circumstances, when a user deletes a record in Salesforce the record is not really deleted immediately. Instead, it is placed in the Salesforce recycle bin. The mechanism used by Salesforce is a hidden field named “isDeleted”. When CopyStorm runs it copies all modified records — including those where the “isDeleted” flag is set to true. After records are copied by CopyStorm, they are optionally deleted in the CopyStorm database based on parameters set on the Advanced tab.
If normal Salesforce accounts are not permitted to empty their recycle bin (a good practice) then the condition that needs this tool will likely not occur.
The UI for the Fix IsDeleted tool contains three parts:
The side of the dialog is used to select the tables to scan.
The top part of the dialog has parameters that determine if problem records should be fixed.
The lower part of the dialog displays the progress of a scan as it happens.
The Fix IsDeleted tool can be run as a batch job using the following syntax:
Windows
CopyStormMedic.bat -tool fixDeleted -run configFile.copyStormMedic
Linux
sh CopyStormMedic.sh -tool fixDeleted -run configFile.copyStormMedic
By checking the “Show Problems” checkbox, the application will store a list of all record IDs that are identified as being nonexistent (deleted) in Salesforce. To view the record IDs, run the tool, and after it is completed click the “Show Records” button. This will open up a modal window displaying the Table name, and Salesforce Record ID of all the records that were identified by the tool.
The “Show Problems” setting can be used to validate the data prior to anything being deleted. To use it in this way, ensure that “Show Problems” is enabled, and “Fix Problems” is disabled. With this configuration, the tool will search for and identify problem records, and generate a list of IDs that can then be used to query the backup database to validate data prior to deletion, or for use in identifying mistakenly deleted records in Salesforce.
In the Record viewer window, the resulting list of TableName:RecordID pairs can be exported as a .csv as well, using the “Export” button at the bottom of the modal window.
See below for an example of the record viewer window.
When running the tool via command line, and using a config file which has the “Show Problems” flag enabled, the command line output of the application will include a list of all identified problem records. An example of this is shown below.
To access the Refresh Columns GUI:
Select “Other Tools” from the top-level menu.
Select “Data Synchronization”, then “Refresh Columns”.
The UI for the Refresh Columns tool contains three parts:
The side of the dialog is used to select the tables and columns to scan.
Click on a table name to launch a pop-up dialog for column name selection.
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.
Clicking on a column name will cause a column selection dialog to appear:
When a formula column definition changes in Salesforce, timestamps on Salesforce records do not change. In practice this means that a formula column in the CopyStorm database will not reflect the proper value after a formula definition change until the next time a non-formula field on the record changes.
Starting with CopyStorm 7.34.10, both formula column definition changes and the last formula column refresh time are tracked. The “Manage Stale Formulas Automatically” option takes advantage of this tracking and, when checked, will:
Automatically identify all formula columns whose definition has changed since their last refresh in CopyStorm, and add them to the column refresh set.
Once the formula columns are refreshed, CopyStorm will update the formula refresh time in its tracking tables.
The Refresh Columns tool can be run as a batch job using the following syntax:
Windows
CopyStormMedic.bat -tool refreshColumns -run configFile.copyStormMedic
Linux
sh CopyStormMedic.sh -tool refreshColumns -run configFile.copyStormMedic
Select “Other Tools” from the top-level menu.
Select “Salesforce Data Quality”, then “Base64 Sanity Checker”.
The only required parameters are the tables to search, but there are a number of other parameters you may want to modify.
Modified After
Search for records starting at this date. A date can be selected from the menu or typed in directly. Values are restricted to datetime formats supported by SOQL.
Modified Before
Search for records up to this date. A date can be selected from the menu or typed in directly. Values are restricted to datetime formats supported by SOQL.
Salesforce Batch Size
The next step is to click on the Start Sanity Check button and wait for the analysis to complete. Note:
Each hyperlink check takes one Salesforce API call. There is one additional API call for every 2000 records.
An running analysis can be cancelled but the cancellation process may not be immediate. The reason is that pending HTTP requests must complete or timeout before the cancellation process is finished.
Hopefully when you scan your Salesforce the tool will not find potential problems. However, if potential problems are found then it is wise to check the validity of each record using the Salesforce GUI.
If you are using CopyStorm to perform backups, then this class of error will be discovered during the normal course of a backup. Unfortunately the error is often masked by an UNKNOWN_EXCEPTION or an Invalid SOAP Envelope response from Salesforce.
Without the Table Editor tool a DBA can always manually truncate or drop a table — this tool is designed to provide a way for a non-DBA to perform the same task.
To access the Table Editor GUI:
Select “Other Tools” from the top-level menu.
Select “Rarely Used”, then “Table Editor”.
The UI for the Table Editor tool contains three parts:
The side of the dialog is used to select the tables to truncate, delete, or forget..
The top part of the dialog determines if the selected tables will be deleted, truncated, or forgotten.
The lower part of the dialog displays the progress of table modifications.
The Table Editor tool cannot be run as a batch job.
Select “Other Tools” from the top-level menu.
Select “Data Synchronization”, then “Fix DocLinks”.
The UI for the Fix DocLinks tool is minimal.
The top of the dialog controls how many concurrent queries to run against Salesforce and what data ranges to scan.
The middle part of the dialog has a large button for starting the search and text for reporting progress
The tool will report progress as it scans records and when finished will look like:
where:
Candidates = total # of ContentDocumentLink records scanned
Inserted = number of ContentDocumentLink records inserted into the CopyStorm database.
Update = number of ContentDocumentLink records updated in the CopyStorm database.
The Fix DocLinks tool can be run as a batch job using the following syntax:
Windows
CopyStormMedic.bat -tool fixDocLinks -run configFile.copyStormMedic
Linux or Mac
sh CopyStormMedic.sh -tool fixDocLinks -run configFile.copyStormMedic
Timeouts or I/O bottlenecks
These interruptions can leave partitions in an incomplete or inconsistent state.
The Partition Creation process is designed to be incremental:
Records are copied from Source to Target Partition in an ID-based ordering (lexicographical).
After each batch of records is copied from Source to Target, the last read Salesforce ID is persisted in the Database.
See the CopyForceTablePartitionLoadTask database table.
Note: CopyStorm will refuse to replicate data to a table if it has a Partition Creation In-Progress
If partition creation fails, you can resume the process by navigating back to the Partition Editor Tool. You’ll see the following dialog appear if a partition creation is in-progress:
From this point, you’ll have the option to:
Resume the Partition Creation process
This will start copying data from Source to Target from the Last Read Salesforce ID.
Cancel the Partition Creation process
Note: Cancelling will not remove data already copied if the Source is S3 or a Folder
Cancelling a JDBC Partition Creation will delete the new JDBC Partition.
Source data will never be deleted during the cancellation process.
Select “Other Tools” from the top-level menu.
Select “Salesforce Data Quality”, then “Find Dirt”.
The UI for the Find Dirt tool contains four parts:
The side of 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 scanned.
Leave these 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 “Show Problems” button will appear in the lower right hand corner.
Click the button to see error details and/or export the errors to a file.
If the “Show Problems” button appears, click it to show the details for each problem record.
The Find Dirt tool can be run as a batch job using the following syntax:
Windows
CopyStormMedic.bat -tool findDirt -run configFile.copyStormMedic
Linux
sh CopyStormMedic.sh -tool findDirt -run configFile.copyStormMedic
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.
To access the Scan Timestamps GUI:
Select “Other Tools” from the top-level menu.
Select “Database Validation”, then “Scan Timestamps”.
The UI for the Scan Timestamps tool contains four parts:
The side of 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:
The Scan Timestamps tool can be run as a batch job using the following syntax:
Windows
CopyStormMedic.bat -tool scanTimestamps -run configFile.copyStormMedic
Linux
sh CopyStormMedic.sh -tool scanTimestamps -run configFile.copyStormMedic
Do not be alarmed when you find a lot of fields that are not visible to a Salesforce Administrator. Most likely you are not using them in your instance.
The Permission Checker tool can be run as a batch job using the following syntax:
Windows
CopyStormMedic.bat -tool findPermissionErrors -run configFile.copyStormMedic
Linux
sh CopyStormMedic.sh -tool findPermissionErrors -run configFile.copyStormMedic
This page provides details into the command line options for running snapshot policies for CopyStorm in headless mode. This feature was introduced as part of the 10.65.1 GA release of CopyStorm. For more information regarding running snapshot policies, see here.
The command line functionality mirrors the same options and functionality as seen in the CopyStorm application using the "Run Snapshot Rules Now" option including:
Start and end date ranges for records to snapshot
Number of concurrent searches (number of objects snapshot in parallel)
Search batch size
Snapshot per batch
This example is for Windows installations of CopyStorm. For Linux/Mac installations, change CopyStorm.bat to CopyStorm.sh
CopyStorm supports the tracking of nearly all field changes by checking the “Track Field History” box on the Advanced tab. When field history is enabled, default behavior is to track updates to EVERY field in EVERY table except for a handful of Salesforce auditing fields.
If the default behavior captures more data than your organization prefers, this article explains how to limit what is tracked.
Fine control over field tracking is managed by a configuration file named FieldHistoryRecordFactory.xml. The file can be placed in either the “config” subdirectory of the CopyStorm installation or in the directory indicated in the CopyStorm configuration file. The built-in configuration file has rules excluding field tracking for a number of Salesforce audit fields and all formula columns.
It looks like:
<FieldHistoryRecordFactory>
<IncludeFormulas status="false" />
<ExcludeField field="SystemModStamp" />
<ExcludeField field="LastModifiedDate" />
<ExcludeField field="LastModifiedById" />
<ExcludeField field="CreatedDate" />
<ExcludeField field="CreatedById" />
<ExcludeField field="LoginTime" />
<ExcludeField field="LastViewedDate" />
<ExcludeField field="LastReferencedDate" />
</FieldHistoryRecordFactory>If you create your own configuration file, model it after the built-in file without repeating any of the built-in rules.
Like CopyStorm table selection, there are two basic approaches to controlling which fields are tracked:
Telling CopyStorm which fields should be tracked.
Telling CopyStorm which fields should NOT be tracked.
If CopyStorm is told which fields to track the rules indicating which fields should NOT be tracked are ignored and only fields CopyStorm is explicitly told to track will be included.
To only track field history on specific tables, include the IncludeTable configuration directive.
The following FieldHistoryRecordFactory.xml will limit field history to the Account, Contact, and MyCustomObject__c tables:
To track fields in all tables EXCEPT for a few then use the ExcludeTable configuration directive.
The following FieldHistoryRecordFactory.xml will exclude ApexPages, ApexTriggers, and MyCustomObject__c from field history tracking:
The following FieldHistoryRecordFactory.xml will cause CopyStorm to only track the “Name” field on “Account” and the “FirstName”/”LastName” fields on “Contact”:
The following FieldHistoryRecordFactory.xml will cause CopyStorm to not track the “WebSite” field on “Account”, and to not track the “Age”/”Birthday” fields on “Contact”:
Default CopyStorm behavior is to not track changes to formula column values. The following FieldHistoryRecordFactory.xml will enable formula value history tracking:
The CopyStorm/Medic Count Records tool performs a comparison of object record counts in Salesforce versus CopyStorm. This tool is provided as a sanity check for backup validation, to provide assurance that CopyStorm is copying all records properly.
To access the Count Records GUI:
Select “Other Tools” from the top-level menu.
Select “Database Validation”, then “Count Records”
The UI for the Count Records tool contains four parts:
The left-hand side of the dialog is used to select the tables to scan.
The top part of the dialog has the following parameters:
of Tables to Process Concurrently.
Specifies how many tables the tool will process in parallel. Higher values may improve performance but increase resource usage.
Output To CSV (checkbox).
The lower part of the dialog displays the progress of a record count analysis 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.
Windows
CopyStormMedic.bat -tool countRecords -run configFile.copyStormMedic
Linux / Mac OS
When replicating Salesforce data and schema to the CopyStorm database, CopyStorm will create database tables and columns which mirror the object and field structure in Salesforce. For example, there is a Salesforce object called “Account”, with a String field called “Name”. This means that the CopyStorm database will have a table called “Account” with a VARCHAR or CLOB field called “Name”.
CopyStorm partitions use a technique called Vertical Partitioning to change the CopyStorm database schema by separating the database table for an object into multiple tables. Of course – CopyStorm, CopyStorm/Restore, and CopyStorm/Medic are fully compatible with CopyStorm partitions.
For example, by default, the CopyStorm database may have an “Account” table with these columns:
Id
SystemModstamp
Name
BillingStreet
BillingCity
BillingState
If the “Billing” fields are moved to a new partition, the database will have multiple tables:
The “Account” table, with these columns:
Id
SystemModstamp
Name
Virtually any field can be moved to a partition if needed – with the exception of a small number of fields that require special handling.
The “Id” database column is always present on every partition.
A handful of fields are required to remain on the primary partition:
IsDeleted
Salesforce Modification Timestamps:
Partitions may be created for virtually any object – the only exceptions are:
BigObjects
Tables that are included in the .
Note: This feature is available in Capstorm application versions 10.56.6 and above.
Capstorm applications allows you to add supplementary Java options. These options serve to dynamically alter the operational parameters of the application prior to its initiation. One frequent utilization, which serves as an example throughout this article, is the facilitation of user-driven control over memory allocation for any of Capstorm’s applications. This capability gives users the control to finely calibrate the memory resources dedicated to the operation of Capstorm’s applications.
Note: Application must be restarted for these configuration files to be applied.
First create a XML file named “AppLoader.xml”
Two recommended placement options:
Option 1: If you followed CopyStorm’s Best Practice Directory Structure then we recommend placing this configuration file in CapstormConfig directory.
Option 2: Inside of one of Capstorm’s application installation directory there should be a directory called “config”. You can also place this configuration file in the “config” directory.
Note: For versions older than 10.56.6 please visit: on how to configure memory settings.
Once you have completed “Configuration File Creation and Placement” steps you can simply copy the snippet below into the AppLoader.xml configuration file.
The example below shows how to set the min and max memory allocations to 300 and 1000 megabytes, respectively.
The AppLoader also allows for custom Java Properties. Below is an example of setting the HTTPS Protocols to TLSv1.1 and TLSv1.2.
The Logging Configuration Editor is used to configure CopyStorm logs that are written to the database, STDOUT / STDERR, or using the Apache Commons Logging framework.
The Database Schema Configuration Editor contains parameters used to configure CopyStorm database schema generation.
CopyStorm Snapshots support an unlimited number of Snapshot Policies with each Policy defined by the Snapshot Policy Editor. The following image lays out the primary sections of the Snapshot Policy Editor.
There are several tabs on the Snapshot Policy Editor.
The Main tab contains properties common to all snapshots and is where the Filter Rule Type for the snapshot is indicated.
The Filter Rule Parameters tab contains filter specific data. For example:
The Notifications Tab contains parameters used to control who receives a status email when a CopyStorm job runs and under what circumstances email is sent. CopyStorm supports email notifications via SMTP or via a Salesforce SOAP API call.
When CopyStorm writes data to an S3 partition, each Salesforce record is stored as one or more files in your S3 bucket. The location of every file is derived entirely from the Salesforce record ID. There are no date folders, job ID folders, or table name folders.
The folder hierarchy is constructed by slicing the first 13 characters of the Salesforce record ID into five segments:
As of CopyStorm/Medic 10.54.2, the Base64 Sanity Checker function has been merged into CopyStorm/Medic.
For the latest documentation, please see:
When the Salesforce REST API returns a record with a BASE64 column, the BASE64 data is returned as a hyperlink that can be used to read the raw bytes. Experience has shown that it is possible for the hyperlink returned by Salesforce to return a HTTP 404 (not found) or an HTTP 500 (internal lightning platform error) rather than the expected HTTP 200 (OK). When this happens:
The CopyStorm/Medic Lineage Maintenance Tool is used to view lineage data & invalidate problematic lineage records.
Over time, a Record’s lineage may be invalidated:
One of the legacy lineage entries may no longer exist in the CopyStorm Database or Snapshot.
Records may have multiple children, causing split lineage.
For more details on Record Lineage, .
The CapStorm Permission Set Creator tool allows you to configure a permission set that has read access (and optionally write access), create or update the Permission Set in Salesforce, and automatically assign it to the CopyStorm Salesforce user.
The Salesforce user credentials supplied to CopyStorm must have the following permissions in order to use the Permissions Set Creator:
Modify All Data
Modify Metadata Through Metadata API Functions
Poll Salesforce again 10 seconds after the 3rd through 5th check.
Poll Salesforce every 30 seconds after the 5th check.
An “Account__part1” table, with these columns:
Id
BillingStreet
BillingCity
BillingState
SystemModstamp
LastModifiedDate
Salesforce Audit Timestamps:
CreatedDate
LoginTime
SentDate
Fields that are encrypted with the CS:Govern application.
If checked, headless runs of Count Records will output tool results to STDOUT and Database Logs in CSV-compliant format.
sh CopyStormMedic.sh -tool countRecords -run configFile.copyStormMedic
Security Token
Optional security token supplied by Salesforce.
Alternate Host
If your connection to Salesforce does not use one of the standard endpoint (login.salesforce.com or test.salesforce.com) then you must specify your endpoint as an alternate host. Example:
capstorm.my.salesforce.com
Advanced Parameters
Launch this dialog to set:
Proxy information
Password storage model
Secondary Salesforce connection parameters
Number of seconds to wait for a response from Salesforce.
Describe Batch Size
Number of table descriptors to read from Salesforce in a single batch.
Apache/HttpClient
If checked then the Apache/HttpClient will be used to communicate with Salesforce instead of the technique built into the WSC library. It is unusual to need the Apache/HttpClient.
Proxy Host
Optional name or IP address of a proxy host
Proxy Port
Optional port on which a proxy host is listening.
Proxy User
Optional user name when a proxy requires it.
Proxy Password
Optional password when a proxy requires it.
CopyStorm database username.
Password
CopyStorm database password.
Schema
Default schema to use. Note that this parameter is not supported by all databases.







Number of records to process from Salesforce in a single batch. The default usually provides optimal performance.
# Checker Threads
Number of base 64 hyperlinks to analyze concurrently.
Max Timeout (sec)
Number seconds to allow for each hyperlink test. If a hyperlink HTTP request times out it is assumed to be OK based on Capstorm’s experience with problem records. Setting this to a smaller value may improve the overall throughput of the analysis.
Report Timeouts
If this option is checked then all HTTP timeouts will be reported as potential problems. Enabling this feature may be useful in selecting an optimal Max Timeout value for your organization.















No
CopyStorm uses a relaxed definition for all Salesforce numeric columns. This is because it is possible for Salesforce to store values that do not match the declared field definition. An example is the computed column Opportunity.Amount, which can be forced to exceed the field size declared by Salesforce.
By default, CopyStorm uses:
NUMERIC for Oracle and PostgreSQL databases.
DECIMAL for SQL/Server, MySQL, and H2 databases.
Extra Precision
2
No
Increases the numeric precision stored by the database by this number of digits, both before and after the decimal point. The default value is almost always a good choice and works around the handful of instances where Salesforce “lies” about the precision of a column.
AnyType Length
Blank
No
Allocate this many characters for Salesforce columns using the AnyType data type. Use of an AnyType column is rare and only seen in Salesforce system level tables. The default length is 255.
Use Database Views
Checked
No
If checked, CopyStorm will create database views for Salesforce objects that can be represented as such. For example, all Feed objects can be represented as views on FeedItem.
Obfuscate Schema
Varies
No
If checked then CopyStorm will obfuscate database table and column names.
Use NVARCHAR2
Unchecked
No
If checked and using Oracle, use NVARCHAR2 for String data. If unchecked, assume that the encoding used by Oracle is capable of representing all UTF8 characters. This option is only used when copying to Oracle databases.
Table Prefix
Blank
No
If set, all Salesforce backup tables created by CopyStorm will be prefixed with this value.
For example, if “Table Prefix” is set to “SF_” then the Account table will be created as “SF_Account” rather than “Account”. Note that this parameter has no effect on tables that have already been created by CopyStorm.
Continue on DML Errors
Checked
No
If checked, CopyStorm will continue processing if a DML error is encountered. A DML error typically occurs when the structure of a Salesforce table has changed in a way that causes an “ALTER TABLE COLUMN” command to fail in the target database. The simplest fix is to drop the table in the target database and let CopyStorm rebuild it.
If checked, CopyStorm will log an exception, skip the problem table, and continue with the next table.
Include Formulas
Checked
No
If checked, CopyStorm will create columns corresponding to formula fields in Salesforce and will copy down the formula data into the columns. If unchecked, CopyStorm will ignore formula fields.
Include Base64
Checked
No
This option controls how CopyStorm will handle Base64 fields (file data). Possible values are:
Default – CopyStorm will only copy file data if the database supports long CLOB columns.
Yes – CopyStorm will always try to copy file data, whether or not the database supports it.
No – CopyStorm will never try to copy file data even if the database supports it.
Chunk Base64 Values
Unchecked
No
If checked, CopyStorm will store all Base64 values as chunks. These chunks will be specified in the “CopyForceTableFieldChunk” table in the CopyStorm database.
Synchronize Schema
Checked
No
If checked, CopyStorm will create and alter database columns to match Salesforce definitions/metadata. If unchecked, CopyStorm will not attempt to alter database schema definitions when Salesforce object/field definitions change.
Auto Upgrade Schema
Checked
No
Upgrade the database schema to match the schema for this version of CopyStorm.
If checked:
The CopyStorm Database will be updated without explicit user approval.
If unchecked:
The user will be prompted with planned CopyStorm database additions, deletions, or changes. The database upgrade will not occur until the user approves the action.
When running in headless mode, CopyStorm will terminate with an Exception indicating the need for database schema upgrade approval.
Use Strict DECIMALs

Unchecked
The number of objects to snapshot in parallel
No
10
snapshotSearchBatchSize
The read batch size from the database for candidate records
No
1000
snapshotWriteBatchSize
The write batch size to the database for found candidate records
No
1000
snapshotScanRecordsFrom
The date to start scanning records from (i.e. 2020-01-01)
No
Empty
snapshotScanRecordsThru
The date to end scanning records from (i.e. 2025-01-01)
No
Empty
snapshot
The name of the snapshot to run
Yes
N/A
snapshotThreads
./CopyStorm.bat -snapshot "Default Point In Time" "/path/to/config.copyStorm" -snapshotThreads 5 -snapshotSearchBatchSize 5000 -snapshotWriteBatchSize 5000 -snapshotScanRecordsFrom "2020-01-01" -snapshotScanRecordsThru "2025-01-01"<FieldHistoryRecordFactory>
<IncludeTable table="Account" />
<IncludeTable table="Contact" />
<IncludeTable table="MyCustomObject__c" />
</FieldHistoryRecordFactory><FieldHistoryRecordFactory>
<ExcludeTable table="ApexPages" />
<ExcludeTable table="ApexTriggers" />
<ExcludeTable table="MyCustomObject__c" />
</FieldHistoryRecordFactory><FieldHistoryRecordFactory>
<IncludeField table="Account" field="Name" />
<IncludeField table="Contact" field="FirstName" />
<IncludeField table="Contact" field="LastName" />
</FieldHistoryRecordFactory><FieldHistoryRecordFactory>
<ExcludeField table="Account" field="WebSite" />
<ExcludeField table="Contact" field="Age" />
<ExcludeField table="Contact" field="Birthday" />
</FieldHistoryRecordFactory><FieldHistoryRecordFactory>
<IncludeFormulas status="true" />
</FieldHistoryRecordFactory><AppLoader>
<JavaArgument arg="-Xms300m" />
<JavaArgument arg="-Xmx1000m" />
</AppLoader><AppLoader>
<SystemProperty name="https.protocols" value="TLSv1.1,TLSv1.2" />
</AppLoader>No
If checked, timestamps recorded in CopyStorm’s job tracking log tables will be in UTC rather than local time.
Log Tables with No Activity
Unchecked
No
If checked, CopyStorm will log tables with no activity (no records copied, skipped, deleted, or archived) during a job.
Log Format
Full
No
This option controls the amount of detail sent to the CopyStorm log file. Options include:
Compact: Display a single line of text for each table that has copy activity.
Summary: Display a single line for each table processed (even if no records were copied).
Full: Display a verbose amount of logging information.
Log Table Sizes
Checked
No
If checked, log the starting and ending table sizes in bytes.
Use Apache Logging
Unchecked
No
If checked, logging will be performed with the Apache Commons Logging framework. By default, Log4j will be used.
Debug Mode
Unchecked
No
If checked, CopyStorm will output logging messages to the debug console (normally hidden).
Silent Mode
Unchecked
No
If checked, when running in batch mode, CopyStorm will only display errors to stderr and will not display debug or informational messages.
SFDC Logging
Off
No
This option enables CopyStorm-to-Salesforce job logging. Options include:
On: Write job logging information to Salesforce (If Salesforce logging is not supported, logging information will not be pushed and the job will proceed normally).
Off: Do not write job logging information to Salesforce.
Required: Write job logging information to Salesforce (if Salesforce logging is not supported, the job will abort).
CopyStorm contains backend support only for Salesforce Logging. To enable Salesforce support for this feature, contact your Capstorm account representative.
SFDC Logging Interval
2
No
This option sets the time interval (in minutes) between pushes of job logging information to Salesforce.
CopyStorm contains backend support only for Salesforce Logging. To enable Salesforce support for this feature, contact your Capstorm account representative.
SFDC Log Count
4
No
This option configures how many job logs for the CopyStorm configuration file are kept in Salesforce. When CopyStorm creates a new job log, older job log records are deleted, retaining records according to this option. For example:
With a value of 0, only the most recent job will be retained.
With a value of 5, only the most recent job log and the 5 previous job logs will be retained.
If this field is left blank/empty, all job logs will be retained.
CopyStorm contains backend support only for Salesforce Logging. To enable Salesforce support for this feature, contact your Capstorm account representative.
SFDC Log Retention
4
No
This option determines how long job logs for all configuration file are kept in Salesforce before older log records are deleted. Job logs that are older than this many days are deleted. This option overrides the SFDC Log Count option if the SFDC Log Count option would cause job logs to be retained for more than this many days. For example:
With a value of 0, only the most recent job will be retained.
With a value of 5, only the most recent job log and logs from the previous 5 days will be retained.
If this field is left blank/empty, all job logs will be retained.
CopyStorm contains backend support only for Salesforce Logging. To enable Salesforce support for this feature, contact your Capstorm account representative.
Database Logs in UTC

Unchecked
Most filter types support selecting which tables to include in a snapshot.
The Column Expression filter type supports rich user supplied expressions to limit which records are snapshot.
The Advanced tab contains parameters rarely modified by a customer.
The following subsections describe each tab in details.
Each Snapshot Policy requires a unique name. There are no restrictions on what characters can appear in a name but the name itself must be unique for each snapshot policy.
A Snapshot Policy is always in either an Active or Inactive state.
A policy in an Active state will be be used by CopyStorm as part of a normal backup. For example, the Default Recycle Bin policy will usually be set to an Active state so the backup will automatically snapshot records as they are deleted from Salesforce.
A policy in an Inactive state can be ran by hand but will not be automatically processed as part of a CopyStorm backup. Inactive policies are useful for one-off compliance needs and snapshot policies that do not need to be part of a scheduled process.
The Apply Policy section controls when CopyStorm will check a record in the database against the policy filter. There are three options:
After Insert — check a record against the policy immediately after it is inserted into the CopyStorm database.
Before Update — check a record against the policy immediately before it is updated with changes from Salesforce.
After Update — check a record against the policy immediately after it has been updated in the CopyStorm database.
One or all of the option can be selected concurrently. In all cases, CopyStorm will not add a record to a snapshot if an identical copy of the record is already in the snapshot.
To reduce the amount of database space required to snapshot a record, certain non-essential fields can be excluded. Common exclusion choices are:
Empty Fields — when empty fields are excluded a savings of the “length of the field name” plus 3 bytes is saved for each of the record’s empty fields.
Formula Fields — excluding a formula field can often save a lot of space in a record. Formulas are computed, so there is no data loss.
The # Days to Retain parameter controls how many days records are kept in a snapshot before they are deleted.
Blank means to keep snapshot records forever.
90 means to delete snapshot records after 90 days.
In addition to the global # Days to Retain parameter, the policy for individual tables in a snapshot can be set explicitly by creating an override rule using the Advanced.. button. Clicking on the Advanced… button launches the Advanced Retention Rules Editor.
The Filter Rule Type specifies specific properties that a record must have to be considered by the snapshot policy. Example Filter Rule Types include:
Deleted Records — a record passes the filter if it has been deleted in Salesforce.
Column Expression — a record passes the filter if the data in its columns matches a user defined expression.
All Changes — a record always passes the filter.
For further details for each filter rule type, see the article on Policy Filter Rules.
The content of the Filter Rule Parameters tab depends on the Filter Rule Type selected on the Main tab.
For example, the following screen shot is for a Column Expression filter rule.
This filter says to only snapshot a record if it is a Contact or Account and is named CapStorm.
Like most filters, the tables to be processed by the rule can be specified as a White List, Black List, or both.
For further details for each filter rule type, see the article on Policy Filter Rules.
To boost performance of record relationship traversal, CopyStorm Snapshots maintain a high speed database index. This section supports excluding reference fields from the high speed index to save space in the database. The reference fields selected by default are rarely needed for relationship traversal, occur on nearly every record, and thus can take up significant space in the CopyStorm Snapshot index.

Subject
Yes
The subject line used for notification emails. Though it can be any text you want, there are a few special text values that will be replaced dynamically before a message is sent:
“{status}” will be replaced by “OK” or “ERROR” based on the outcome of the job.
If there are any exceptions encountered then “ERROR” will be substituted, otherwise “OK” will be used.
“{file}” will be replaced by the base name of the CopyStorm configuration file used by the job.
Send Notification On
No
Determines when CopyStorm will send a notification email:
Success: If checked, an email will be sent if a job works perfectly (no exceptions).
Exception(s): If checked, an email will be sent if a job has any exception (including non-fatal exceptions where CopyStorm recovered).
Notify When Using GUI
No
If checked, email notifications will be sent when CopyStorm is launched from the GUI. If not checked, email notifications will only be sent when CopyStorm runs in batch mode.
Notify Current User
No
If checked, the Salesforce User specified on the Main tab of CopyStorm will be notified in addition to the specified recipients (Send Email To).
Email Host
Yes
The SMTP host used by your organization (used to send email). If you do not know this information ask your email administrator.
Email From
Yes
The “Test Email Delivery” button causes an email to be sent to the recipient list. If communication to the SMTP email server or target Salesforce org is successful an acknowledgement dialog will be displayed and an email will be delivered to the recipients.
If communication to the SMTP email server or target Salesforce org fails, a dialog will be displayed showing the error. In this case you should show the error to your local administrator.
Test email notification:
Under normal circumstances CopyStorm will deliver a notification email that looks like the following. Note that this data is also stored in the CopyStorm database and can be browsed using CopyStorm/Medic (or any other tool you choose).
If CopyStorm encountered an error during the backup job, errors will be listed below this summary table:
If CopyStorm fails before any backup can be attempted, a notification email like the following will be sent. In this example the password for Salesforce was incorrect in the CopyStorm configuration file.
Send Email To
Yes

Notification emails will be sent to this white space separated list of email addresses.
001ZZ
Level 2
5–6 (2 chars)
01
Level 3
7–8 (2 chars)
00
Level 4
9–10 (2 chars)
00
Level 5
11–12 (2 chars)
00
Full example path for the example ID:
Each record produces at least one file and potentially more.
Main record file: Always present, contains all standard field values as XML:
Large field files: Created for any field whose value exceeds 5 KB (e.g. Body on ContentVersion). The main XML file references these by name; the data is stored separately:
Example for a file attachment:
Bucket name
Yes (configurable)
Folder prefix
Yes (configurable, may be empty)
AWS region
s3://[bucket]/[folder]/[chars 0–4]/[chars 5–6]/[chars 7–8]/[chars 9–10]/[chars 11–12]/[filename]Level 1
0–4 (5 chars)
s3://my-bucket/my-folder/001ZZ/01/00/00/00/001ZZ010000000000AA.xml[recordId].xml[recordId].[fieldName].txt001ZZ010000000000AA.xml
001ZZ010000000000AA.Body.txtThe same operation using the SOAP API results in an UNKNOWN_EXCEPTION or an unparsable SOAP body
The CopyStorm/SanityChecker tool tests the hyperlinks returned by the REST API and reports the ID of records where the hyperlink fails (e.g. Does not return a HTTP 200). It is often wise to check each reported record using the Salesforce GUI to make sure that the data is really available. If you find a corrupted Attachment record report it to Salesforce.
The only required parameters are the tables to search, but there are a number of other parameters you may want to modify.
Modified After
Search for records starting at this date. A date can be selected from the menu or typed in directly. Values are restricted to datetime formats supported by SOQL.
Modified Before
Search for records up to this date. A date can be selected from the menu or typed in directly. Values are restricted to datetime formats supported by SOQL.
Salesforce Batch
The next step is to click on the Start Sanity Check button and wait for the analysis to complete. Note:
Each hyperlink check takes one Salesforce API call. There is one additional API call for every 2000 records.
An running analysis can be cancelled but the cancellation process may not be immediate. The reason is that pending HTTP requests must complete or timeout before the cancellation process is finished.
While the sanity check is in process, the tool will look like the following:
The following example shows what a report of potential problems looks like. You can copy/paste the potential problems into your favorite editor.
Hopefully when you scan your Salesforce the tool will not find potential problems. However, if potential problems are found then it is wise to check the validity of each record using the Salesforce GUI.
If you are using CopyStorm to perform backups, then this class of error will be discovered during the normal course of a backup. Unfortunately the error is often masked by an UNKNOWN_EXCEPTION or an Invalid SOAP Envelope response from Salesforce.
Select “Other Tools” from the top-level menu.
Select “Data Synchronization” and then “Lineage Maintenance”
Optionally Configure Modified After & Modified Before
This will control what date ranges are queried for lineage.
Leaving these values Blank will query all time lineage.
Optionally Enable Validators
Purged Record Validation
Identifies lineage entries that do not have a corresponding physical record in the CopyStorm Database or Snapshot.
Branching Lineage Validation
Identifies lineage entries that have multiple children.
Optionally toggle “Only Show Invalid Lineages” checkbox
This should be used when investigating invalid lineages.
Click “Start Scan”
After clicking “Start Scan”, the application will render a view of:
All Lineage within the provided Modified After / Modified Before values.
The Status of each Lineage.
Valid
If there are no branches and all lineage entries exist in the CopyStorm Database or Snapshot
Invalid
If branch(es) are detected or any entry is missing from the CopyStorm Database or Snapshot
The associated Salesforce Table for the Lineage.
The Salesforce ID of the Lineage HEAD
HEAD is the most recent entry in the Lineage.
Use the “Invalidate Selected Lineage” to mark problematic Lineage Entries as Invalid in the database.
Note: Invalidating Lineage will prevent CopyStorm/Restore from considering invalid entries as recovery candidates.
An example of viewing a full lineage is shown below:
System Administrator Profile
These permissions are ONLY necessary while using the Permissions Set Creator feature.
To access this tool, go to the “Other Tools” menu in the top-left menu bar of CopyStorm:
A pop-up window will appear allowing you to configure and invoke the tool:
Provide a label and API name for the permission set.
If a permission set with the same API name is already present in Salesforce, the existing permission set will be updated.
Decide whether or not to include edit access in addition to read access for all included objects
Choose to automatically assign the created permission set to the CopyStorm Salesforce User.
The CopyStorm Salesforce User is the Salesforce User on the “Main” tab of CopyStorm.
Choose the source of the metadata that will be used to create the permission set.
Salesforce: CopyStorm will query the metadata API for a list of all available objects that can be included.
CopyStorm: CopyStorm will query the CopyStorm database (specified on the right-hand side of the Main tab of CopyStorm) metadata backup for a list of available objects that can be included (for this option, you will first need to have a backup of your Salesforce metadata created by CopyStorm).
Navigate to the Select Tables tab.
Select the objects that will be included in the permission set. Read permissions (and optionally write/edit permissions) will be granted for these objects as part of the deployment.
Click the Deploy button to deploy the permission set to Salesforce.
Navigate to the Deploy Status tab to view the deployment logs and status.
CopyStorm supports dynamic transformation of field data after reading it from Salesforce and before it is written to the target database. This article describes how to add a new custom transformation to CopyStorm.
This issue first arose when a customer wanted to scramble Salesforce data for certain fields before it was written to the target database. Since the customer needed total control over the data manipulation process, an extension was added to CopyStorm to dynamically add field transformations. This allows you to write custom code to perform operations like:
Scramble email addresses – instead of replicating plain-text email addresses, obfuscated emails could be replicated.
Scramble sensitive data such as social security numbers or Contact health information.
Most customers do not require this feature — it is only used when Salesforce data needs to be modified prior to being added to a local relational database. As CapStorm’s data recovery features will recover the exact data that is stored in the database, it is always best practice to write unmasked data to the database.
The process of adding a new data transformer is not difficult — all that is required are the following steps:
Write a Java class that implements the Capstorm interface com.aslan.sfdc.extract.transform.ITransformer.
Add a TransformerRegistry.xml file to CopyStorm’s config directory to register the new transformer with CopyStorm.
Update the TableRuleRegistry.xml file to enable the new transformer for the appropriate fields.
The rest of this article describes the development and deployment process for adding a new data transformer to CopyStorm that reverses any input string.
Example: The transformer in this article will turn “Capstorm” into “mrotspaC”.
The following code is an example data transformer implementation. After creating a new data transformer, package it in a jar and store the jar file in the “lib” subdirectory of the CopyStorm installation directory.
CopyStorm discovers available transformers by looking for a file named TransformerRegistry.xml in the CopyStorm config directory.
The following TransformerRegistry.xml will cause CopyStorm to load the “Reverse” transformer:
The Transformer directive adds a new custom transformer using the following attributes:
name — the friendly name used to apply the transformer to a particular Salesforce field.
class — the full name of a class that implements the ITransformer interface.
CopyStorm discovers field transformations by looking for FieldTransform elements in the TableRuleRegistryFile.xml configuration file in CopyStorm’s config directory. The general format of this file is described .
The following TableRuleRegistry.xml will cause CopyStorm to reverse the letters in the LastName for all Contacts before writing the LastName to the database:
FieldTransform configuration directives have the following options:
name — the name of a field in the corresponding Salesforce table.
transformer — the name of a registered transformer that will be applied to the field data. This is the same as the name specified in Step 2.
If your custom transformer is having no effect on data then the problem is likely in the new XML configuration directives.
To verify that your entry to TableRuleRegistry.xml is correct, use one of the built-in CopyStorm transformers. Built-in transformers include:
Scramble — replace each letter with a different letter, replace each number with a different number.
Blank — return a blank string.
If CopyStorm’s built-in transformer works then the problem is either in your TransformerRegistry.xml file or in your code. Put some debugging in your transformer to see if it is ever being called.
If it is not being called, the problem is in the TransformerRegistry.xml file.
If it is being called, then fixing the code is up to you!
The Notifications Tab contains parameters used to control who receives a status email when a CopyStorm/Medic job runs and under what circumstances email is sent. CopyStorm/Medic supports email notifications via SMTP or via a Salesforce SOAP API call.
Send Email To
Yes
The CopyStorm/Medic Partition Editor tool modifies the schema of the CopyStorm database to vertically partition CopyStorm Salesforce data tables into multiple database tables.
This tool is typically used when a Salesforce object is wide enough that it cannot fit into a single SQL database table. For example, if the Salesforce Account and Contact objects both have the maximum number of custom fields and Person Accounts are enabled. This can cause a single Salesforce object to have more than 1,000 fields.
In the scenario where partition creation fails for any reason, the next partition creation attempt will pick up where the last partition creation failed. When a partition is in a partial state due to a failure, CopyStorm jobs will skip over backing up records to this table until the partition is completed.
This CopyStorm/Medic tool provides a way to resolve database error messages indicating that a record is too large to fit in a database table:
MySQL: “Row size too large (> 8126)”
SQL/Server: “Cannot Create a row of size 8765 which is greater than the allowable maximum row size of 8060”
PostgreSQL: “row is too big”
To access the Partition Editor GUI:
Select “Other Tools” from the top-level menu.
Select “Partition Editor” in the dropdown.
A list of objects in the CopyStorm database is displayed on the left – select an object to view its partition configuration. After selecting an object, the following information will be displayed:
Partition Name
The CopyStorm database table name for the table storing the field.
Field Name
The Salesforce field name.
To move fields between partitions, or to create a new partition, click on the “Move Fields” button. This button will open a pop-up window displaying available partitions and configuration options to configure a new partition.
The “Move [Object] Fields To” drop-down controls the target partition.
If a pre-existing partition name is selected, then any fields already in the target partition will not be available to select.
If the “New JDBC Partition” option is selected, then CopyStorm/Medic will create a new database table to hold the selected fields.
Configuration parameters for the target partition type will be displayed below the drop-down.
Data partitions can be created in:
The SQL Database, as a new JDBC Table.
The following screenshot displays the configuration panel for creating a new JDBC Database Table partition:
Clicking on the “Continue” button will open a pop-up for Field Selection:
All selected fields will be moved to the target partition.
The source partition for each field is displayed next to the field name.
After clicking on the “Review Changes” button, the selected fields will be displayed – highlighting the source partition(s) that currently contain the fields.
To perform the changes and update the CopyStorm database schema, click on the “Apply Changes” button. Clicking on the “Apply Changes” button will cause CopyStorm to:
DROP from the target partition any pre-existing columns for the selected fields.
This is to ensure that the partitioning process can be retried should any issues be encountered during the partitioning process.
Create schema in the target partition.
While the partitioning process is running, status will be displayed in the “Log” tab. When the partitioning process has completed, the log will indicate that the job has finished.
After closing the pop-up, the Partition Editor will display the new status of the selected fields.
Each time CopyStorm runs it records job information and statistics into a set of history logging tables within the CopyStorm database. The History Tab supports viewing and exporting CopyStorm job history.
The History Tab consists of two sections — a top section used to search for past CopyStorm jobs and a bottom section displaying a one-line status for each job in the database.
Configured separately, not part of the path
Salesforce record ID
Yes. Determines all subfolders and filename
Salesforce object/table name
No
Org ID
No
Backup date or job ID
No
Column Name
The CopyStorm database column name for the column storing the field.
Type
The Salesforce field type.
If a pre-existing partition was selected, an ALTER TABLE statement will be executed to add the selected fields to the target partition.
Copy field data from the source partition(s) to the target partition.
Update CopyStorm metadata for the selected fields.
DROP the data columns from the source partition(s).









For example, the configuration file “C:\capstorm\config\myCopyStormConfig.copyStorm” will be replaced with “myCopyStormConfig.copyStorm”.
The email address that will appear in the “From” field in sent notifications. Note that many email servers allow this value to be a fake email address (e.g. “noreply@capstorm.com”).
Send Email To
Yes
Notification emails will be sent to this white space separated list of email addresses.
Subject
Yes
The subject line used for notification emails. Though it can be any text you want, there are a few special text values that will be replaced dynamically before a message is sent:
“{status}” will be replaced by “OK” or “ERROR” based on the outcome of the job.
If there are any exceptions encountered then “ERROR” will be substituted, otherwise “OK” will be used.
“{file}” will be replaced by the base name of the CopyStorm configuration file used by the job.
For example, the configuration file “C:\capstorm\config\myCopyStormConfig.copyStorm” will be replaced with “myCopyStormConfig.copyStorm”.
Send Notification On
No
Determines when CopyStorm will send a notification email:
Success: If checked, an email will be sent if a job works perfectly (no exceptions).
Exception(s): If checked, an email will be sent if a job has any exception (including non-fatal exceptions where CopyStorm recovered).
Notify When Using GUI
No
If checked, email notifications will be sent when CopyStorm is launched from the GUI. If not checked, email notifications will only be sent when CopyStorm runs in batch mode.
Require Encryption
No
If checked, CopyStorm will require that connections to the email server be encrypted with TLS.
Email Report Format
Yes
A list of supported formats for the notification email.
Email User
No
Username used to authenticate with the SMTP server.
Email Password
No
Password used to authenticate with the SMTP server.





Number of records to process from Salesforce in a single batch. The default usually provides optimal performance.
# Checker Threads
Number of base 64 hyperlinks to analyze concurrently.
Max Timeout (sec)
Number seconds to allow for each hyperlink test. If a hyperlink HTTP request times out it is assumed to be OK based on Capstorm’s experience with problem records. Setting this to a smaller value may improve the overall throughput of the analysis.
Report Timeouts
If this option is checked then all HTTP timeouts will be reported as potential problems. Enabling this feature may be useful in selecting an optimal Max Timeout value for your organization.












package com.capstorm.extension;
import org.apache.commons.lang3.StringUtils;
import com.aslan.sfdc.extract.transform.ITransformer;
public class ReverseTransformer implements ITransformer {
/**
* Take a string and return the string with the letters reversed.
*
*@param table - name of the Saleforce table containing the value
*@param column - name of the Salesforce column containing the value
*@param columnWidth - the number of characters in the column
*@param recordId - the unique Saleforce record id containing the value
*@param value - the values whose letters are to be reversed.
*
*@return the value with its letters reversed
*/
@Override
public String transform(String table, String column, int columnWidth, String recordId, String value) {
if( null != value ) {
value = StringUtils.reverse(value);
}
return value;
}
}<Transformers>
<Transformer name="Reverse" class="com.capstorm.extension.ReverseTransformer" />
</Transformers><TableRule name="Contact">
<FieldTransform name="LastName" transformer="Reverse" />
</TableRule>Send Email To
Yes
Notification emails will be sent to this white space separated list of email addresses.
Subject
Yes
The subject line used for notification emails. Though it can be any text you want, there are a few special text values that will be replaced dynamically before a message is sent:
“{status}” will be replaced by “OK” or “ERROR” based on the outcome of the job.
If there are any exceptions encountered then “ERROR” will be substituted, otherwise “OK” will be used.
“{application}” will be replaced by “CopyStorm/Medic”.
Send Notification On
No
Determines when CopyStorm/Medic will send a notification email:
Success: If checked, an email will be sent if a job works perfectly (no exceptions).
Exception(s): If checked, an email will be sent if a job has any exception (including non-fatal exceptions where CopyStorm/Medic recovered).
Require Encryption
No
If checked, CopyStorm/Medic will require that connections to the email server be encrypted with TLS.
Email User
No
Username used to authenticate with the SMTP server.
Email Password
No
Password used to authenticate with the SMTP server.
Notification emails will be sent to this white space separated list of email addresses.
Subject
Yes
The subject line used for notification emails. Though it can be any text you want, there are a few special text values that will be replaced dynamically before a message is sent:
“{status}” will be replaced by “OK” or “ERROR” based on the outcome of the job.
If there are any exceptions encountered then “ERROR” will be substituted, otherwise “OK” will be used.
“{application}” will be replaced by “CopyStorm/Medic”.
“{file}” will be replaced by the base name of the CopyStorm/Medic configuration file used by the job.
For example, the configuration file “C:\capstorm\config\myCopyStormMedicConfig.copyStormMedic” will be replaced with “myCopyStormMedicConfig.copyStormMedic”.
Send Notification On
No
Determines when CopyStorm/Medic will send a notification email:
Success: If checked, an email will be sent if a job works perfectly (no exceptions).
Exception(s): If checked, an email will be sent if a job has any exception (including non-fatal exceptions where CopyStorm/Medic recovered).
Notify Current User
No
If checked, the Salesforce User specified on the Main tab of CopyStorm/Medic will be notified in addition to the specified recipients (Send Email To).
Email Host
Yes
The SMTP host used by your organization (used to send email). If you do not know this information ask your email administrator.
Email From
Yes


The email address that will appear in the “From” field in sent notifications. Note that many email servers allow this value to be a fake email address (e.g. “noreply@capstorm.com”).
Id
ID of the job.
Status
Completion status of the job. Green checkmark indicates this job had no exceptions. Red exclamation indicates job finished with at least one exception.
Start
The start timestamp of the job, in local time.
End
The end timestamp of the job, in local time.
#Copied
Number of records written to the database.
#Skipped
Records read but not copied as they are already in the backup.
#Deleted
Records removed from the database due to deletion in Salesforce beyond retention settings.
#Snapshot
Records captured as part of point-in-time copy or custom snapshot.
#Exceptions
Number of exceptions reported during the job.
Time
Total elapsed time of the job.
API Calls
Number of Salesforce API calls used during the job.
Version
Application version used for the job.
Config File
Name of the .copyStorm configuration file associated with the job.
When the “View…” column is clicked a dialog appears providing detailed job status. This dialog is similar to the “Copy in Progress” GUI but only contains tables that had activity in the selected job.
Table
Opens a dialog providing detailed status of the selected job.
Start Time
Starting time of the table copy.
End Time
Any exceptions that occurred during the job will be displayed in the Exceptions tab. In this example, the job had a single exception.
View...
Opens a dialog providing detailed status of the selected job.
Status
Completion status of the job. Green checkmark indicates this job had no exceptions. Red exclamation indicates job finished with at least one exception.
Start
When the “View…” column is clicked a dialog appears providing detailed job status:
In addition to viewing historical job data, the History Tab can be used to delete job records and to export job data to Excel-compatible CSV files.
To delete records:
Click on the check box next to one or more Job #.
Click on the “Delete” button.
To export job history to CSV files:
Click on the check box next to one or more Job #.
Click on the “Export” button.
View...

Opens a dialog providing detailed status of the selected job.
When storing Files and Attachments in the CopyStorm database, CopyStorm mirrors the Salesforce API specification for the field. This means that Salesforce object fields of type Base64 (such as Attachment.Body and ContentVersion.VersionData fields) are stored in the CopyStorm database as Base64 text strings. Such representations are industry standard and are intended to eliminate problems that can arise with storing binary values in a database. CopyStorm also removes limitations on the size of large text fields by means of a process of “chunking” – breaking down large blocks of content into chunks that fit comfortably in database given the unique datamodel limitations of the database engine. For example – Salesforce supports ContentVersion files as large as 2 GB, but the largest text string that can be stored in a PostgreSQL database is approximately 1 GB. With the “chunking” system, there are no practical limitations to how large a field value can be stored.
This storage format can make it complex to view the contents of a Salesforce File or Attachment. For example, if the Base64 content is a PDF file, then you cannot view the PDF using a normal PDF viewer without exporting the Base64 text from the database and decoding the file content.
The Base64 Export tool provides a way to directly export Files and Attachments from the CopyStorm database. This tool is also compatible with all database storage types used by CopyStorm – Base64 strings, chunked files, and CS:Govern-encrypted files. Just as there are no practical limits in how large a document can be stored in the primary CopyStorm database or a Snapshot, there are also no practical limits on how large a document can be exported to the file system (as long as you have enough disk to store the file!).
To run the Base64 Export tool in the CopyStorm/Medic GUI, open the tool from the main menu using Other Tools => Data Synchronization => Export Base64 Objects to File System. This will open the following GUI:
The DataSet Selector drop-down box in the top-left of this tool contains a listing that includes the primary CopyStorm Database along with any defined Snapshot policies that the user has defined. In the diagram above, the primary CopyStorm Database has been selected which means that the Base64 Exporter will export files stored in the main CopyStorm data tables.
Below that drop-down box is the list of Available Table Fields. The Available Table Fields list allows selection of the specific File or Attachment object and field(s) to be exported.
When exporting content out of the source DataSet and into the file system, the tool, minimally, must know where to place those exported files. CopyStorm/Medic creates the output location by combining the “Output Path” folder path and a rule that specifies which sub-folders, if any, the files should be exported into. The Output Path setting is shown in the GUI screen shot above, and the sub-folder rule is provided by the Folder Names drop-down box. This drop-down has two choices:
No Sub-Folders: Files are exported into a flat structure in the Output Path folder location.
ObjectType: Files are exported into a folder whose name is based upon the Salesforce object name. For example, all ContentVersion documents will be exported into a folder named [Output Path]/ContentVersion/.
As not all File objects in Salesforce provide a file name field, the Default File Extension is used to provide a reasonable default value to use in cases where a file name cannot be established.
The Decrypt Compliance Data checkbox is used to tell the Base64 Export tool whether it should attempt to decrypt a Base64 field that has been encrypted with CS:Govern. If the field is encrypted with CS:Govern, then this checkbox will cause CopyStorm/Medic to attempt to decrypt the field values – if you have permission to view the plaintext for the fields, then it will export the file data. If you do not have permission to view the plaintext, CopyStorm/Medic will export the CS:Govern masked value.
To configure rules for exporting files from a specific field, click on the field name in the left-hand side of the Base64 Exporter. This will display a dialog that looks like the following:
This dialog allows configuration of a number of parameters, selecting which records should be exported along with setting restrictions to limit the total disk consumption used by the exporter. The Base64 Export tool allows limits on both the number of files to be exported as well as the total disk space taken up by the export process. It is important to know that these limits are per-object based. For example, if you enter 5 into the Max Exported Files field for the Attachment object along with a value of 15 for the ContentVersion object, and there are more than five Attachment and more than 15 ContentVersion records that match the selection parameters, then 20 total files will be written. There will be 5 Attachment files written to the disk, and 15 ContentVersion records similarly written.
A blank value for the Max Exported Files sets there to be no limit – ALL scanned candidate records will be exported for all objects and records matching the selection criteria. This is also true for the Max Disk Space Consumption parameter – if this parameter is set to blank, then CopyStorm/Medic will not limit the amount of disk used by the export.
Having values entered for BOTH the Max Exported Files as well as the Max Disk Space Consumption data entry fields causes both rules to be applied – whichever limit is exceeded first will stop the processing of the object type.
Having limits on the Max Exported Files as well as the Max Disk Space Consumption helps you prevent runaway situations where millions of files or terabytes of data match the criteria – filling up all space on the output drive. You can also play with the tool with a small number for one or the other (or both) and, once comfortable with how it works, leave those data entry fields blank to allow for a complete export.
The Base64 Export tool will use the following logic to determine the name of the file to be exported to the file system:
First the tool will look for a title field in the scanned candidate record. If the title field is not blank, then the title field value will be used. If there is no title field or the title field is blank, the SalesforceId will be used as the file name.
If the selection for the File Names drop-down box is PreserveFileName then we are done and we know the name of the file to be exported – it is the one from step (1).
If the selection for the File Names drop-down box is ID_Filename and a title field value was found in step (1), the file name will be the Salesforce record Id followed by an underscore and followed by the title found in step (1). Otherwise the filename is just the Salesforce Id.
If exporting files to a directory that already has files in it, then CopyStorm/Medic may create new output files and not overwrite existing files, or CopyStorm/Medic may overwrite the existing files with a new export.
These rules also apply to exports that may include duplicate file names – for example:
Files were exported to the target folder from an earlier CopyStorm/Medic session.
A target Output Path was selected which just happened to already contain some files some of which some just happened to have the same name as files to be exported.
The user clicks the Export button multiple times – each click causing the tool to re-scan and re-export candidate records.
The user has selected the No Sub-Folders option for the Folder Names drop-down box and there happen to be similarly titled documents in Salesforce even though the Object types are different. For example, there might be an Attachment called “Company Regulations.pdf” as well as a ContentVersion object with that exact same name.
The Duplicate Rule drop-down box is used to configure the Base64 Export tool to handle these situations. Here are the options:
Skip: If the tool attempts to write a file to the file system that already exists in the target folder, it will simply skip exporting that file (in other words it will not clobber the existing file.)
Overwrite: If the tool attempts to write a file to the file system that already exists in the target folder, it will simply overwrite that file (in other words it will clobber the existing file.)
Version: If the tool attempts to write a file to the file system that already exists in the target folder it will suffix the new file with the conventional syntax for such cases – a space followed by parentheses that enclose a monotonically increasing number. Behind the scenes the tool will continuously bump that number until a unique file name is generated.
Next to the File Rules tab in the screen shot above of the Base64 Export Rules dialog, there is a tab called Select Records. Clicking on that tab will show a view that looks like this:
Like the File Rules, the Select Records tab defines rules that are specific to the selected Object from the Available Table Fields list. These rules, however, have nothing to do with how and where files are stored in the target file system. Instead they are used to determine which records in the selected DataSet are candidates for export. This is a much more strategic and surgical rule than the file rules, and the functionality provides similar options as in the CopyStorm/Restore application. For details, see the documentation in the CopyStorm/Restore section.
Note that not all of the UI elements used in the dialogs for Restore apply to Base64 Export.
Beyond selecting which records should be exported, the Base64 Exporter also allows point-in-time selection of matching records. The following screen shot shows available options for Point-In-Time Export. These are available when a Snapshot is selected in the DataSet Selector:
When selecting a Snapshot from the DataSet Selector, you have options for determining which points in time the Base64 field values should be exported from. The screen shot above is showing the A Point In Time selection. Here are the available choices:
Most Recent
A Point In Time
A Single Date
Between Two Times
An in-depth discussion of how the CapStorm Snapshot sub-system works can be found .
The following shows available options when the Most Recent selection is made:
The following screen shot shows available options when the A Single Date selection is made:
The following screen shot shows available options when the Between Two Times selection is made:
If either of the following options are selected, it is possible that multiple files match the selection criteria:
A Single Date: The time span starts at midnight of the selected date and ends just prior to midnight of the following day – resulting in a 24 hour period.
Between Two Times: The time span starts at the specified start time and ends at the specified end time.
In those two cases it is very possible that there are many records for the selected Salesforce object of a specified Salesforce Id. To choose which version(s) of the record to export, you can select the Earliest, the Latest, or All, versions of that Salesforce Id.
Available tables are provided by a Base64ExportTableRuleRegistry.xml configuration file. This file contains metadata that defines which Salesforce object fields are candidates for the Base64 Export process, and contains the following built-in definitions.
To add a new table to the Base64 Exporter, create a new Base64ExportTableRuleRegistry.xml file and add it to the [CopyStormMedic]/config/ directory.
Each rule in this XML document specifies the following:
The name of the Salesforce object (tableName)
The name of the Salesforce Base64 field (contentsFieldName)
The name of the Salesforce field whose value is the title of the document (titleFieldName)
The name of the Salesforce field whose value is the length (in bytes) of the document (contentLengthFieldName
All attributes are required with the exception of the titleFieldName attribute. If the titleFieldName attribute is not provided, the Salesforce Id field value will be used to name the exported files.
The Base64 Export tool cannot be executed as a batch job.
There are a number of rare cases in which table-specific processing rules are necessary (please remember, these are rare cases):
The Salesforce metadata API reports fields in a table that are not actually present.
The default LIMIT option for a table always times out.
The Salesforce SOAP API returns an invalid response for an Attachment while the REST API works properly.
In all cases CopyStorm supports overriding default processing rules for a table by creating an XML configuration file “TableRuleRegistry.xml” in a CopyStorm configuration directory. The best practice for creating a configuration directory is to:
CopyStorm provides a command line interface to enable CopyStorm to run under Windows Task Scheduler or CRON on Linux. Begin by creating a CopyStorm .
The following example Windows command line will run CopyStorm where:
CopyStorm is installed in C:\CopyStorm.
CopyStorm’s configuration file name is DemoCredentials.copyStorm.
CopyStorm’s configuration file is located in C:\CopyStormDemo.
“{file}” will be replaced by the base name of the CopyStorm/Medic configuration file used by the job.
For example, the configuration file “C:\capstorm\config\myCopyStormMedicConfig.copyStormMedic” will be replaced with “myCopyStormMedicConfig.copyStormMedic”.








Ending time of the table copy.
#Read
Number of records read from Salesforce.
#Copied
Number of records written to the database.
#Skipped
Records read but not copied as they are already in the backup.
#Deleted
Records removed from the database due to deletion in Salesforce beyond retention settings.
#Per Minute
Average number of records written to the database per minute.
Total Time
Total Elapsed time of the table.
Start timestamp of the job.
End
Records read but not copied as they are already in the backup.
#Deleted
Records removed from the database due to deletion in Salesforce beyond retention settings.
#Snapshot
Records captured as part of point-in-time copy or custom snapshot.
#Exceptions
Number of exceptions reported during the job.
Time
Total elapsed time of the job.
API Calls
Number of Salesforce API calls used during the job.
Version
Application version used for the job.
Config File
Name of the .copyStormMedic configuration file associated with the job.




Create a “config” subdirectory in the directory where .copyStorm files are kept.
This directory should not be inside the CopyStorm installation directory.
Set the “Config Directory” parameter on the CopyStorm Configuration tab in the External Configuration section to point to the newly created config directory.
Store the “TableRuleRegistry.xml” configuration file in the newly created config directory.
For other best practices on how to install CopyStorm and your configuration files, please see our Installation Best Practices article.
A quick and dirty solution is to store custom configurations in a subdirectory named “config” in the CopyStorm installation director, but this makes upgrading the CopyStorm installation more difficult:
If CopyStorm.bat is in the directory “C:\bin\CopyStorm”
Create a file named “C:\bin\CopyStorm\config\TableRuleRegistry.xml”
The following TableRuleRegistry.xml file will cause CopyStorm to exclude Attachment and ContentVersion records where their data size is greater than 1,000,000 bytes:
The following TableRuleRegistry.xml file will cause CopyStorm to exclude the LastViewedDate and LastReferencedDate fields when processing the Salesforce Opportunity table (columns will be created in the database but never populated):
The following TableRuleRegistry.xml file will cause CopyStorm to exclude all fields called “LastViewedDate” from tables in the “XYZ” package (columns will be created in the database but never populated):
The following TableRuleRegistry.xml file will cause CopyStorm to only include the “Name” field when processing the Salesforce Opportunity table (other columns will be created in the database but never populated):
Note that:
When an IncludeField is specified any ExcludeField rules are ignored.
The following fields are always copied, even if they are in a configuration directive:
SystemModStamp
CreatedDate
LastModifiedDate
LoginTime
isDeleted
Default CopyStorm behavior is to backup formula columns just like any other column. To change this behavior, the “excludeFormulas” directive will cause CopyStorm to ignore formulas on a table. Note that the database columns corresponding to Salesforce formulas will still be created but will always have null values.
The following TableRuleRegistry.xml file will cause CopyStorm to exclude formulas for the Opportunity table.
Starting with CopyStorm version 8.37.1 the default formula exclusion rule can be set for all tables by setting the “excludeFormulas” attribute on the table “default”. The “default” table does not correspond with a table name in Salesforce or the CopyStorm database, but is used to specify global table processing options.
The following TableRuleRegistry.xml file will cause CopyStorm to exclude formulas for all tables (unless there is a rule overriding the global default for individual tables):
The following TableRuleRegistry.xml file will cause CopyStorm to read Opportunity records 17,777 at a time:
Default CopyStorm behavior is to use the systemmodstamp field to determine when a record has been modified. This ensures that all changes are mimicked in CopyStorm, but occasionally a site will want to use the LastModifiedDate column instead.
The following TableRuleRegistry.xml file will cause CopyStorm to use the “LastModifiedDate” column to determine if “Account” records have changed:
Since this would be tedious to apply to all tables, another option is to change the global default for all tables. Note that if a table does not have the specified timestamp column, CopyStorm will automatically adjust to the most pertinent column contained in the table.
The following TableRuleRegistry.xml file will cause CopyStorm to use the “LastModifiedDate” to determine if any record has changed:
Default CopyStorm behavior is to create database tables with names matching the corresponding table in Salesforce. To override the database name for a specific Salesforce table, use the “databaseTableName” parameter.
The following TableRuleRegistry.xml file will cause CopyStorm to store “Account” records in a table named “AccountMaster”:
Default CopyStorm behavior is to use the default RDBMS options. To specify non-default options for table creation use the “CreateTableRule” configuration directive.
The following TableRuleRegistry.xml file will cause CopyStorm to use specific creation options in MySQL and SQL/Server:
If the database type matches the “database” parameter the specified option will be appended to the generated CREATE TABLE statement. For example:
CREATE TABLE Account(id CHAR(18) PRIMARY KEY, name NVARCHAR(80) NULL, …) ENGINE=ISAM;
To apply a rule to all tables, set the “name” of the TableRule to “default”.
Default CopyStorm behavior is to process each table until all records are backed up. Setting the “maxRuntime” parameter will cause CopyStorm to stop processing a table after an amount of time has elapsed. The maxRuntime is specified in seconds.
The following TableRuleRegistry.xml file will cause CopyStorm to stop processing Attachment records and continue with the next table in the backup set after 10 minutes has elapsed:
Default CopyStorm behavior is for all table to use the Bulk API parameters specified on the CopyStorm Advanced tab. Several of these parameters can be overridden on a per-table basis.
The following TableRuleRegistry.xml file will cause CopyStorm to use table-specific Bulk API rules for the Account table:
Switch to the Bulk API after 5000 records have been processed by the SOAP API.
Read 100,000 records per Bulk API transaction.
The following TableRuleRegistry.xml file will cause CopyStorm to always use the REST API for the Attachment table:
Default CopyStorm behavior is to use the same record deletion policy on all tables, specified by the “Delete Older Than” option on the Advanced tab.
The following TableRuleRegistry.xml file will cause CopyStorm to never remove deleted records from the Attachment table (overriding the “Delete Older Than” global parameter):
Default CopyStorm behavior is to back up all columns in timestamp order. For rare cases where a table does not contain a timestamp column, a table can be forced to backup in ID order. In nearly all cases, this option is only used internally by CopyStorm for Salesforce system tables that do not follow the normal rules.
The following TableRuleRegistry.xml file will cause CopyStorm to backup the PartnerNetworkRecordConnection table by ID (this is an example of a Salesforce system table that cannot be backed up in timestamp order):
The following TableRuleRegistry.xml file will cause CopyStorm to delete all data in the “PartnerNetworkRecordConnection” before starting each copy:
A number of tables in Salesforce do not support sorting by their timestamp column, and other tables where a user without the ViewAllData permission will get stuck. In these extremely rare cases, CopyStorm can be forced to backup a table using a sliding timebox approach.
The following TableRuleRegistry.xml file will cause CopyStorm to backup the LoginEvent table using a sliding timebox on the EventDate field:
This XML rule means:
Use a sliding 90 day window when backing up LoginEvent. Start the first search on 1-Jan-2014 or the most recent EventDate in the LoginEvent backup table.
The system will backup LoginEvent entries in roughly the following order:
1-Jan-2014 to 31-Mar-2014 1-Apr-2014 to 30-Jun-2014 1-Jul-2014 to 30-Sep-2014 etc… until the current date is reached.
Subsequent backups will start the first timebox at the most recent EventDate in the LoginEvent backup table.
A single TableRuleRegistry.xml file can contain multiple rules and any or all features can be specified for a specific table.
However, this is a bad practice unless instructed to by Capstorm. The built-in rules have been validated on many Salesforce instances and are generally optimal.