Command Line

CopyStorm/Restore is generally used in GUI mode, but it is possible to run Copystorm/Restore as a command line application. This is useful for repetitive tasks such as:

  • Refreshing 15 training Salesforce sandboxes in preparation for the next training class.


  • A CopyStorm/Restore configuration file. This is the file saved by the GUI when selecting File -> Save As.

The simplest form of a CopyStorm/Restore command line is:

  • Windows:
    • CopyStormRestore.bat -run myConfig.copyStormRestore
  • Linux / Mac:
    • sh -run myConfig.copyStormRestore

When running in command line mode CopyStorm/Restore will write progress and any errors encountered to stdout, in addition to the Tracker Database.

Often when CopyStorm/Restore is run in batch mode any history about past restores stored in the Tracker Database should be forgotten. The script that launches CopyStorm could delete the existing Tracker Database — and if so, Copystorm/Restore will automatically recreate it. However, a simpler solution is to use the “-restart” command-line switch. When the “-restart” switch is present, Copystorm/Restore will reset the Tracker Database before the restore begins. For example,

  • Windows
    • CopyStormRestore.bat -restart -run myConfig.copyStormRestore
  • Linux / Mac:
    • sh -restart -run myConfig.copyStormRestore

Command Line Reference

Command Line Switch Description Notes
-restart Reset the CopyStorm/Restore tracker database before starting the restore. This will delete all historical data in CopyStorm/Restore. Ids restored in previous jobs will no longer be available.
-scan Run a candidate scan before starting the restore. This will search the CopyStorm database for any new records matching the Restore Set prior to starting the restore.
-run Specifies the configuration file used to drive the restore.  

Specifies the type restore to perform. Recognized values include:

  • data (default)
  • metadata

The type of Salesforce instance. Recognized values include:

  • Production
  • Sandbox
  • DatabaseDotCom
-sfuser Salesforce username. Note that this option can be used to override the Salesforce user name for both the classic and SFDX Username credentials type.
-sfpassword Salesforce password.  
-sftoken Salesforce security token, if required by your organization.  
-sfhost Salesforce host If you use a custom domain like specific it here. For scratch orgs a Salesforce host must always be specified.
-dbuser CopyStorm database username.  
-dbpassword CopyStorm database password.  
-dbconnection CopyStorm database connection string.  
-dbschema Schema Name Override (or set) the database schema value in the configuration file.
-proxyHost Host Name Override the proxy server in the configuration file. Example:
-proxyPort Port Number Override the port number used by the proxy server.
-proxyUser Username Override the username used to authenticate with the proxy server.
-proxyPassword Password  
-apiTraceFile File Name Log all communication with Salesforce to a file.