All pages
1 of 4

Loading...

Loading...

Loading...

Loading...

Common Tasks

Populating a Developer Sandbox With Production Data

CopyStorm/Restore makes populating a Developer Sandbox with production data a painless operation. This article provides a guide for how to do this for your operation.

Prerequisites

  • A CopyStorm backup of your production Salesforce data.

  • A Salesforce developer Sandbox.

Step 1: Determine What Type of Records Should Drive the Restore

This step will determine the type and volume of data that will be restored to the Sandbox. This step is both important and non-optional due to fairly severe size restrictions on Developer Sandboxes. It is highly unlikely that you will be able to import your entire production data set.

The choice of what types of records to restore depends on what you plan to do with the Sandbox. Records are often selected based on criteria like:

  • Choose 500 random Accounts.

  • Choose 100 Contacts that have open Cases.

  • Choose the top 100 Opportunities in the current quarter.

  • Choose all Accounts from the list of Ids in the file ABC.txt.

  • Choose all Contacts from a list of Ids pasted into CopyStorm/Restore.

  • Choose 100 Accounts that have at least one record in my custom object.

  • Choose 250 random My_Custom_Object__c records.

To learn more about selecting records see the reference manual selection on .

In this video we will select 100 random Accounts along with any related Contacts and Opportunities. The data will be restored to an empty Salesforce Developer Sandbox.

Step 2: Watch This Video Tutorial

Record Selectors

Restoring Salesforce Metadata

The following video demonstrates how to restore metadata to Salesforce with CopyStorm/Restore:

Metadata Restore Overview

Restoring metadata using CopyStorm/Restore is a simple point-and-click process — this can be used to:

  • Promote code, permissions, or other metadata changes from Sandbox environments to Production.

  • Roll-back metadata to previous versions if metadata has been incorrectly updated in Production.

All versions that have been backed up with CopyStorm are available to restore, providing an easy way to undo changes to metadata or migrate metadata between environments. CopyStorm/Restore can upload or roll back changes to dozens of metadata types, including:

  • Apex Classes, Pages, and Triggers.

  • Permission Sets, Profiles, Roles, and Groups.

  • Custom Objects, Page Layouts, and Translations.

To restore metadata to Salesforce with CopyStorm/Restore:

CopyStorm/Restore’s provides an easy way to surgically upload new or modified metadata from the CopyStorm backup database into Salesforce.

Selected metadata will be uploaded to Salesforce – select part of a metadata item, or upload the full item to Salesforce.

The Version selector allows historical versions of the metadata item to be uploaded, updating Salesforce with the version of the metadata as of the selected date and time. Uploading a historical version is a simple way to revert changes and undo metadata modifications that are causing problems in production or sandbox Salesforce instances.

Deploying the selected metadata is as easy as pressing the , CopyStorm/Restore will handle the rest! After pressing the and confirming the upload, CopyStorm/Restore will:

  1. Create a zip file containing the selected metadata items (and versions).

  2. Upload the zip file to Salesforce’s Metadata deployment API.

  3. Display the results of the upload.

Incrementally Adding Records to a Sandbox

CopyStorm/Restore allows you to incrementally restore records to a Salesforce sandbox. This article will show you how.

The Process

If you do not want to know how CopyStorm/Restore works, this is the only section you need to read. The instructions are:

  1. Open the configuration file used by CopyStorm/Restore during the original restore.

  2. Go to the Restore Set Editor tab and modify or add rules that control which records should be restored.

  3. Go to the Restore tab and click on the “Re-scan Candidates” button.

    1. CopyStorm/Restore will re-process the restore rules and look for additional candidates to restore.

  4. Click on the “Resume Restore” button.

    1. Records previously restored will be skipped.

    2. New candidates will be restored.

That’s it! You can repeat this recipe as often as you like to add new records to Salesforce.

CopyStorm/Restore keeps track of what needs to be restored and what has already been restored in a local H2 database.

  • The name of the database is found on the Global Parameters tab in the “Tracker Database Name” field.

    • The default name is generated by the application and unique to the configuration file.

    • It can be changed to any name desired.

  • The H2 database is stored in the directory:

The first step of any restore is to scan the CopyStorm backup database for records matching the rules in the Restore Set. As candidates are found new records are created in the CopyStorm/Restore tracking database.

The second restore step involves:

  • Finding all records in the tracking database that have not been restored.

  • Restoring records and recording their corresponding Salesforce Ids in the tracker database.

    • If the restore modified a Salesforce record, the Id will be the same as the tracker Id.

    • If the restore added a new record to Salesforce, the restored Id and tracker Ids will be different.

Clicking on the “Re-scan Candidates” button causes CopyStorm/Restore to look for new restore candidates and put them into the tracker database.

The tricky part of this process is figuring out which records to restore and the order in which to restore them — a fundamental graph theory problem that our CTO is happy to talk about any time over a beer.

$HOME/.capstorm/copyStormRestoreSets

  • The H2 database tracks the mapping of a record’s ID in the CopyStorm backup to the unique ID assigned by Salesforce while restoring.

  • How It Works

    Go to CopyStorm/Restore's Metadata Tab

    Select the Metadata to Restore

    Deploy Selected Metadata to Salesforce

    Metadata Tab
    Deploy button
    Deploy button