Last updated December 04, 2024
We recommend using our low-cost plans to complete this tutorial. Eligible students can apply for platform credits through our new Heroku for GitHub Students program.
This guide helps you set up the Heroku Connect add-on via the Heroku and Heroku Connect dashboards. See Heroku Connect for more info about this add-on.
See Setting Up Heroku Connect for setup recommendations and considerations.
See Quick Start: Heroku Connect CLI and Heroku Connect API if you prefer to set up with those tools instead of dashboards.
Prerequisites
Step 1: Create a Heroku App and Heroku Postgres Database
Heroku Connect requires Heroku Postgres for syncing data from Salesforce. Both Heroku Connect and Heroku Postgres are add-ons and must be attached to a Heroku app. You can attach add-ons to an empty app - deploying code isn’t required.
Adding a database to complete this tutorial counts towards your usage. Delete your database as soon as you’re done to control costs. Learn about our low-cost plans. Eligible students can apply for platform credits through our Heroku for GitHub Students program.
Create an empty app and attach Heroku Postgres to it:
- Open the Heroku Dashboard.
- Click
Newin the upper right and selectCreate new app. - Provide an app name, choose a region for the app and click
Create app. - The app view loads when the app is created. Click the
Resourcestab. - Search for Heroku Postgres in the
Add-onssection. - Select a plan and click the
Submit Order Formbutton. Choose a-4plan or larger for production use cases. See Heroku Connect for more info. For tutorial purposes only, you can choose theessential-0plan to minimize costs.
Step 2: Provision the Heroku Connect Add-on
- Open the Heroku Dashboard.
- Click the app you want to attach Heroku Connect to.
- Click the
Resourcestab. - Search for Heroku Connect in the
Add-onssection. - Select a plan and click the
Submit Order Formbutton. See Available Plans for more info.
Heroku Connect appears in the Add-ons section of your Resources tab when provisioned.
Step 3: Provision a Logging Add-on
Logging add-ons are not yet compatible for Fir-generation apps. Skip this step and subscribe to our changelog to stay informed of when we add features.
Heroku Connect produces logs of its sync activity, which you can access from your log drain. Provision one of these logging add-ons for your application:
- Open the Heroku Dashboard.
- Click the app you want to attach Heroku Connect to.
- Click the
Resourcestab. - Search for the add-on in the
Add-onssection. - Select a plan and click the
Submit Order Formbutton.
Step 4: Configure the Connection
- Open the Heroku Connect Dashboard by clicking the add-on from the Heroku Dashboard
Resourcestab. - Click the
Setup Connectionbutton in the dashboard. - Choose a Heroku Postgres database that is attached to your application. If you have multiple databases attached to your application you can choose the one you want Heroku Connect to use. The database specified by the
DATABASE_URLconfig var is selected by default. - Choose the Postgres schema to be used for the tables created by Heroku Connect. The default is
salesforce. You can choose to put your tables in an existing schema, includingpublic, as long as no tables exist in the schema. - Click
Nextto set up the database. - Choose to authenticate to a production or sandbox Salesforce org. You can use a custom login domain.
- Select the Salesforce API version you want Heroku Connect to use. You can’t change the API version after configuring the connection. Recreate the connection to change the API version.
- Click the
Authorizebutton and a browser opens for you to enter your Salesforce login credentials and authorize Heroku Connect. It’s recommended to use a dedicated integration user with View All Data permissions. See Heroku Connect for more info.
Step 5: Set Up Mappings
After you’ve authenticated to your Salesforce org, you can start mapping objects. To begin the process, click Create Mapping on the Overview tab of the Heroku Connect dashboard. See Managing Heroku Connect Mappings for full details.
(Optional) Step 6: Verify Setup
Check the following to verify that your data is syncing:
- Click the
Mappingstab. - The
Statuscolumn indicates a mapping’s sync state. Check Mapping States Reference to ensure that all of your mappings are in a non-error state.
You can also verify that data is syncing by using the Explorer tab. You can view a side-by-side comparison of the data held in Salesforce and in the mapped database tables.
Next Steps
In this tutorial, you set up an empty Heroku app. To deploy code to this app, see these articles on deployments. Most users deploy their code with Git.
To connect to your Heroku Postgres database from your Heroku app, see Heroku Postgres.
To connect to Heroku Postgres from external connections, see External Connections (ingress) and Heroku Postgres on Private and Shield Spaces.