You cannot directly refresh a Salesforce sandbox from another sandbox. Sandbox refreshes are initiated exclusively from your production Salesforce organization's Setup menu.
Understanding Salesforce Sandbox Refresh
Refreshing a sandbox means updating its data and metadata to match your production organization. This process ensures your development, testing, and training environments are up-to-date with the latest configurations and data from your live system. It's a critical step in maintaining accurate and effective development and testing cycles.
Why You Can't Refresh from Another Sandbox
The core purpose of a sandbox refresh is to replicate your production environment. Therefore, the refresh operation must be initiated from the production org itself, as it's the source of the data and metadata being copied. Sandboxes are isolated environments and do not have the capability to initiate a refresh of another sandbox or themselves directly from within their own instance.
Steps to Refresh a Salesforce Sandbox (from Production)
To refresh a Salesforce sandbox, you must log into your production organization. Here's the standard process:
- Access Setup: In your production Salesforce organization, navigate to Setup.
- Find Sandboxes: In the Quick Find box, type
Sandboxes
and then select Sandboxes under Environments. - Initiate Refresh: Locate the name of the sandbox you wish to refresh from the list. Next to its name, click Refresh.
- Review and Confirm:
- Review the sandbox name and description. You can edit them if necessary.
- Select the type of refresh you want to perform (e.g., Full, Partial Copy, Developer Pro, Developer). This choice impacts the data copied and the refresh frequency.
- Crucially, understand that refreshing a sandbox permanently deletes its existing data and metadata, replacing them with a fresh copy from production.
- Click Refresh again to confirm.
After initiation, the refresh process begins. Depending on the type of sandbox and the amount of data, this can take anywhere from a few minutes to several days. Salesforce will send an email notification when the refresh is complete, and the sandbox is ready for activation.
Types of Sandboxes and Refresh Frequencies
Salesforce offers different types of sandboxes, each with varying storage capacities, data inclusion, and refresh intervals. Understanding these differences is crucial for effective development and testing strategies.
Sandbox Type | Data Included | Metadata Included | Refresh Interval | Common Use Cases |
---|---|---|---|---|
Developer | Empty (allows metadata changes only) | Yes | Once a day | Development, isolated unit testing |
Developer Pro | Empty (larger storage for metadata changes) | Yes | Once a day | Larger development projects, more test data |
Partial Copy | Sample of production data (configurable via Sandbox Templates) | Yes | Every 5 days | User acceptance testing (UAT), integration testing |
Full | Exact copy of all production data and metadata | Yes | Every 29 days | Performance testing, staging, training |
- Note: The refresh interval indicates how often you can refresh, not that it refreshes automatically. You must manually initiate the refresh from production.
Best Practices for Sandbox Refreshes
To make the most of your sandbox environments and ensure smooth operations, consider these best practices:
- Plan Ahead: Coordinate refreshes with your development and testing teams. A refresh deletes all existing data and changes in the sandbox, so ensure all active work is deployed to another environment or production before refreshing.
- Post-Refresh Checklist:
- Activate: Once refreshed, you'll need to activate the sandbox.
- Configure Endpoints: Update any integrations or external service endpoints to point to the sandbox's URLs.
- Disable Automation: Temporarily disable critical automation (e.g., email alerts, scheduled jobs) to prevent unwanted actions during initial setup and testing.
- Anonymize/Obfuscate Data: For Partial Copy or Full sandboxes, implement data anonymization if sensitive production data is not needed or allowed in lower environments.
- Run Post-Refresh Scripts: Automate common setup tasks like assigning permission sets, deactivating users, or inserting test data.
- Utilize Sandbox Templates: For Partial Copy sandboxes, create and maintain sandbox templates to control exactly which objects and data are copied from production, optimizing refresh times and data relevance.
- Communicate Changes: Inform stakeholders about refresh schedules and the availability of updated sandboxes.
By following these guidelines and understanding that sandbox refreshes are a production-centric operation, you can effectively manage your Salesforce development lifecycle.