Managing Sandbox Environments
A Sandbox environment allows you to test, develop, and troubleshoot, without affecting your Production records; the number of which is based on your Salesforce edition. To complete a basic Salesforce Sandbox refresh, you need only click a button, however, we have a myriad of steps to follow that ensure that your constituents are not receiving emails from the test environment, nor will payment tests go through your Production payment gateway.
Learn more about Sandbox Licenses and Storage by Type (external).
Please keep in mind that your association may have additional steps in order to ensure that integrations, syncs, and customizations still function but do not affect Production. Please contact to Nimble AMS Support for a list of these steps if you do not have them on-hand or if they need to be updated.
Pre-Refresh Steps
Reach out to Nimble AMS Support through a Support Case at least 48 hours in advance of your planned refresh date to ensure that there are no additional projects in development.
Informing Nimble AMS Support in advance will ensure that any changes of scope are avoided. Keep in mind that you will be responsible for any information is lost from in progress projects should you refresh without this confirmation.
- Ensure the sandbox has not already been refreshed in the past month.
- Confirm that all Apex tests pass in Production; you will not want to refresh with failing tests as this can cause email error messages and failing customizations:
- From Setup, enter
Apex Test Execution
in the Quick Find box, then select Apex Test Execution. - Click Select Tests....
- In the dialog box, select
All Namespaces
, select the checkbox next to Class Name to select all tests. - Click Run.
As the tests run you can open another tab to complete the remainder of the pre-refresh steps.
- From Setup, enter
- Ensure your Production org is not over its Storage Limit; this is extremely important as Salesforce will freeze Sandbox environments that have gone over their data limit, which renders them unusable until the limit has been raised or data has been deleted.
- To check this information, from Setup; Search "Storage Usage" | Check percentages by Storage Type at the top of the page.
- Check internally to ensure that there are no projects in development that would be lost by refreshing your Sandbox
Ensure there are no outstanding change sets that need to be deployed:
To check this information, from Setup, Search "Inbound Change Sets"
If there are any change sets that haven't been deployed, work to identify if they should or should not be deployed. If the change set shouldn't be deployed, delete the change set. You may need to review this internally and with Nimble AMS Support.
- Ensure the Email Appender package has been installed:
- From Setup, enter
Installed Packages
in the Quick Find box, then select Installed Packages. - Ensure Email Appender is listed.
- From Setup, enter
Base Refresh Steps
After completing the Pre-Refresh Steps, From Setup, enter
Sandbox
, then and selectSandboxes
Click
Refresh
next to the sandbox you would like to refresh.If you are refreshing the "Staging" sandbox, do not change the Sandbox name - if you were to use a different sandbox name, you would need to update credentials in any data integrations that use that test environment, including Self Service. If the sandbox has been refreshed within the past 30 days, the refresh link will not appear as the sandbox is not available to refresh at this time.
- Select the data you want to copy.
- For a full Sandbox, you will want to include all object data
- Developer or Partial Copy sandboxes can be used for smaller subsets of data, through the use of templates.
- Click
Refresh
- After Salesforce finishes copying data to the sandbox, you will receive an email instructing you to activate the sandbox.
To activate, login to the production org and from Setup, Deploy | Sandboxes | Activate
This will complete the overwrite of the Sandbox environment and any data that was not moved into Production or backed up prior to the refresh will be lost.
Post Refresh Steps
- Update the Salesforce Org Name
Append the Sandbox Name (for example, “ - Staging” or “ - Dev”) to Organization Name.
Login to the Org as the Admin.
From Setup, Company Profile | Company Information.
Click Edit.
- Append the Sandbox Name
- Save
- Update Outbound Messaging Endpoint and Current Message
- From Setup, Create | Workflow & Approvals | Outbound Messages.
- Click Edit for each Outbound Message and change the endpoint to the Staging endpoint.
- If you are unsure if there is a Staging endpoint then you could just simply delete the outbound message since it can be recreated from the Live version if necessary.
- From Setup, Monitor | Outbound Messages.
- Click Abort or Delete for any active, old or failed Outbound Messages to ensure they do not attempt to retry.
If you have any outbound messaging data integration in place, change the endpoint to the staging web service, or disable the workflow rule that triggers the message. Otherwise, the production web service is updated with any changes.
- If you are unsure if there is a Staging endpoint then you could just simply delete the outbound message since it can be recreated from the Live version if necessary.
- Append ".zzz" to all email addresses
- From Setup, Develop | Custom Metadata Types
- Click Manage Records next to SObject to
Append To Fields Configurations
(NUEA__AppendToFieldsConfiguration__mdt). - Set all of the existing records to Active = True
- Add fields (ie. custom email addresses) to existing records that need the post-fix
- Create new records for SObjects that need to have post-fixes appended to them.
Run the following code in the developer console to activate the Email Appender package:
CODENUEA.AppendToEmails jobWrapper = new NUEA.AppendToEmails(); jobWrapper.execute();
If your Record 'Edit' Duplication rules are set to Block or Allow duplicates and Alert Staff; this will conflict with the Email Appender package and cause errors. Temporarily setting the duplication rules to allow edits and removing the alert will enable this feature to run without additional issue.
- After the Email Appender has finished (this will take some time and will run for each SObject record); run the following queries to ensure no live email addresses have been missed.
Accounts:
CODESELECT Id, NU__OtherEmail__c,NU__PersonEmail__c,PersonEmail,NU__PrimaryContactEmail__c FROM Account WHERE NU__PersonEmail__c != null AND (NOT NU__PersonEmail__c LIKE '%.zzz')
CODESELECT Id, NU__OtherEmail__c,NU__PersonEmail__c,PersonEmail,NU__PrimaryContactEmail__c FROM Account WHERE NU__OtherEmail__c != null AND (NOT NU__OtherEmail__c LIKE '%.zzz')
CODESELECT Id, NU__OtherEmail__c,NU__PersonEmail__c,PersonEmail,NU__PrimaryContactEmail__c FROM Account WHERE PersonEmail != null AND (NOT PersonEmail LIKE '%.zzz')
CODESELECT Id, NU__OtherEmail__c,NU__PersonEmail__c,PersonEmail,NU__PrimaryContactEmail__c FROM Account WHERE NU__PrimaryContactEmail__c != null AND (NOT NU__PrimaryContactEmail__c LIKE '%.zzz')
Orders:
CODESELECT Id,NU__AdditionalEmails__c,NU__AdditionalEmail__c,NU__ConfirmationEmail__c,NU__InvoiceEmail__c FROM NU__Order__c WHERE NU__InvoiceEmail__c != null AND ((NOT NU__InvoiceEmail__c LIKE '%.zzz')
CODESELECT Id,NU__AdditionalEmails__c,NU__AdditionalEmail__c,NU__ConfirmationEmail__c,NU__InvoiceEmail__c FROM NU__Order__c WHERE NU__ConfirmationEmail__c != null AND ((NOT NU__ConfirmationEmail__c LIKE '%.zzz')
CODESELECT Id,NU__AdditionalEmails__c,NU__AdditionalEmail__c,NU__ConfirmationEmail__c,NU__InvoiceEmail__c FROM NU__Order__c WHERE NU__AdditionalEmails__c != null AND ((NOT NU__AdditionalEmails__c LIKE '%.zzz')
CODESELECT Id,NU__AdditionalEmails__c,NU__AdditionalEmail__c,NU__ConfirmationEmail__c,NU__InvoiceEmail__c FROM NU__Order__c WHERE NU__AdditionalEmail__c != null AND ((NOT NU__AdditionalEmail__c LIKE '%.zzz')
Registrations:
CODESELECT Id,NU__RegistrantEmail__c FROM NU__Registration2__c WHERE NU__RegistrantEmail__c != null AND (NOT NU__RegistrantEmail__c LIKE '%.zzz%')
- You will also want to query any additional SObject records you created during the steps above.
- Adjust Nimble AMS Account Email Addresses:
- From Setup, click Manage Users | Users
- Update the email address of the "NU Admin" user to:
- Staging Sandbox: client+[companyacronym]_staging@nimbleams.com
- Dev Sandbox: client+[companyacronym]_dev@nimbleams.com
- Update the email address of the "System Integration" or "Integration Framework API User" user to:
- Staging Sandbox: client+[companyacronym]_staging@nimbleams.com
- Dev Sandbox: client+[companyacronym]_dev@nimbleams.com
- Click Save.
- An email verification will be sent once the email address is updated - Nimble AMS will ensure that the addresses are updated.
- Adjust Internal Account Email Addresses
- From Setup, Manage Users | Users
Update Internal User Account Email Addresses as needed.
Salesforce automatically changes all email addresses copied from Production into Staging, so if users need to reset their passwords in the future, an admin will have needed to change this before hand.
- Update Nimble AMS Email Addresses
From Setup, Installed Packages | Nimble AMS | Configure
Update the "Email Service From Address" to include “staging/develop” email values as noted in step 4
Update the "Error Email Address" to include “staging/develop” email values as noted in step 4
- Click Save
- Update payment gateway(s):
If you're using the BluePay payment gateway:- In the tab bar, click App Launcher, or in Salesforce Classic, click Nimble AMS, Staff View, Button, All Tabs.
- Click Gateway Settings.
- Click Edit next to BluePay.
- Deselect Live Mode.
- Click Save.
- Navigate to All Tabs | Payment Gateways.
- Update the Authorize.Net settings to your payment gateway's test credentials.
Complete this for every active payment gateway to make sure test orders and payments are not processed through your production payment gateway.
- Update Your Salesforce Logo
- Navigate to All Tabs | Documents.
- Find the logo image for the Sandbox environment and click on that document name.
- On the image in the document, right click the image and choose "Copy Image URL."
- Open a new tab and paste the URL into the address bar.
- Right click on the Image and save the image to your computer.
- Navigate back to All Tabs | Documents.
- Click on the document that contains your Production Org logo
- Click Replace document.
- Choose to upload a file from your computer. Use the browse button to located the file that was saved to your computer during Step 8b, above.
- Click Replace Document.
- The logo for all of the Apps, Email Alerts, etc should be updated to the Sandbox environment's URL.
- Reschedule Scheduled Jobs
- Reschedule the Nimble AMS product jobs
- Navigate to Setup | Installed Packages | Nimble AMS | Configure
- Scroll to Scheduled Jobs
- Enable the following Jobs
- Calculate AR Aging
- Calculate Account Financials
- Calculate Event Revenue
- Calculate Membership Billing Totals
- This does not need to be enabled if you do not process cash based memberships
- Recognize Deferred Revenue
- This does not need to be enabled if you do not use deferred revenue.
- Reconcile Unsettled Payments
If you use the .Net Self Service, Enable the following job:
- Order Processor Monitor
- Dependent on your setup and processes, these jobs are also available:
- Recurring Membership Renewer
- Recurring Membership Repricer
- Recurring Payment Amount Corrector
- Recurring Payment Transactions
- Recurring Payments Cancellation
- Upcoming Recurring Payment Notifier
- Recurring Membership Renewer
- Update Account Geolocations
- Committee Membership Status Updater
- Click "Apply" and these jobs will be scheduled to run
If you use Community Hub, you will need to schedule the SyncRecordJob, which allows the User record and Account record information to be synced:
CODENC.SyncRecordJob srj = new NC.SyncRecordJob(); // Seconds Minutes Hours Day_of_month Month Day_of_week optional_year String dailyAt500 = '0 0 5 ? * *'; System.schedule('Sync Record Job Daily 05:00', dailyAt500, srj);
This is run through the Debug | Open Execute Anonymous section of the Developer Console.
- Reschedule the Nimble AMS product jobs
- If you use Programs, schedule the Batch Program Stamper & Batch Program Expiration, through the Debug | Open Execute Anonymous section of the Developer Console, using these two separate lines of code:
Part One:
CODEpublic static final String SCHEDULE_NAME = 'Batch Program Stamper'; System.schedule(SCHEDULE_NAME, '0 0 2 * * ?', new PROG.BatchProgramStamper());
Part Two:
CODEpublic static final String SCHEDULE_NAME = 'Batch Program Expiration'; System.schedule(SCHEDULE_NAME, '0 0 2 * * ?', new PROG.BatchProgramExpiration());
- If you use the Metrics packages, you will want to unschedule the following jobs:
- From Setup, Jobs | Scheduled Jobs
- Delete the following jobs if they are present:
- Collect Metrics
- Collect Metrics Once
- Rescheduling Additional Jobs
- From Setup, Jobs | Scheduled Jobs.
- For custom scheduled jobs, delete them from the Scheduled Jobs page and then re-schedule them using their corresponding Schedule apex methods.
- Delete the following Jobs if they are present:
- BatchTotalUpdater
- ProductRollupUpdater
- CreditCardPaymentCapturer
- BatchTotalUpdater
- Open the Developer Console
- Click on the Query Editor Tab at the bottom of the Developer Console.
Enter and Execute the following query in the Developer Console:
CODESELECT Id, NU__Purpose__c FROM NU__QueueProcess__c
If there are any where the Purpose is CaptureCreditCardPayment, they either need to have their Purpose changed to zCaptureCreditCardPayment or delete the record.
- Update any custom settings with Staging work
- If the Automated Testing framework is installed, update the Automated Test Settings custom settings.
- As an Admin, from Setup, Develop | Custom Settings | click “Manage” for the Automated Test Settings.
- Click Edit.
- Update Recipient Email to: email+[companyacronym].staging@nimbleuser.com
- Update Email Subject to “Automated Nightly Test - Staging” for Staging and “Automated Nightly Test - Dev”
- Save
- If the Automated Testing framework is installed, update the Automated Test Settings custom settings.
- From Setup, Develop | Apex Classes.
- Select "Compile all Classes" link under the "Estimate your organization's code coverage" link.
- From Setup, Email Administration | Deliverability.
- Change the “Access Level” to All Email.
Hybrid Self Service and Community Hub Post Refresh Steps
- Update the Single Sign On Connected App
- From Setup, Create | Apps
- Scroll to Connected Apps.
- Click on the name of the Connected App (ie. Legacy Self Service SSO).
- Click Edit.
- Update the callback url to include the Staging site's URL (ex https://staging.companyname.org/sso/default.aspx).
- Click Save.
Community Hub Post Refresh Steps
- Update the Community Hub Logout URL
- From Setup, Communities | All Communities
- Copy the URL for Community Hub
- Click Workspaces or Manage (dependent on Community Version)
- Click Manage | Administration | Login & Registration
- Scroll to Logout
Update the Logout URL to the copied URL from step 1b and add “/NC__Login” to the end of the URL.
If you would like to point to a separate page once logout finishes, update the URL to your preferred URL.
- Click Save
- If you are using the Express Payments feature, follow the steps below:
- Go to the primary entity record.
- Update both the Payment URL (Cart) and Payment URL (Order) field values so that "Staging" (without quotes) is appended.
- For example if the default URL is https://jumpstart-161b5dbd293.force.com/communityhub/expresspaymentcart?id= append staging like so: https://staging-jumpstart-161b5dbd293.force.com/communityhub/expresspaymentcart?id=
- Save the Entity record.
Related Links
Sandbox Setup Considerations (external)
Create, Clone, or Refresh a Sandbox (external)
Unlock a Sandbox (external)