Managing Heroku Connect Sync and Connections
Last updated December 01, 2022
Table of Contents
- Configuring a Connection
- Pause a Connection
- Resume a Connection
- Recreating a Connection After a Sandbox Refresh
- Select the Write Algorithm For Your Connection
- Recover Synchronization After an Error
- Recover Synchronization After a Database Rollback
- Changing Field Definitions in Salesforce
- Connection Configuration Audit Trail
Each Heroku Connect add-on is configured to connect to a single Heroku Postgres database and a single Salesforce org. This article covers how to manage your sync and connections.
Heroku Connect doesn’t provide a mechanism for partially syncing data. A mapping always syncs all records. See Unsupported Objects for exceptions involving archived Tasks and Events.
Configuring a Connection
See the Quick Start: Heroku Connect to configure your connection.
Pause a Connection
When performing certain tasks, such as upgrading your database, you can pause synchronization activity in Heroku Connect.
To pause synchronization:
- Open the Heroku Connect dashboard.
- Click the
Settings
tab. - Click
Manage Connection
. - Click the
Pause
button.
Heroku Connect completes any pending operations before entering the paused state. When paused, changes to data in the database are still added to the trigger log. There’s no polling for changes made in Salesforce. Push Topic notifications from Salesforce for mappings using the streaming mode are also ignored.
Connections can only be paused when they are in the IDLE
state. If your connection remains in the POLLING_DB_CHANGES
status for an extended time, check your logs to debug.
Resume a Connection
Any changes made to data in the Heroku Postgres database or in Salesforce while it was paused automatically syncs upon resuming the connection.
To resume synchronization:
- Open the Heroku Connect dashboard.
- Click the
Settings
tab. - Click
Manage Connection
. - Click
Resume
.
Heroku Connect continues where it left off by processing trigger log entries to push changes to Salesforce. It also retrieves changes made in Salesforce using polling, including mappings that normally use the Streaming API.
Recreating a Connection After a Sandbox Refresh
If you’ve reloaded a sandbox organization, you must delete your existing connection and recreate it.
The following settings are manually configured:
- Collaborators and their notifications settings
- Beta features
- The Write Algorithm
- The Salesforce API version
The rest of the recreation can be automated as follows:
- Export your configuration from the Connect Dashboard. Click
Settings
, then clickImport/Export Configuration
, then click theExport Configuration
button. - If you have any read/write mappings, make sure you aren’t writing any new data to those tables. Also, make sure all the mappings are in
DATA_SYNCED
to ensure all your data is present in Salesforce. You can clickSettings
,Manage Connection
and click thePause
button to stop activity on the connection. - Destroy the Connection from the heroku CLI
heroku addons:destroy -a appname herokuconnect-resource-name
- Create a new connection from https://elements.heroku.com or
heroku addons:create herokuconnect
from the command line. - Authenticate your new connection, and import the config you exported from step 1.
Select the Write Algorithm For Your Connection
Select the algorithm Heroku Connect uses when writing data to Salesforce. The same algorithm is used for all read-write mappings. See Write Algorithms for more info.
- Open the Heroku Connect dashboard.
- Click the
Settings
tab. - Click
Manage Connection
. - Scroll down to the Write Algorithm section and select your choice.
Recover Synchronization After an Error
- Open the Heroku Connect dashboard.
- Click the
Settings
tab. - Click
Manage Connection
. - Click
Recover From Error
to clear out an unexpected error state and resume synchronization. See Heroku Connect Log Messages and Common Errors for more info.
Recover Synchronization After a Database Rollback
Heroku Connect uses a high-water mark methodology. Rolling back a synced Heroku Postgres database causes inconsistent data. Reload mappings after a database rollback to recover data consistency.
Changing Field Definitions in Salesforce
Heroku Connect doesn’t automatically change the table schema in PostgreSQL after you’ve changed the corresponding field definition in Salesforce. Attempts to automatically change the field can result in data loss or corruption. See Changing Field Definitions in Salesforce for more info.
Connection Configuration Audit Trail
Heroku Connect keeps a record of administrative changes to your connection’s configuration. Click Download Audit Trail
to export to CSV. See Audit Messages for more info.