Skip to content

Stacksync × Supabase New York: AI That Does the WorkNov 17Reserve your spot

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
Leaving Heroku? Here's how to handle Heroku Connect
APP TIPS

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.

Where the database can live with Heroku Connect compared with Stacksync: Heroku Postgres only versus Postgres outside Heroku with two-way sync

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.

Today the app on Build reads Heroku Postgres, synced to Salesforce by Heroku Connect. After the data move it reads Postgres on Build, synced by Stacksync

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 ConnectStacksync
Where the database can liveHeroku Postgres onlyAny Postgres, plus other databases
Sync directionOne-way or two-wayTwo-way sync, direction set per table
Depends on staying on HerokuYesNo
Who it suitsApps that will stay on HerokuApps 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:

Five stages: inventory, sync the app to Build, validate on Build, move the database, hand over the sync
  • 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_URL still 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_url where 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 old DATABASE_URL cannot 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.

Book a Stacksync demo: move off Heroku Connect and keep Salesforce in sync

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.

Keep Salesforce flowing after Heroku with two-way sync

FAQ

Frequently asked questions

Does Heroku Connect work with a database outside Heroku?
No. Heroku Connect syncs Salesforce with Heroku Postgres. If you move your database to another provider, you need a different way to sync Salesforce.
Can I keep Heroku Connect running during the migration?
Yes, and we recommend it. Keep Heroku Connect running against Heroku Postgres while you validate or run the app on Build. When you move the database, validate the replacement sync and coordinate the handover so only one connector owns production writes to Salesforce.
Does Stacksync support two-way sync like Heroku Connect?
Yes. Stacksync offers real-time, two-way sync between Salesforce and Postgres, and you can choose the direction per table.
Will I need to change my application code?
Possibly. Code that relies on Heroku Connect's own columns, schema names or trigger log table needs review. We look for those references at the start of the project so there are no surprises later.

About the author

Build.io team
Build.io team
Build.io

The team behind Build.io, a managed application platform for teams moving off Heroku. Build partners with Stacksync on migrations where the app depends on Salesforce data.

All posts by Build.io team

About Stacksync

Stacksync powers real-time, two-way sync between CRMs, ERPs, and databases. Engineers sync data at scale and automate workflows, not dirty API plumbing.

Coworkers laughing in front of a laptop in a casual office setting

You just read how it should work.
See it run on your own data.