All pages
1 of 8

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Best Practices

Optimizing CopyStorm/Restore Performance

Though CopyStorm/Restore provides good performance with its default settings, there are a few best practices to achieve optimal performance.

Index Your CopyStorm Database

To determine which records should be restored, CopyStorm/Restore performs a lot of reference field lookups on its CopyStorm database. If reference fields in the CopyStorm database are not indexed performance can be greatly impacted. To add all the necessary indexes to the CopyStorm database:

  • On the CopyStorm Configuration tab make sure that the Create Indexes option is checked.

  • Run CopyStorm to automatically create any missing indexes.

Store Your Tracker Database On a Local Disk

CopyStorm/Restore tracks the progress of a restore using a small-footprint database called a “Tracker Database”. This database is named on the Global Parameters tab and, by default, is stored in the directory $HOME/.capstorm/copyStormRestoreSets. If your home directory is not on a local disk, performance can be improved by changing the tracker database location to a location stored on local disk. For example

  • If the tracker database is “fred” then it will be stored at:

    • $HOME/.capstorm/copyStormRestoreSets/fred.mv.db

  • If the tracker database is C:\tmp\fred then it will be stored at C:\tmp\fred.mv.db

If the location already contains a tracker database, the pre-existing one will be used. If not, CopyStorm/Restore will automatically create a new one.

To upload data to Salesforce, CopyStorm/Restore uses 1-10 virtual data entry clerks (also called Salesforce Writers). Each Salesforce Writer enters data into Salesforce concurrently. In addition to the number of Salesforce Writers, the amount of work given to each writer in a single batch can be controlled to increase performance.

There are two parameters on the Global Parameters tab which control the level of parallelism:

  • The “Default Max Per Update” parameter controls the amount of work given to a single Salesforce Writer.

    • This parameter defaults to 200 but a value of up to 600 can often improve performance.

  • The “# Salesforce Writers” parameter controls the number of concurrent threads used to write to Salesforce.

    • This parameter can range from 1 to 10.

Values for these parameters that work best for you depend on several factors:

  • The speed of your internet connection to Salesforce. This is the most important factor.

  • Salesforce limits the number of active update requests per Salesforce login for your entire Organization.

    • Running too many restores at the same time can cause this limit to be hit.

    • This issue has been observed when a customer was running three separate restores concurrently where each restore used the same Salesforce credentials and 10 concurrent threads.

In Capstorm’s test labs we typically use values of:

  • Default Max Per Update = 400

  • Salesforce Writers = 10

High parallelism parameters can, under certain circumstances, degrade restore performance. This has been observed when restoring to a table with a computed column involving aggregation of data from another table. If this happens:

  • CopyStorm/Restore will still work but may have to make multiple restore requests for the same batch of records.

    • This happens internally in the program and the only visible effect is on restore performance.

  • CopyStorm/Restore will automatically lower the level of parallelism on a table when it is causing restore performance issues.

  • The level of parallelism can also be controlled for a specific table by setting table specific parameters on the Restore Set Editor tab.

Higher values increase the level of parallelism (i.e. number of virtual data clerks) but also increases the load on your network.

More concurrent threads take more system memory. This is unlikely to be an issue on a 64-bit system but is something to consider.

  • The performance of your database can be a factor but rarely causes issues.

  • Table specific parameters override global defaults.

    Increase CopyStorm/Restore Parallelism

    Create Copystorm Indexes

    CopyStorm/Restore will perform parent/child record analysis much faster if the CopyStorm database foreign keys are fully indexed.

    To create the necessary indexes, check the on CopyStorm’s Configuration tab and rerun CopyStorm.

    CopyStorm/Restore will still work without indexes but the analysis required to determine the order in which records must be restored will be much slower. For databases with millions of rows the performance is likely to be unbearable. This is because CopyStorm/Restore needs to do a lot of table scans by running queries like:

    • SELECT id FROM Contact WHERE accountId IN (….)

    These will cause the entire Contact table to be scanned (an Order(n) operation). After creating the indexes, each lookup is an Order(1) operation (e.g. 1000s of times faster).

    What Happens if Indexes Are Not Created?

    “Create Indexes” checkbox

    Knowledge Recovery

    This section explains the best practices for recovering and restoring Salesforce Knowledge base using CapStorm/Restore. Because Knowledge is a uniquely complex object with strict rules, these articles provide a detailed look at CapStorm’s specialized restore process.

    Related Articles

    • The Knowledge Article Restore Lifecycle — an overview of the three-phase process (Draft, Online, Archive) that CapStorm follows to safely restore Knowledge articles, including important considerations to know before starting.

    • How CapStorm Handles Master Language and Translations — an explanation of the specific rules and automated processes CapStorm uses to correctly restore a multilingual Knowledge base, ensuring master articles and their translations are handled in the proper order.

    • Advanced Knowledge Parameters — a guide to the advanced settings available for Knowledge recovery, explaining what options like “One Version Per Push” do and the best-practice scenarios for using them.

    Advanced Knowledge Parameters

    CapStorm provides several powerful settings for Knowledge restores, found under the Additional Knowledge__kav Parameters section of the __kav table. Understanding these options gives maximum safety and control over the restore process.

    One Version Per Push Setting

    This setting helps ensure a safe and successful restore of complex Knowledge articles. When enabled, CapStorm will only restore a single version of any specific Knowledge article each time you run a restore job. This setting is important for Archived or Online Knowledge Article Versions that have related files (or other related objects).

    How it Works

    If there is an article with three versions, the restore job would need to be run three times to restore its full history. This will cause the first version to be pushed by the first job (along with related records), then the second version by the second job (with related records), etc… The process will also handle translations separately, restoring the master version in one run and its translations in another.

    Why This Setting Should Be Used

    The main reason to use this setting is to keep the newest article version in an editable Draft state for as long as possible. Once an article is published as Online, it becomes read-only, which can cause two common problems:

    1. Linking Files: Files cannot be attached to a published article. One Version Per Push restores the article as a Draft, giving an opportunity to run another restore job to link file attachments (ContentDocumentLink records) before the article is published.

    2. Populating Lookups: If the article has lookup fields to other records, this setting allows those other records to be restored first and correctly linked to the draft. If the article were published immediately, there is no option to go back and update the lookup fields if they were initially blank.

    By keeping the article in a Draft state, this setting ensures all related data can be restored and linked correctly, preserving data integrity.

    This setting is a checkbox located in the Restore Set Editor under the Migration Setup tab when __kav table is selected.

    These two settings work together to fix articles that may have been left in a Draft state from a previous, incomplete restore job.

    This setting is a cleanup tool. Before the main restore begins, it searches the Salesforce org for any Knowledge articles that are still Drafts but should be Online or Archived (according to the backup) and attempts to publish them.

    Use with Caution: Before using this option, it’s a good practice to investigate why the previous job failed. If the failure happened before the article’s content was updated, using this option might publish an incomplete draft or a draft that is a duplicate of the previous version.

    This setting gives stricter control over the cleanup process and is only available when “Publish Drafts Before Restore” is checked.

    • What it does: If this box is checked and CapStorm encounters any error while trying to publish the old drafts, the entire restore job will stop immediately.

    • Why it’s important: If the cleanup process fails and the job continues, the new restore might overwrite the failed draft with the next version’s content. This could cause a version to be skipped, leading to an incomplete and incorrect article history. This setting prevents that from happening.

    How CopyStorm/Restore Handles Translations

    When Salesforce Knowledge is used in multiple languages, there are “master language” articles and “translations.” Salesforce has very strict rules about how these articles must be handled. The CopyStorm restore process is designed to follow these rules automatically to ensure a multilingual Knowledge Base is restored correctly

    The Restore Order: Masters First

    The most important rule is that for any article version, the master language article is always restored before its translations. CopyStorm’s process identifies the master article and ensures it is restored first.

    For example, the restore will happen in this order:

    1. First, it restores Version 5 of the English master article: “How to Reset Your Password.”

    2. Next, it restores the translations of Version 5, such as “Cómo Restablecer su Contraseña” (Spanish) and “Wie Sie Ihr Passwort zurücksetzen” (German).

    3. Finally, it promotes the master language and translations to Online or Archived, depending on the status of the article in the CopyStorm database.

    This order is necessary because a translation cannot be correctly published in Salesforce until its master version already exists.

    Salesforce has another rule: a translation cannot be published if its master article has a new Draft version in progress. CopyStorm’s smart sorting process handles this by making sure the current Online master version and its translations are restored before it tries to restore a new Draft of that same master article. This keeps the parent article in a stable Online state so its children translations can be published without errors.

    Translations do not need to be archived one by one. Salesforce simplifies this process.

    When a master language article is archived, Salesforce automatically archives all of its published translations at the same time.

    CopyStorm’s restore process uses this behavior. The final “archiving” phase of the restore job focuses only on archiving the master articles. CopyStorm correctly sets the master article’s status to Archived and relies on Salesforce to then handle the connected translations.

    By following these strict ordering and archiving rules, CopyStorm ensures that master articles and all their translations are restored with their relationships intact.

    The Knowledge Article Restore Lifecycle

    This article describes the default behavior for restoring Knowledge articles and article versions when the One Version Per Push setting is turned off. The process works in batches, grouped by version number (e.g., CopyStorm/Restore restores all Version 1s, then all Version 2s, and so on).

    Before restoring anything, CapStorm looks at all the article versions selected for recovery and sorts them into a very specific order. This “smart selection” prevents errors. The order of importance is:

    1. Archived Articles First: It deals with the oldest, completed versions first to get them out of the way.

    2. Online Articles Next: These are the active, published versions.

    Restore Record Ownership and Salesforce Audit Fields

    Restoring proper record ownership when restoring historical data can be a complex operation for several reasons:

    • By default, Salesforce does not permit an inactive user to be the owner of a record.

    • When migrating data from another Salesforce instance, the record owner probably does not exist in the target Salesforce.

    While discussing how to manage these issues, this article will also cover a related problem:

    • How to restore original Salesforce audit fields like CreatedDate

    Publishing Translations

    Archiving Translations

    How to Enable it

    Pre-Restore Cleanup Parameters

    Publish Drafts Before Restore Setting

    Halt on Pre-Restore Failure Setting

    and
    LastModifiedDate
    .

    By default, not even a Salesforce administrator has the privileges necessary to assign an inactive Salesforce user as the owner of a record. However, any user can be granted this ability by:

    • Creating a Permission Set that includes the Salesforce system permission “Update Records with Inactive Owners”.

    • Associating the new Permission Set with a Salesforce user account.

    CopyStorm/Restore will recognize that its connection to Salesforce has this elevated permission and do the right thing. If you need additional help, see the Salesforce release notes that introduced this feature.

    This problem most often occurs during a Salesforce migration project. For example, suppose that the Acme company purchased the Dynamo company and the Salesforce team has been told to migrate all data from Dynamo’s Salesforce into the Acme Salesforce.

    • The CopyStorm backup of the Dynamo database contains a record owner named “josiah@dynamo.com”

    • In the Acme Salesforce, “josiah@dynamo.com” will be replaced by the new Salesforce user “josiah@acme.com”.

    During the data migration all records owned by josiah@dynamo.com should be transferred to josiah@acme.com once all Dynamo data has been migrated to the Acme Salesforce.

    The best practice to address this issue is to create a migration mapping for Users in the CopyStorm/Restore Migration Setup tab. By using the Record Mapping Rule Editor on this tab you can explicitly tell CopyStorm/Restore how to map users in the Dynamo database to users in the target Acme Salesforce. For details see these articles:

    • CopyStorm/Restore Migration Tools

    • CopyStorm/Restore Record Mapping Rule Editor

    By default, not even a Salesforce administrator can write to the standard Salesforce audit fields, including:

    • CreatedById

    • CreatedDate

    • LastModifiedById

    • LastModifiedDate

    If you need to restore these fields:

    • Create a Permission Set including the Salesforce system permission “Set Audit Fields upon Record Creation”.

    • Associate the new Permission Set with a Salesforce user account.

    CopyStorm/Restore will recognize that its connection to Salesforce has this elevated permission and do the right thing (e.g. restore audit fields).

    In addition to the audit fields detailed in #3 above, restoring the “CreatedBy” and “CreatedDate” fields for Chatter Feeds requires an additional permission.

    If you need to restore these fields:

    • Create a Permission Set including the Salesforce system permission “Insert System Field Values for Chatter Feeds”.

    • Associate the new Permission Set with a Salesforce user account.

    CopyStorm/Restore will recognize that its connection to Salesforce has this elevated permission and do the right thing (e.g. restore audit fields).

    Problem 1: Make Inactive Users Own Restored Records

    Problem 2: Control Record Ownership When Users Do Not Exist in the Target Salesforce

    Problem 3: Restore Salesforce Audit Fields

    Problem 4: Restore Salesforce Audit Fields In Chatter

    Drafts Last: Finally, it handles any unfinished drafts.

    Within each of these groups, it follows another important rule: Master language articles always go before their translations. Original articles must be restored before their Spanish or German versions can be added.

    No matter what an article’s status was in the backup—even if it was Archived or Online—CapStorm will always create it as a Draft in the new Salesforce org. This is a rule from Salesforce that CapStorm follows carefully.

    After this phase, there is a collection of new Draft articles, all sorted and created in the right order.

    Right after a new Draft article is created, CapStorm immediately checks its original status from a backup.

    If the article was originally Online or Archived, this phase changes its status from Draft to Online.

    Every article has to pass through the Online state before it can be archived.

    So, at the end of this phase, all the articles that need to be restored are now sitting in an Online state in Salesforce.

    This phase is the final cleanup crew for the entire restore job. It only begins after every other record for every table has been restored.

    The main reason CapStorm waits to archive articles is to protect translations and different versions of the same article.

    Here’s how it works:

    1. Wait Until the End: At the very end of the job, this process scans for any articles that are currently Online in Salesforce but should be Archived.

    2. Perform a Safety Check: Before archiving an article, it does one final, important check. It looks back at a CopyStorm backup to see if there are any other versions of that same article that haven’t been restored yet.

    3. Archive or Wait: If all versions have been restored, it safely changes the status from Online to Archived. If it finds that other versions are still waiting to be restored (perhaps in a future job), it will leave the article Online to avoid causing problems.

    After this final phase, the Knowledge Base now correctly matches the state of the backup. Online articles are online, and Archived articles are archived, with all their translations and versions correctly linked.

    This careful, three-phase process ensures that even something as complex as Salesforce Knowledge is restored safely and accurately every time.

    When the setting, “One Version Per Push” is enabled, the restore lifecycle becomes simpler, and the “Final Archiving” phase described above is no longer needed.

    With this setting on, the archiving process happens automatically and sequentially. When CapStorm creates a new version (e.g., Version 2) from the currently online version (Version 1), the Salesforce method it uses automatically archives the previous version (Version 1) as part of the action.

    In this mode, archiving is handled one version at a time with each step, rather than all at once at the very end of the job.

    Here are a few things to keep in mind when restoring Knowledge articles:

    • “Unpublish Article” in History: When CapStorm creates a new version of an article, it uses a specific Salesforce method that supports translations. A side effect is that there may be an “Unpublish Article” entry in the new version’s history. This is expected and is a result of the method required to maintain translation relationships.

    • Deleting Drafts Can Be Risky: Be very careful if Draft versions of an article are manually deleted in Salesforce. If there is no currently Online version of that article (i.e., all other versions are Archived), Salesforce will delete the entire article and all its versions. This is a Salesforce platform behavior.

    • Batching Articles with Different Owners: If a batch of articles are being restored that have different owners, it may result in a generic “unknown exception” from Salesforce. To resolve this, there are two options:

      1. Go to the “Advanced Parameters” for the __kav table in the restore job and set the Batch Size to 1.

      2. Ensure that all articles being restored in a batch share the same owner.

    • Links in Rich Text Fields: If articles contain rich text fields that link to other Knowledge articles, those links may be broken on the first version that is restored. This is because the process that fixes links runs before the records are inserted, so it cannot see other new articles that don’t exist yet. The links should be corrected as subsequent versions are restored.

    • Images in Rich Text Fields: If a rich text field contains an image that fails to process for any reason, Salesforce may delete the image and all text that comes after it in that field.

    • More on

    The Standard Restore Process

    Phase 1: Smart Selection & Draft Creation

    Smart Selection

    Draft Creation

    Phase 2: Publishing to ‘Online’

    Phase 3: Final Archiving

    How the Process Changes with “One Version Per Push”

    Important Considerations

    Rich Text Fields