Skip to content

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

Move Heroku Postgres Without Losing Salesforce Sync

How to move Heroku Postgres to a new platform while keeping Salesforce data in sync during cutover, using Build.io for the app and Stacksync for the sync.

Author
Stacksync · App tips writer
Published
Read time
5 min read
Move Heroku Postgres Without Losing Salesforce Sync
APP TIPS

How do you move Heroku Postgres and keep Salesforce in sync?

Treat the database move and the Salesforce sync as two linked tasks. Move the app and Postgres with Build.io, stand up Stacksync's two-way sync against the new database before cutover, and switch traffic only after the new sync has caught up and passed checks.

The reason is simple: Heroku Connect is tied to Heroku Postgres. When the database leaves Heroku, the sync has to be replaced, and the safest time to do that is before users notice anything changed.

Why does Salesforce sync break when Heroku Postgres moves?

Heroku Connect is a Heroku add-on. It reads and writes Salesforce objects into a schema inside a Heroku Postgres database, usually named salesforce, and tracks changes with its own trigger and log tables. That design works while everything lives on Heroku. It does not travel.

If you dump and restore the database somewhere else, you get a copy of the synced tables but not the process that keeps them current. Records written in Salesforce after the dump never arrive. Rows your app writes to the copied tables never reach Salesforce. The data looks fine on day one and drifts from there.

The common mistake
Teams often schedule the platform move first and leave the sync for later. That leaves a window where the app runs on new infrastructure with a frozen copy of Salesforce data. Plan the sync replacement into the same cutover.
Heroku Connect compared with Stacksync
Heroku Connect compared with Stacksync

What should you inventory before the move?

Before touching the database, write down what Heroku Connect actually does for you today. Most teams find the list is longer than they remembered.

  • Every mapped Salesforce object and the fields on each mapping.
  • Which mappings are read-only and which are read-write.
  • Tables, columns and indexes your app queries directly in the Heroku Connect schema.
  • Any app logic that depends on Heroku Connect system columns, such as the record state or external ID columns.
  • Jobs, reports or other services that read the same tables.
  • How often the business expects changes to show up on each side.

This inventory becomes the spec for the replacement sync. If the new tables keep the same shape, application changes stay small.

Who handles which part: Build.io or Stacksync?

The work splits cleanly along the line between platform and data sync.

AreaBuild.ioStacksync
Application hosting and dynosMoves the app off HerokuNot involved
Postgres databaseMoves the database tier off HerokuConnects to the new database
Add-ons and pipelinesMoves platform pieces off HerokuNot involved
Salesforce to Postgres syncNot involvedReplaces Heroku Connect with two-way sync
Other CRMs and ERPsNot involvedSyncs HubSpot, NetSuite and others with Postgres
CutoverSwitches app trafficConfirms sync health before and after

Because the two pieces are independent, each team can test its part without waiting on the other, and the joint plan only has to agree on the cutover date.

Heroku migration topology: app moves to a new platform while Stacksync keeps Salesforce and Postgres in sync
Heroku migration topology: app moves to a new platform while Stacksync keeps Salesforce and Postgres in sync

What are the steps for a clean cutover?

  1. 01
    Map the current Heroku Connect schema
    Export the list of mapped objects, fields and directions. Note every table and column the app reads.
  2. 02
    Provision the new Postgres database
    Build.io sets up the target platform and database. Keep table and column names compatible with the Heroku Connect schema.
  3. 03
    Connect Stacksync to Salesforce and the new database
    Use the <a href="/connectors/salesforce">Salesforce connector</a> and a Postgres connection. Configure each object as one-way or two-way to match what Heroku Connect did.
  4. 04
    Run the initial load and let it catch up
    Stacksync backfills the Salesforce records into the new tables. Leave Heroku Connect running on the old database so production is unaffected.
  5. 05
    Validate counts and sample records
    Compare record counts per object and spot-check field values. Test a write from Postgres to Salesforce and from Salesforce to Postgres.
  6. 06
    Switch application traffic
    Point the app at the new database through Build.io. Watch sync activity for errors in the first hours.
  7. 07
    Retire Heroku Connect
    Once the new setup is stable, turn off the Heroku Connect mappings and remove the add-on.
Book a Stacksync demo

How do you validate Salesforce data during cutover?

Validation does not need special tooling. It needs a short checklist that someone owns.

Counts per object

For each mapped object, compare the number of records in Salesforce with the rows in the new Postgres table. Differences usually point to filters, deleted records or fields that failed to map.

Field-level samples

Pick a handful of records per object, including recently edited ones, and compare field values on both sides. Pay attention to picklists, dates, time zones and lookup IDs.

Write tests in both directions

Create or update a test record from the app and confirm it lands in Salesforce. Do the reverse from Salesforce. This is the check that catches permission and field-level security issues.

What changes after Heroku Connect is gone?

The day-to-day work of the app stays the same: it reads and writes Postgres tables. What changes is the sync engine behind those tables. Stacksync reads changes from Salesforce and the database and applies them to the other side, so engineers stop maintaining trigger logs or polling jobs.

Teams also gain the option to sync more than Salesforce. If sales runs on HubSpot or finance runs on NetSuite, those systems can sync into the same Postgres database. For a full comparison with Heroku Connect, see our Heroku Connect alternative page.

If you are planning a Heroku exit and want to walk through your current mappings, book a demo and bring your list of objects.

Start syncing with Stacksync

FAQ

Frequently asked questions

Can I move Heroku Postgres and keep Heroku Connect running?
Heroku Connect syncs Salesforce with a Heroku Postgres database, so once the database leaves Heroku, Heroku Connect cannot follow it. Plan to replace the sync as part of the database move rather than after it.
Do I need to change my application code when the sync changes?
Usually less than teams expect, if the new sync writes to tables with the same names and columns your app already reads. Map the existing Heroku Connect schema first and keep it stable through cutover.
What does Build.io handle in a Heroku Postgres move?
Build.io moves the application and the platform it runs on off Heroku, including the database tier. Stacksync handles the Salesforce sync that Heroku Connect used to provide.
How do I know the Salesforce data is correct after cutover?
Compare record counts and a sample of field values per object between Salesforce and the new Postgres tables, then test writes in both directions before you switch traffic.
Does Stacksync only work with Salesforce?
No. Stacksync syncs Postgres with CRMs and ERPs including Salesforce, HubSpot and NetSuite, so the same setup can cover systems Heroku Connect never supported.
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.