Sandbox refresh strategy is important considering there could development work that could be in the Sandboxes and be lost. Also refreshing sandboxes could also result production data be available in Sandboxes which you may want to mask before it being available.

Org Structure and Naming Convention:

We should know how identify each org and how many Sandboxes should we typically require.

  • Production
  • UAT<Followed By Some Identifier (optional)> Full-Copy Sandbox if not available then go for Partial Copy Sandbox
  • Stage<Followed By Some Identifier (optional)> Full-Copy Sandbox if not available then go for Partial Copy Sandbox and if that too is consumed then go for a Developer Sandbox
  • Test / QA Environment Partial Copy Sandbox and if that is consumed for UAT then go for a Developer Sandbox
  • Developer Sandboxes <Each developer gets a Sandbox  | a shared sandbox for development> Developer Sandbox

Refresh Lifecycle:

  1. Planning
  2. Notification
  3. Confirmation
  4. Execution
  5. Preparation
  6. Use

Planning:

   During the planning stage we intend to strategize the initiation of the refresh of the Sandbox. This would require internal talks with stakeholders to prepare any ToGoLive items in the concerned Sandbox. 

TaskOutcome (Sample)OwnerDue DateCompleted?Completed on
Identify the person that would be owning the Activity Mike to Lead the ActivityChris10/10/21 10:00 AM PSTNo
Identify the Sandboxes to refreshUAT, Stage, AekotDevMatt10/10/21 10:00 AM PSTNo
Backup of Metadata via full package retrieve into a branch on git repository.Committed UAT to backup/uat-10-21-21Deb10/10/21 10:00 AM PSTNo
Get a confirmation List of the Objects/Records to be copied to the sandbox? (applicable to Partial-Sandbox)44 Object-Records to be copied from Production to SandboxRoger10/10/21 10:00 AM PSTNo
Document Integration Endpoints to configure in Different sandboxes post refreshDocument with Post refresh metadata changes is made availableSam10/10/21 10:00 AM PSTNo

Other Configurations to consider early on for Post-Deployment readiness

Outline each for every sandbox

  • Integration Endpoints (if applicable)
  • SSO Configurations (if applicable)
  • Email Deliverability (turn off immediately after refresh) – (turn on after things are setup)
  • Users to be enabled (list of users whose email needs to updated)
  • Users to be added (list of new members which are required to be added to the sandbox)
  • Apex Jobs to be scheduled 
  • Reports to be scheduled
  • Data to be masked
  • Named Credentials Sign-on (if applicable)
  • Data to be migrated/reconfigured (e.g Custom Settings, Custom meta-data)
  • Remote Site Settings
  • Managed Package Configuration (If Applicable)

Notification:

Notify the plan with a detailed date time and plan for the activity to the stakeholders.

This should be a time based email sent after regular intervals(One month before to every week and in the last few days daily). Also notify them about the tentative downtime.

Confirmation:

Receive a confirmation from all stakeholders in over an email or over a short survey before initiating the refresh for the final time. Based on the survey response, decide the go/no-go with the refresh of the Sandbox.

Execute:

Data-model changes happen often in the Production environment which could be due any reason like:

  • Package Installation
  • Continuous Development

So it is a good idea to update your Object Template before a refresh. Can be considered as a must for Partial Copy Sandbox and Optional for Full-Copy Sandbox refresh. This helps to bring in the relevant data into the refreshed sandboxes. Also consider that Full-Copy Sandboxes are paid Sandboxes and have a refresh interval of 29 days. So a mistake could end up impacting things and how the setup is done for the sandbox.

Post-Refresh Preparation ():

It is recommended to have a checklist of items/activities that need to be accomplished post the refresh of the sandboxes. This helps to ensure that all configurations are in accordance with the environment. Also, a lot of these could be automated based on the devOps practices or via apex-script. In either case 

TaskDetailsApplicable OrgAssigneeStatus
Disable Email DeliverabilityNavigate to Setup>Email>Deliverability>”None”Stage, UAT, QA
Configure Remote Site SettingRemote-Site-Settings-MappingStage, UAT, QA, Developer
Import / Configure Custom SettingsCustom Setting ValuesStage, UAT, Developer
Configure Custom MetadataCustom-Metadata-SettingsStage, UAT, Developer
Mask- Critical DataExecute the following-StepsStage, UAT
Re-configure Auth ProvidersExecute the following-StepsUAT, QA
Re-configure Named CredentialsExecute the following-StepsUAT, QA
Schedule following jobsExecute the following-StepsUAT, QA
Update any Org Specific DocumentExecute the following-StepsUAT, QA
Update Connected Apps to facilitate inbound integrationsExecute the following-StepsUAT, QA
Enable Email DeliverabilityNavigate to Setup>Email>Deliverability>”All Emails”UAT, QA
Add Org Specific UsersCreate / Import following UsersUAT, QA
Correct applicable Existing user emailUpdate / Import following UsersUAT, QA

Notify:

    Send an official confirmation to the users. Which would provide a green signal for them to log into the respective sandboxes and start to use them in the desired manner.