All pages
1 of 7

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

How Do I Upgrade CopyStorm?

Upgrading CopyStorm can be a simple task if you follow one rule:

  • Do not store site specific customizations or configuration files in the CopyStorm distribution directory.

If you have set up your Capstorm software by following our Best Practice Guide, you should be ready to continue with the upgrade. If you have included site specific files in the CopyStorm distribution directory then move them into their own directory before starting the upgrade.

To upgrade a CopyStorm installation:

  • Download the latest CopyStorm release from https://www.capstorm.com/download

  • Rename the existing CopyStorm root directory to a new name.

  • Unzip the CopyStorm distribution archive.

  • Move the unzipped CopyStorm directory to the same location as your previous CopyStorm installation.

  • Copy any site-specific configuration files from the previous installation directory to the newly moved installation directory.

    • Be sure to include the CapstormCustomerKey.txt file, if it is installed in the CopyStorm product directory.

You’re finished! CopyStorm distributions have always been backwards compatible with configuration files from previous versions so there is nothing else to change.

WARNING: DO NOT unzip a CopyStorm distribution over an existing installation of CopyStorm.

How to Run CopyStorm in Batch Mode

CopyStorm can be configured to provide a headless Salesforce backup by running in batch/background mode and leveraging the built-in scheduler on your computer. This article will show you how.

Step 1: Create a Script That Runs CopyStorm

The base script used to launch the CopyStorm UI can also be used to start CopyStorm as a headless Salesforce backup application (required for a batch job). To configure the CopyStorm command line:

  1. Save your CopyStorm configuration file using the “Encrypted” and “Save Passwords” options on the CopyStorm “Save As” dialog.

    • This will create a file named “MySettings.copyStorm” (using the name you choose for the file).

  2. On Windows run the command:

    • CopyStorm.bat -run MySettings.copyStorm

  3. On Linux or Mac run the command:

    • sh CopyStorm.sh -run MySettings.copyStorm

If the built into CopyStorm is used then this is likely the only command you will need.

There are a number of optional command line switches (documentation available ), but you do not need this information to go through the process in this article.

If you do not want to use CopyStorm’s built-in email notification or you want to be notified even when the CopyStorm program fails to start then you may want to use the CopyStorm Batch tab to build a starting script.

In practice, a script that does a bit more than run CopyStorm is often used for a batch job. In a typical batch job an organization wants to be notified if a CopyStorm job fails and many organizations also want to be notified any time CopyStorm runs. Though an organization is always free to write their own script for launching CopyStorm, the CopyStorm GUI has a built-in tool for creating a launch script. The generated launch script is often very close to what is desired:

  • The CopyStorm tool can create a launch script in a variety of scripting languages.

  • The generated launch script is readily customizable.

  • The script is easy to run as as a scheduled job under CRON or Windows Scheduler.

The Batch File tab on the CopyStorm GUI is used to create a script for launching a headless Salesforce backup, running CopyStorm as a batch job. Once the required parameters have been specified, press the “Generate Script” button to create a launch script and then press the “Save Script” button to save the script to disk.

Parameter
Required
Description

Most Linux or Mac computers manage scheduled jobs using the built-in cron tool. If the script that runs CopyStorm is called RunProductionCopyStorm.sh:

  • Run the command “crontab -e”

  • Add the following line to the crontab to run CopyStorm once a day at 17:00

    • 0 17 * * * sh ~/RunProductionCopyStorm.sh

For additional information on the format of a crontab entry see the .

Here is an example crontab from one of Capstorm’s servers:

Scheduled jobs on Windows are usually managed using the Windows Scheduler. The following procedure will add a CopyStorm job using a script named RunProductionCopyStorm.vbs to the Windows Scheduler:

Find and Open the Windows Scheduler

Open the Create Basic Task Wizard

Follow the Create Basic Task Wizard Steps

Script Format

Yes

Indicates the scripting language to be used for the generated script. Options include:

  • bat — Windows BAT language.

  • vbs — Windows Visual Basic.

  • bash — Linux/Mac shell script.

  • python — The Python scripting language.

Advanced Scripts

Step 2: Schedule the CopyStorm Job

Schedule on Linux/Mac

Schedule on Windows

notification feature
here
Wikipedia article on cron

Installation

How Large Does My Database Need to Be?

When Salesforce says your instance uses 4.2GB of table space and 100.8GB of file space, how much space should you allocate for your CopyStorm Salesforce backup database?

This is a harder question than it appears because Salesforce computes used space differently than databases. This article describes Capstorm’s guidelines for computing space requirements for CopyStorm databases.

Space Hogs Salesforce Does Not Count

Salesforce does not appear to count the cost of indexes when it reports used space. The space used by indexes can add up quickly in a relational database. For example, on SQL/Server we have learned:

  • The core indexes CopyStorm needs to work incrementally plus the primary key index take around 15.25MB per 100,000 table rows.

  • Each index on a reference field takes around 4.3MB per 100,000 table rows.

In practice, nearly all Salesforce tables contain at least two reference fields (CreatedById and LastModifiedById), and many also contain OwnerId. It is not uncommon for a table to contain 10 or more reference fields.

In summary, for every 100,000 rows you can expect to need at least this much space for indexes where is always at least 3 and usually much larger:

  • 15.25M + *4.3MB

Once CopyStorm has built a schema and before any data has been copied, you can guess the amount of space required for indexes with a bit of SQL. Note: In each example, you must substitute “NumberOfRows” with the actual number of rows in Salesforce.

  • SQL/Server: SELECT ((SELECT (15.24 + (4.12*COUNT(*))) FROM CopyForceTableField WHERE tableName=’Account’ and fieldType=’reference’)*(NumberOfRows)/100000.0)

  • Oracle: SELECT ((SELECT (15.24 + (4.12*COUNT(*))) FROM CopyForceTableField WHERE tableName=’Account’ and fieldType=’reference’)*(NumberOfRows)/100000.0) FROM DUAL

  • PostgreSQL: SELECT ((SELECT (15.24 + (4.12*COUNT(*))) FROM CopyForceTableField WHERE tableName=’Account’ and fieldType=’reference’)*(NumberOfRows)/100000.0)

  • MySQL: SELECT ((SELECT (15.24 + (4.12*COUNT(*))) FROM CopyForceTableField WHERE tableName=’Account’ and fieldType=’reference’)*(NumberOfRows)/100000.0

Any table with a BASE64 column (for example, Attachment and ContentVersion) seem to report much less space usage in Salesforce than in a target database. Often 3-4x more space is needed in a relational database than what is reported in Salesforce.

We have never seen a case where 5x the size reported by Salesforce is too small but this may be overkill for your case. In most cases sizing the Salesforce backup database to be 4x the size of your file storage and 2x the size of your data storage will be sufficient.

Tables With Mysterious Sizes

Just Tell Me How Big to Size My Database

What are the Minimum CopyStorm Salesforce Permissions?

The minimum Salesforce backup permissions needed for CopyStorm to copy data from Salesforce to a database are:

  • API Enabled

  • View Setup and Configuration

Almost all of the time, the following permissions should be granted:

  • View All Data — this permission bypasses sharing rules and often increases performance.

  • Read Encrypted Data — this permissions returns the plain text value for encrypted fields.

  • Query All Files — this permission allows files in private folders to be read.

  • Knowledge User — this license allows draft knowledge articles to be read.

There are also several tables that have a restricted syntax, and will not be backed up unless the Salesforce user is an administrator. These tables include:

  • NewsFeed

  • EntitySubscription

If the source Salesforce instance uses Chatter, or has the Chatter setting “Enable Unlisted Groups” feature enabled, the following permissions should be granted:

  • Manage Unlisted Groups — this permission bypasses Unlisted Groups access checks for Feed records.

In the scenario where “Forecasting” objects such as “ForecastingQuota” are desired to be backed up and optionally restored, the following user permission is required:

  • Allow Forecasting — this permission grants a user the ability to access and utilize the forecasting features within Salesforce.

Many people assume that a Salesforce Administrator automatically has permission to access all data. Wrong! Even some core Salesforce tables and fields are hidden from administrators by default. Fortunately, the tool will find all tables and fields inaccessible for any Salesforce user with the permissions API Enabled and View Setup and Configuration.

A Wrong Assumption

CopyStorm/Medic Permission Checker

Help! I Am Getting a Certificate Error (PKIX Path)

If your site is using a self-signed certificate to establish SSL (HTTPS) connections you may see an error like the following when attempting to connect to Salesforce:

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
                at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
                at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
                at sun.security.validator.Validator.validate(Unknown Source)
                at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
                at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
                at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
                ... 26 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
                at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
                at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
                at java.security.cert.CertPathBuilder.build(Unknown Source)
                ... 32 more

This type of error typically means that your network is using a self-signed certificate. To make CopyStorm (or any other Java based application) work with your certificate, you must add the certificate to Java’s trusted store file “cacerts”.

To automatically add the certificate

  • Open the “Help” menu in the top left of the application GUI and select the “Load Network Certificates” option:

  • This will open the “Certificate Viewer” popup where you can view, approve, or export the necessary certificates:

  • Approve the certificates by clicking the “Approve” button. This will create a keystore file called “CapStormKeyStore.jks” in the OR the current user’s home directory that will contain the approved certificates. CapStorm applications will use this keystore file for SSL traffic.

  • Get a copy of your certificate.

    • This will be a CER or CRT file (example: mycompany.crt).

  • Copy the certificate to the certificate directory in your CopyStorm installation:

    • [CopyStormRoot]/jre/lib/security

If your environment requires that multiple certificates be installed, you will need to import each certificate using a unique alias:

  • ....\bin\keytool -import -keystore cacerts -file firstcertificate.crt -alias firstcertificate

  • ....\bin\keytool -import -keystore cacerts -file secondcertificate.crt -alias secondcertificate

If you have encountered this problem, it is better in the long run to use a “cacerts” file for a Java runtime that is installed globally on your computer. The procedure is the same, but the “cacerts” file is in a different location. If you take this approach then remove the “jre” directory from CopyStorm and the application will use the system default Java.

Here is a with more details — please reference it if you need more help.

Navigate to the certificate directory in a shell (Linux) or command prompt (Windows) and run the command:

  • ....\bin\keytool -import -keystore cacerts -file mycompany.crt

  • The tool will ask you for a password. It is “changeit”.

  • You’re done! CopyStorm will now connect to Salesforce without a PKIX error.

  • To manually add the certificate

    best practice setup CapstormConfig directory
    great article

    Why is My Batch File Not Sending Email?

    While the CopyStorm Batch File can be configured to send email, the best practice is generally to use CopyStorm’s built-in notification settings.


    The CopyStorm Batch File tab will generate a script that is useful for running CopyStorm in batch mode. Although the script generator asks for email addresses to notify on CopyStorm success and failure, some installation configurations may cause the generated script to not successfully send a Salesforce backup notification email.

    The Batch File tab will generate scripts in a variety of languages. Some of these languages have a built-in way to send email in an operating system independent way, but some do not. When a scripting language (like BAT) does not have a built-in way to send an email then it is the responsibility of the script to implement the behavior.

    See the following sections for help with each batch script type.

    Hints On Using a Generated BAT File

    There is no standard way to send an email from a Windows BAT file, and CopyStorm does not try to guess the technique used by your organization. Generated BAT scripts isolate the “email sending” code to a small subroutine that must be implemented according to your company standard. At the end of a BAT script generated by CopyStorm you will see code that looks like:

    :SendEmail REM REM Code your site specific email rule procedure here. REM REM %1 is the email subject REM %2 is the email address that should receive the mail REM %3 is a file containing the body of the email REM

    ECHO TODO: Send email to %2 with subject %1 EXIT /B

    This code is a subroutine that the script will call each time it attempts to send a Salesforce backup notification email. To finish the script, you need to implement your organization’s email sending logic. BAT file emailing is accomplished using a number of techniques, varying by organization:

    • Copying the log file to a directory using a name that indicates when the job completed.

    • Using the open source tool to email the status.

    The following screenshot indicates where the script changes must be made:

    Windows VBS has a built-in way to send an email if the name of an email server is specified. The default email server is GOING TO BE WRONG all of the time, and CopyStorm has no way to guess the correct server. The aspmx.l.google.com server name must be replaced by the name of your company’s email server.

    • aspmx.l.google.com is a well-known server that will process email addressed to gmail accounts.

    The following screenshot indicates the values that must be changed to match your environment:

    The rules for using a BASH script are the same as those for a VBS script — two values must be changed before generating the script:

    • EMail Server

    • EMail From

    See the screenshot under the VBS section above for an example.

    The rules for using a Python script are the same as those for a VBS script — two values must be changed before generating the script:

    • EMail Server

    • EMail From

    See the screenshot under the VBS section above for an example.

    Hints On Using a Generated VBS Script

    Hints On Using a Generated BASH Script

    Hints On Using a Generated Python Script

    BLAT