How to refresh a sandbox
Sometimes a Sandbox will become out of sync with the production environment and therefore needs to be refreshed in order to be useful for accurate testing.
Run mass update for Contacts and Users, append .testing at the end of every email.
Step-by-step guide
The following steps must be followed in order to refresh a Salesforce Sandbox Org to mirror the latest state of a Production Org.
From within the Production Org, select Setup >> Deploy >> Sandboxes
The list of Sandboxes will display, with the ones you can refresh having a Refresh link next to the Sandbox name. Click the Refresh button next to the Sandbox you would like to update
If you want to activate your sandbox immediately after you refresh it, select Auto Activate. In this case, you don’t receive an activation email
Salesforce will start copying data to the Sandbox, and display a status
Once complete the In-Progress link next to the Sandbox name will change to Activate, and an email notification will be sent from Salesforce
When ready select the Activate link. Note: The Sandbox needs to be activated before the refreshed data can be used. Activating a replacement sandbox that was created using the Refresh link, completely deletes the sandbox it is refreshing, and all configuration/data in the previous Sandbox will be lost.
Post refresh
After a sandbox has just been refreshed, it needs to be returned to its previous functional state to use for testing.
Step-by-step guide
The following steps must be followed in order to change all reference points after a refresh.
Update Payment Gateway(s)
When Creating a Test Payment Gateway make sure to use a Test Deposit Account
Locate all business groups that are connected to a live payment gateway(s) (App Launcher → Administrator app → Business Group tab). See Figure 1.
within each Business Group delete the related gateways and create test gateway(s). See Figure 2.
Go to the Stores Object, and update all Stores being used with the new payment gateway. See Figure 3.
Make sure to add an "X" prefix to the Payment Gateway if you are going to disable one. ( ROE process picks the first gateway alphabetically without checking if it is enable )
We need to make that change because trying to delete the Payment Gateway throws the following error: 'Cascade dereferencing too many records: occurring when cascading to Receipt records'
Figure 1
Figure 2.
Figure 3.
Store
Go to Related List
Payment Methods
Make sure the Test Gateway is assigned to each one
Business Group
Make Sure it's using a Test Deposit Account
Recreate Scheduled Job(s)
Navigate to Setup → Jobs → Scheduled Jobs
Delete previously scheduled job(s) and reschedule them again if they need to continue running in the future
Check routing rules
Go to the Fonteva Framework tab → Routing Rules and make sure that the "Is Enabled" checkbox are correct. For example, if refreshing a Sandbox from Production, chek that any routing rule enabled in production are enabled in the sandbox, and that any routing rule not enabled in production is also not enabled in the sandbox.
Update Theme(s)
Navigate to the Site(s) object → click on Site Name
Verify Site is using the correct theme, if not update
Navigate to the Business Groups object, and open each Business Group record
If a Theme is referenced from within the Business Group, open the theme and then update the Logo URL
Update Custom Label(s)
Navigate to Setup → Build → Create → Custom Labels
Select the Edit link next to each Custom Label (Note: You can identify the custom labels to update because they will show a Del option in the Action column. See Figure 1
Once on the edit screen, update the URL listed in the Value field to reconnect to the appropriate portal site. See Figure 2
Figure 1Figure 2
Add/Update Remote Site Setting
Note: Before any Apex callout can call an external site, that site must be registered in the Remote Site Settings page, or the callout fails.í«í_Navigate to Setup → Administrator → Security Controls → Remote Site Settings
Click button for New Remote Site or Edit beside the previously created Remote Site. Change as necessary to point to the appropriate URLs
Update Community Logout URL
Type in All Communities from the Quick Find, select the All Communities link, click Manage next to the Community Site name
Once in Community Management, click Administration → Login & Registration
Enter the correct URL for the logout page under the section Logout
Verify Site & Menu Items URLs
Go to > Setup > search All Sites
go to
Related
Community Menu Items
Check that each Community Menu Item external url is pointing to the right Org
Publish the Communities
Go to > Setup > search All Sites
For each of the Active Communities enter:
Builder
Publish
Accept
Modify URL Site(s) Redirects
Type in All Communities from the Quick Find, select the All Communities link, click Manage next to the Community Site name
Once in Community Management, click Administration → Pages → Go to Force.com
On the Site Details page, click the URL Redirects button, and update as needed
Update links on Site(s) Record(s)
Navigate to the Sites object, and select the Site Name to open the Site record.
Update all URLs under the Links section.
Site URL
User Login URL
Login Redirect URL
User Reset Password URL
User Self Registration URL
Profile Page URL
Run File Level Security (FLS)
Go to Spark Framework >> Dashboard >> Access Manager
Run FLS in Access Manager for all profiles that will be used for testing, but exclude CPBase
Update Community Groups and Member Records
Navigate to the Community Groups object. On all Community Group records complete the following updates:
Unpublish (Is Published = False) and delete Chatter Group ID
Update the Look up to the correct Site on all community groups, click Save
Select Edit, and check the box for Is Published which will auto-populate the Chatter Group ID
Within each Community Group Detail page, navigate to the Community Group Members related list. Open each member's record and complete the following:
Delete Chatter Member ID
Update Role to Deactivated (Is Active = False)
Do a mass update and make Role = Active. This will populate the Chatter Group Member ID