Skip to content

Stacksync × Supabase Miami: AI-Native OperationsOct 13Reserve your spot

How to Migrate Off Heroku Without Breaking Salesforce Sync

Leaving Heroku while Salesforce data flows through Heroku Connect? Learn how to sequence the app move and the sync swap so no records are lost or duplicated.

Author
Stacksync · App tips writer
Published
Read time
4 min read
How to Migrate Off Heroku Without Breaking Salesforce Sync
APP TIPS

How do you migrate off Heroku without breaking Salesforce sync?

Treat the app move and the sync swap as one coordinated cutover. Move the app and Postgres with a platform partner such as Build.io, then replace Heroku Connect with a sync that writes to the same tables in the new database, like Stacksync. Freeze writes during the switch, match existing rows by Salesforce ID, and only then turn on two-way sync.

The rest of this guide explains where Salesforce sync usually breaks during a Heroku exit and how to avoid each failure.

Where does Salesforce sync break during a Heroku migration?

Heroku Connect runs inside Heroku and writes to a Heroku Postgres database. That coupling is convenient while you stay, and it is the main risk when you leave. Most breakages fall into four patterns.

  • The database moves, the sync does not. The new Postgres has the data as of the dump, but no new Salesforce changes arrive.
  • Writes are lost in the gap. Rows written by the app between the final dump and the new sync going live never reach Salesforce.
  • Duplicates appear. A new sync that does not recognize existing rows inserts every Salesforce record a second time.
  • Schema drift. Table or column names change, and application queries fail.

Each of these is a sequencing problem, not a technology problem. A clear order of operations prevents all four.

Cost layers of a Heroku plus Heroku Connect stack
Cost layers of a Heroku plus Heroku Connect stack

Which migration approach is safest?

ApproachRisk to Salesforce dataApp changes neededNotes
Move app first, fix sync laterHigh: database stops receiving Salesforce changesPossibly largeLeaves a window with stale data
Rebuild sync with custom codeMedium to high: depends on in-house testingOften largeOngoing maintenance on your team
Move app with Build.io and swap Heroku Connect for Stacksync in one cutoverLow when rehearsed in stagingMinimal: same objects, same tablesTwo specialists, one plan

The coordinated approach keeps the database contract stable. Your app sees the same tables before and after. For details on object coverage and sync options, see the Salesforce connector.

What are the steps to migrate safely?

  1. 01
    Export the Heroku Connect configuration
    Record every mapped object, field, sync direction and table name. This is your contract with the application.
  2. 02
    Stand up the target platform
    Build.io provisions the new environment and moves the app, workers and Postgres.
  3. 03
    Configure Stacksync in staging
    Connect a Salesforce sandbox and the staging database. Recreate each mapping with the same table and column names.
  4. 04
    Rehearse the cutover
    Run the full sequence in staging: freeze writes, move data, match records by Salesforce ID, enable sync, verify writebacks.
  5. 05
    Run the production cutover
    Pause app writes to synced tables, stop Heroku Connect, take the final database move, enable Stacksync, then reopen writes.
  6. 06
    Verify and monitor
    Compare record counts per object, test a create and update in each direction, and watch the sync dashboard for errors.
Two-way Salesforce and Postgres sync with Stacksync
Two-way Salesforce and Postgres sync with Stacksync

How do you prevent duplicates when the new sync starts?

Heroku Connect stores each record's Salesforce ID in the Postgres table. A replacement sync should use that ID to link existing rows to existing Salesforce records rather than inserting new ones. Stacksync matches on the Salesforce ID, so the first sync run updates rows in place.

Rule of thumb
Never enable two-way sync on a table that holds data until you have confirmed how existing rows will be matched.
Book a Stacksync demo

Who should be involved in the cutover?

A Heroku exit touches several teams, and the Salesforce sync sits between them. Bring each group in early so the cutover window is agreed in advance and nobody is surprised by a write freeze.

  • Engineering owns the application, the list of tables it reads and writes, and the go or no-go decision.
  • Salesforce admins confirm field mappings, validation rules and automation that may react to records written from Postgres.
  • Build.io owns the platform move: hosting, dynos, Postgres, add-ons and pipelines.
  • Stacksync owns the sync configuration, initial matching and enablement against the new database.
  • Business owners who rely on reports or services reading the synced tables are told when the freeze happens.

Salesforce automation deserves particular attention. Flows and triggers that fire on update can run when the new sync first touches existing records. Testing in a sandbox shows whether any automation needs to be paused during the initial run.

What should you check after cutover?

  • Record counts per object match between Salesforce and Postgres.
  • A record created in Salesforce appears in Postgres.
  • A row updated by the app appears in Salesforce.
  • No sync errors are open, or each open error has an owner.
  • Heroku Connect is disabled so two syncs are not writing at once.

Once production is stable, Build.io can retire the remaining Heroku resources. To review your Heroku Connect mappings with our team, book a demo, or read more about Stacksync as a Heroku Connect alternative.

Start syncing with Stacksync

FAQ

Frequently asked questions

Will moving my Heroku Postgres database break Heroku Connect?
Heroku Connect is tied to a Heroku Postgres database. When the database moves off Heroku, Heroku Connect cannot follow it, so you need a replacement sync that connects to the new database.
Can I keep my existing Heroku Connect table names?
Yes. Stacksync can sync the same Salesforce objects into the same Postgres tables, so application queries keep working after the move.
How do I avoid duplicate records during cutover?
Freeze writes to the synced tables during the cutover window, match existing rows to Salesforce records by their Salesforce ID, and only then enable two-way sync.
Who moves the app and who moves the sync?
Build.io moves the application and platform off Heroku. Stacksync replaces Heroku Connect with real-time, two-way Salesforce to Postgres sync.
Can I test the sync before production cutover?
Yes. Point Stacksync at a staging database and a Salesforce sandbox first, confirm counts and writebacks, then repeat the setup in production.
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.