Leaving Heroku? Here's how to handle Heroku Connect
Move your app to Build first, then plan the Heroku Postgres and Heroku Connect handover with Stacksync when you're ready to move the database.
- Author
- Build.io team
- Published
- Read time
- 7 min read
If your app uses Heroku Connect, you need a replacement before you migrate your database over to Build. You can move the app to Build first and keep using Heroku Postgres and Heroku Connect while you plan the data move. When we run a Heroku exit for a customer that depends on Salesforce data, we bring in Stacksync to replace Heroku Connect with a real-time, two-way sync between Salesforce and the new Postgres database. We move the app and the platform; Stacksync keeps the Salesforce data flowing.
This post explains why Heroku Connect is usually the trickiest part of a Heroku exit, what the replacement looks like, and the order we do things in.

Why can't Heroku Connect move with the rest of the app?
Most of a Heroku app is portable. Build supports Heroku buildpacks, Procfiles, config vars, pipelines and review apps. Its direct Heroku integration imports application configuration so you can validate the app on Build before moving traffic or data.
Heroku Connect is different. It is a Heroku add-on that writes Salesforce records into a schema inside a Heroku Postgres database and, if you've set it up for two-way sync, writes changes from Postgres back to Salesforce. It is tied to Heroku Postgres. There is no setting that points it at a database hosted elsewhere.

So a team leaving Heroku has three choices for that sync:
- Keep the existing Heroku Postgres database and Heroku Connect while the app runs on Build. This is a useful intermediate step, but doesn't allow you to fully leave Heroku and leverage the benefits of Build's platform.
- Write your own integration against the Salesforce APIs. This is possible, but you take on change tracking, conflict handling, retries, API limits and schema changes yourself.
- Replace Heroku Connect with a sync service that works with any Postgres. This is where Stacksync fits.
What does Stacksync replace, exactly?
Stacksync connects Salesforce to Postgres, and to other databases, with real-time, two-way sync. For a Heroku Connect customer, that covers the job Heroku Connect was doing: Salesforce objects show up as tables in your database, your app reads and writes those tables, and changes flow in both directions.
| Heroku Connect | Stacksync | |
|---|---|---|
| Where the database can live | Heroku Postgres only | Any Postgres, plus other databases |
| Sync direction | One-way or two-way | Two-way sync, direction set per table |
| Depends on staying on Heroku | Yes | No |
| Who it suits | Apps that will stay on Heroku | Apps moving off Heroku, or already off |
This is why Build partners with Stacksync. For an app that depends on Salesforce data, replacing the hosting platform is only part of the move: the database and Salesforce connection need a coordinated handover too. Build can manage the application and database migration end to end, while Stacksync handles the replacement sync.
The partnership brings both workstreams into one plan, with named owners, validation steps and a rollback path. Your team can move off Heroku without taking on a custom Salesforce integration. See Stacksync's Heroku Connect alternative page for the product comparison.
In what order should you migrate the app and the sync?
The application and database do not have to move together. Build's Heroku migration guide separates them:

- 01Inventory the app and its Salesforce dependencies. List mappings, fields, directions, and any queries that depend on Heroku Connect's schema or system columns.
- 02Connect Heroku to Build and sync the app. Create the Build app, choose Configure Sync, and import its configuration. On the first sync, leave Releases and Images unselected. Configuration sync does not copy database data.
- 03Validate on Build against the existing database. The imported
DATABASE_URLstill points to Heroku Postgres, so Heroku Connect can continue serving it. Start the web process to test; keep workers stopped until you intend them to process real production jobs. - 04Move traffic when ready. After validation, you can switch DNS to Build while keeping the database on Heroku, or coordinate the traffic switch with the later data move.
- 05Plan the database and Salesforce sync move. Provision Schema To Go on Build. Use
import_urlwhere suitable, or plan replication for a large production database. Agree with Build and Stacksync how application data and Salesforce tables will be populated without conflicting writes. - 06Validate the replacement sync. Run the agreed validation alongside Heroku Connect, with only one connector responsible for production writes back to Salesforce. Review schema differences and test both directions safely.
- 07Switch the database connection and sync ownership. Attach the new database as
DATABASE, stop syncing config vars so the oldDATABASE_URLcannot overwrite it, and redeploy. Coordinate write handling and the handover from Heroku Connect to Stacksync. - 08Retain the agreed rollback path, then decommission. Confirm application behavior and Salesforce sync before removing the old resources. Once data has changed on Build, rollback needs a data plan as well as a traffic change.
Moving the app first gives you time to validate Build without changing the Salesforce sync at the same time.
What should you check in your code before cutover?
Heroku Connect adds its own conventions to the tables it manages. Apps built on it sometimes query the Salesforce ID column, filter on Heroku Connect's status columns, or read the trigger log to see if a write went through. Search your codebase for those references early. Some apps touch none of them; others have a few queries that need rewriting. Either way, you want to know before cutover week.
Also check background jobs. A worker that runs every few minutes and expects fresh Salesforce data will behave differently if the sync timing changes, so test it against the new setup during the side-by-side period.
Where does Build fit into the migration?
Build runs the application and managed services, including Schema To Go for Postgres and Cache To Go for Redis. Git deployments, pipelines, review apps, logs and metrics stay on the same platform. Heroku buildpacks are supported directly; Dockerfiles are another option.
The Heroku integration lets you bring the app across first. Stacksync becomes part of the data migration when you're ready to replace Heroku Connect.
Who does what in a joint Build.io and Stacksync migration?
Choose how much of the migration your team wants to handle. You can run it using docs.build.io and reaching out for support from Build engineers when needed, or have Build's team take a more active role, even managing end to end if preferred. Engineer-led migration support is included with every Enterprise plan.
On a joint migration:
- Build handles the application platform and can manage the app, database and service moves, including the cutover plan.
- Stacksync handles the agreed Salesforce sync setup and handover using its Salesforce connector.
- Your team agrees requirements, validates application behavior and approves production changes.
We agree owners and timing before starting. Moving the app and replacing Salesforce sync can be separate stages.
Planning a move off Heroku? Talk to Build about your migration. Run it yourself with engineering support, work alongside our team, or have us manage the migration end to end. If you're moving a database that uses Heroku Connect, we'll bring Stacksync into the plan for Salesforce sync.
FAQ
Frequently asked questions






