Skip to main content
Skip table of contents

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

  1. 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.

  2. Ensure the sandbox has not already been refreshed in the past month.
  3. 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:
    1. From Setup, enter Apex Test Execution in the Quick Find box, then select Apex Test Execution.
    2. Click Select Tests....
    3. In the dialog box, select All Namespaces, select the checkbox next to Class Name to select all tests.
    4. Click Run.

    As the tests run you can open another tab to complete the remainder of the pre-refresh steps.

  4. 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.
    1. To check this information, from Setup; Search "Storage Usage" | Check percentages by Storage Type at the top of the page.
  5. Check internally to ensure that there are no projects in development that would be lost by refreshing your Sandbox
  6. Ensure there are no outstanding change sets that need to be deployed:

    1. 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.

  7. Ensure the Email Appender package has been installed:
    1. From Setup, enter Installed Packages in the Quick Find box, then select Installed Packages.
    2. Ensure Email Appender is listed.

Base Refresh Steps

  1. After completing the Pre-Refresh Steps, From Setup, enter Sandbox, then and select Sandboxes

  2. 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.

  3. Select the data you want to copy.
    1. For a full Sandbox, you will want to include all object data
    2. Developer or Partial Copy sandboxes can be used for smaller subsets of data, through the use of templates.
  4. Click Refresh
  5. After Salesforce finishes copying data to the sandbox, you will receive an email instructing you to activate the sandbox. 
    1. 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

  1. Update the Salesforce Org Name
    1. Append the Sandbox Name (for example, “ - Staging” or “ - Dev”) to Organization Name.

      1. Login to the Org as the Admin.

      2. From Setup, Company Profile | Company Information

      3. Click Edit.

      4. Append the Sandbox Name
      5. Save
  2. Update Outbound Messaging Endpoint and Current Message
    1. From Setup, Create | Workflow & Approvals | Outbound Messages
    2. Click Edit for each Outbound Message and change the endpoint to the Staging endpoint. 
      1. 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.
      2. From Setup, Monitor | Outbound Messages
      3. 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.

  3. Append ".zzz" to all email addresses
    1. From Setup, Develop | Custom Metadata Types
    2. Click Manage Records next to SObject to Append To Fields Configurations (NUEA__AppendToFieldsConfiguration__mdt). 
    3. Set all of the existing records to Active = True
    4. Add fields (ie. custom email addresses) to existing records that need the post-fix
    5. Create new records for SObjects that need to have post-fixes appended to them.
    6. Run the following code in the developer console to activate the Email Appender package:

      NUEA.AppendToEmails jobWrapper = new NUEA.AppendToEmails();

      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.

    7. 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.
      1. Accounts:

        SELECT 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')
        SELECT 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')
        SELECT Id, NU__OtherEmail__c,NU__PersonEmail__c,PersonEmail,NU__PrimaryContactEmail__c FROM Account WHERE PersonEmail != null AND (NOT PersonEmail LIKE '%.zzz')
        SELECT 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')
      2. Orders:

        SELECT 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')
        SELECT 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')

        SELECT 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')
        SELECT 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')
      3. Registrations:

        SELECT Id,NU__RegistrantEmail__c FROM NU__Registration2__c WHERE NU__RegistrantEmail__c != null AND (NOT NU__RegistrantEmail__c LIKE '%.zzz%')
    8. You will also want to query any additional SObject records you created during the steps above.
  4. Adjust Nimble AMS Account Email Addresses:
    1. From Setup, click Manage Users | Users
    2. Update the email address of the "NU Admin" user to:
      1. Staging Sandbox: client+[companyacronym]
      2. Dev Sandbox: client+[companyacronym]
    3. Update the email address of the "System Integration" or "Integration Framework API User" user to:
      1. Staging Sandbox: client+[companyacronym]
      2. Dev Sandbox: client+[companyacronym]
    4. Click Save.
    5. An email verification will be sent once the email address is updated - Nimble AMS will ensure that the addresses are updated.
  5. Adjust Internal Account Email Addresses
    1. From Setup,  Manage Users | Users
    2. 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.

  6. Update Nimble AMS Email Addresses
    1. From Setup,  Installed Packages | Nimble AMS | Configure

      1. Update the "Email Service From Address" to include “staging/develop” email values as noted in step 4

      2. Update the "Error Email Address" to include “staging/develop” email values as noted in step 4

      3. Click Save
  7. Update payment gateway(s):
    If you're using the BluePay payment gateway:
    1. In the tab bar, click 
      App Launcher, or in Salesforce Classic, click 
      Nimble AMS, Staff View, Button, All Tabs.
    2. Click Gateway Settings.
    3. Click Edit next to BluePay.
    4. Deselect Live Mode.
    5. Click Save.
    If you're using the Authorize.Net payment gateway:
    1. Navigate to All Tabs | Payment Gateways.
    2. 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.

  8. Update Your Salesforce Logo
    1. Navigate to All Tabs | Documents.
    2. Find the logo image for the Sandbox environment and click on that document name.
      1. On the image in the document, right click the image and choose "Copy Image URL."
      2. Open a new tab and paste the URL into the address bar.
      3. Right click on the Image and save the image to your computer.
    3. Navigate back to All Tabs | Documents.
    4. Click on the document that contains your Production Org logo
      1. Click Replace document.
      2. 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.
      3. Click Replace Document.
    5. The logo for all of the Apps, Email Alerts, etc should be updated to the Sandbox environment's URL.
  9. Reschedule Scheduled Jobs
    1. Reschedule the Nimble AMS product jobs
      1. Navigate to Setup | Installed Packages | Nimble AMS | Configure
      2. Scroll to Scheduled Jobs
      3. Enable the following Jobs
        1. Calculate AR Aging 
        2. Calculate Account Financials
        3. Calculate Event Revenue 
        4. Calculate Membership Billing Totals
          1. This does not need to be enabled if you do not process cash based memberships
        5. Recognize Deferred Revenue
          1. This does not need to be enabled if you do not use deferred revenue.
        6. Reconcile Unsettled Payments
      4. If you use the .Net Self Service, Enable the following job: 

        1. Order Processor Monitor
      5. Dependent on your setup and processes, these jobs are also available:
          1. Recurring Membership Renewer 
          2. Recurring Membership Repricer  
          3. Recurring Payment Amount Corrector 
          4. Recurring Payment Transactions
          5. Recurring Payments Cancellation 
          6. Upcoming Recurring Payment Notifier 
        1. Update Account Geolocations
        2. Committee Membership Status Updater
      6. Click "Apply" and these jobs will be scheduled to run
    2. If you use Community Hub, you will need to schedule the SyncRecordJob, which allows the User record and Account record information to be synced:

      NC.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);

    1. This is run through the Debug | Open Execute Anonymous section of the Developer Console.

  10. 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:
    1. Part One:

      public static final String SCHEDULE_NAME = 'Batch Program Stamper';
      System.schedule(SCHEDULE_NAME, '0 0 2 * * ?', new PROG.BatchProgramStamper());

    2. Part Two:

      public static final String SCHEDULE_NAME = 'Batch Program Expiration';
      System.schedule(SCHEDULE_NAME, '0 0 2 * * ?', new PROG.BatchProgramExpiration());
  11. If you use the Metrics packages, you will want to unschedule the following jobs:
    1. From Setup, Jobs | Scheduled Jobs
    2. Delete the following jobs if they are present: 
      1. Collect Metrics
      2. Collect Metrics Once
  12. Rescheduling Additional Jobs
    1. From Setup, Jobs | Scheduled Jobs.
    2. For custom scheduled jobs, delete them from the Scheduled Jobs page and then re-schedule them using their corresponding Schedule apex methods.
    3. Delete the following Jobs if they are present:
      1. BatchTotalUpdater
      2. ProductRollupUpdater
      3. CreditCardPaymentCapturer
  • Remove Queue Process Records
      1. Open the Developer Console
      2. Click on the Query Editor Tab at the bottom of the Developer Console.
      3. Enter and Execute the following query in the Developer Console:

        SELECT Id, NU__Purpose__c FROM NU__QueueProcess__c

      4. If there are any where the Purpose is CaptureCreditCardPayment, they either need to have their Purpose changed to zCaptureCreditCardPayment or delete the record.

    1. Update Custom Settings
      1. Update any custom settings with Staging work
        1. If the Automated Testing framework is installed, update the Automated Test Settings custom settings.
          1. As an Admin, from Setup, Develop | Custom Settings | click “Manage” for the Automated Test Settings.
          2. Click Edit.
          3. Update Recipient Email to: email+[companyacronym] 
          4. Update Email Subject to “Automated Nightly Test - Staging” for Staging and “Automated Nightly Test - Dev”
          5. Save
    2. Compile All Apex Classes
      1. From Setup, Develop | Apex Classes.
      2. Select "Compile all Classes" link under the "Estimate your organization's code coverage" link.
    3. Ensure that the Email Appender run in step 3 has completed for all SObjects and then update email deliverability
      1. From Setup, Email Administration | Deliverability.
      2. Change the “Access Level” to All Email.
    4. Provide Nimble AMS Support with the new Org ID (seen under "Company Information" in setup) and Salesforce Pod (ie. CS42)
    5. Hybrid Self Service and Community Hub Post Refresh Steps

      1. Update the Single Sign On Connected App
        1. From Setup, Create | Apps
        2. Scroll to Connected Apps.
        3. Click on the name of the Connected App (ie. Legacy Self Service SSO).
        4. Click Edit.
        5. Update the callback url to include the Staging site's URL (ex
        6. Click Save.

      Community Hub Post Refresh Steps

      1. Update the Community Hub Logout URL
        1. From Setup, Communities | All Communities
        2. Copy the URL for Community Hub
        3. Click Workspaces or Manage (dependent on Community Version)
        4. Click Manage | Administration | Login & Registration
        5. Scroll to Logout
        6. 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.

        7. Click Save
      2. If you are using the Express Payments feature, follow the steps below:
        1. Go to the primary entity record.
        2. Update both the Payment URL (Cart) and Payment URL (Order) field values so that "Staging" (without quotes) is appended.
          1. For example if the default URL is append staging like so:
        3. Save the Entity record.

      JavaScript errors detected

      Please note, these errors can depend on your browser setup.

      If this problem persists, please contact our support.