Refreshing a Sandbox from a Production Org


Refreshing a sandbox from production is a good practice that keeps both environments aligned. When a sandbox is refreshed, it synchronizes settings and metadata with production, and if the sandbox is a full or partial copy, records are synchronized, too. This allows for development and testing to be done in an up-to-date environment to reduce the risk of issues occurring when the changes are migrated into production. 

 

This page is for users who already have Overcast installed in their production org.

 

Refreshing a Sandbox

In order to refresh a sandbox, you must navigate to Setup > Quick Find and search for Sandboxes. Once there, you can select the Refresh action beside the target sandbox. Click here for the Salesforce documentation on sandbox refreshing.

Full and Partial Copy Sandboxes

Select all the Overcast package custom objects to include in the data copy so all Overcast Scenarios and configurations are retained.

Developer Sandbox

No data is copied.

Refresh Sandbox Options

Overcast provides an Apex class that performs some package setup work.

In the Sandbox Options screen, which appears after clicking Next, enter into the Apex Class text box overcast.SandboxCloneScript.

If you already have a class you intend to run here, add the following code snippet to your class:

void runApexClass(SandboxContext context) {
    ...
    overcast.SandboxCloneScript overcastScript = new overcast.SandboxCloneScript();
    overcastScript.runApexClass(context);
}

overcast.SandboxCloneScript performs the following operations

  1. Runs the post package install operations.
  2. Removes passwords from all connection strings because they are targeting production systems.
  3. Sets all scenarios to a non-activated state.

 

Post-Refresh Steps

If you do not specify overcast.SandboxCloneScript in the refresh options, it is recommended to execute it manually in the sandbox.

Open the Developer Console and execute the following code:

overcast.SandboxCloneScript overcastScript = new overcast.SandboxCloneScript();
overcastScript.runApexClass(null);

Post-Refresh Steps for a Developer Sandbox

  1. Update Overcast settings

    1. Change the Overcast endpoint to the (Sandbox) variant.
    2. Set the global log level to Info or higher.
    3. Download and install a secure agent, if required.
  2. Create the Salesforce Job connection string with the sandbox's administrator account credentials.
  3. Create all the backend system connection strings with the development environment hostnames and credentials.
  4. Migrate any required integration scenarios from production (or another sandbox) using the Scenario Migration Tool.

Post-Refresh Steps for a Full or Partial Sandbox

  1. Update Overcast settings

    1. Change the Overcast endpoint to the (Sandbox) variant.
    2. Set the global log level to Info or higher.
    3. Download and install a secure agent, if required.
  2. Update the Salesforce Job connection string with the sandbox's administrator account credentials.
  3. Update all of the backend system connection strings with the development environment hostnames and credentials.
  4. Re-activate all scenarios. Edit each scenario and click Save & Activate.