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:
-
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 applicationAt this point you should have a file ending in
.jsonwith your configuration. -
Destroy the existing Heroku Connect add-on.
You can destroy the add-on via your Application Dashboard. From the
Resourcestab on Heroku Dashboard, select the actions button on the add-on to open the menu. Then selectDelete Add-on.Alternatively, you can destroy the add-on via the Heroku CLI:
$ heroku addons:destroy herokuconnect -a application -
Create a new Heroku Connect add-on and open the Connect dashboard:
From dashboard : Create a new Heroku Connect add-on from theResourcestab on Heroku Dashboard. Search for and add theHeroku Connectadd-on
From CLI :$ heroku addons:create herokuconnect -a application $ heroku addons:open herokuconnect -a application -
Authorize Heroku Connect to use your new Sandbox Organization.
From dashboard: Authenticate your add-on by opening the Heroku Connect Dashboard and select Setup Connection.
a. Select the Heroku Postgres database and schema to connect to your add-on, and click Next.
b. Select the Salesforce org type and API version for your connection and select Authorize to log in with your Salesforce credentials.
From CLI :heroku connect:sf:auth -a appname herokuconnect-resource-name -
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 -
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.