Why did sync stop after a Salesforce Sandbox Refresh?

Issue

This KB is intended for Sandbox orgs that have been refreshed and caused sync to stop. For production orgs in INACTIVE_ORG, please open a ticket.

Your Salesforce Sandbox Organization has been refreshed and sync activity has stopped. Your dashboard states that your Salesforce org has become inactive.

When a sandbox organization is refreshed, Salesforce essentially gives you a new organization, making the old one inactive. This breaks the connection between your Salesforce database and your Heroku Postgres database. It's different from a production instance refresh because your record's SFIDs change, which can cause consequences not only for Heroku Connect's synchronization but for your data.

Resolution

To recover from a sandbox refresh, you'll need to export your connection configuration and create a new connection to your new organization. If you would like to continue using the same schema for your new connection you will need to remove the old schema before configuring the new connection.

To export your config for an existing connection follow these instructions:

  1. First export your connection configuration.

    You can export it via the dashboard by viewing your connection's dashboard. After a sandbox refresh, you'll see a prominent "Export configuration" button on that screen.

    Alternatively, you can use the Heroku Connect CLI Plugin:

    $ heroku connect:export -a application
    

    At this point you should have a file ending in .json with your configuration.

  2. Destroy the existing Heroku Connect add-on.

    You can destroy the add-on via your Application Dashboard or via the Heroku CLI:

    $ heroku addons:destroy herokuconnect -a application
    
  3. Create a new Heroku Connect add-on and open the Connect dashboard:

    $ heroku addons:create herokuconnect -a application
    $ heroku addons:open herokuconnect -a application
    
  4. Authorize Heroku Connect to use your new Sandbox Organization.

  5. Import your old connection configuration.

    You can import it via the dashboard by viewing your connection on https://connect.heroku.com, clicking "Settings" and selecting "Import/Export Configuration" from its dropdown. Once there click the "Import" button and follow the rest of the steps to upload the file you downloaded in Step 1.

    Alternatively, you can use the Heroku Connect CLI Plugin:

    $ heroku connect:import -a application application-herokuconnect-concave-12345.json
    
  6. Re-configure the connection's write mode, logplex integration (if it was enabled on your old sandbox connection), and user notification preferences.

    Note that as part of the connection recreation, your mapped tables will be dropped and recreated. Once the connection has been recreated, you will also need to set up again any custom triggers that existed in your tables.

    If you are using other Heroku features like Streaming Data Connectors that integrated with your Heroku Connect tables, you will need to reconfigure the newly mapped tables for your connector.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support