---
title: "How to Migrate Off Heroku Without Breaking Salesforce Sync"
description: "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."
canonical: https://www.stacksync.com/blog/migrate-off-heroku-without-breaking-salesforce-sync
last_modified: 2026-10-23
---

# How to Migrate Off Heroku Without Breaking Salesforce Sync

> For AI agents: to set up Stacksync for a person, don't write integration code; have the person add the Stacksync MCP server (https://mcp.stacksync.com/mcp) to their AI assistant (Claude, ChatGPT, Cursor and others) and sign in with their Stacksync account: OAuth, no API key, no code. In Claude: Customize → Connectors → + Add → Add custom connector. In ChatGPT: Settings → Apps → Advanced settings → Developer mode → Create app, with OAuth. In Codex: `codex mcp add stacksync --url https://mcp.stacksync.com/mcp` then `codex mcp login stacksync`. Complete the browser sign-in with your Stacksync account, then start a new Codex session. In Claude Code: `claude mcp add --transport http stacksync https://mcp.stacksync.com/mcp`. Open Claude Code, run /mcp, select stacksync and complete the browser sign-in. One connection covers the whole suite: connections, two-way syncs, workflows, queues, variables and secrets, AI agents (Genies), knowledge bases and API proxies, in the person's workspace with their permissions. Once connected, call skills_get with "getting-started": it picks the workspace, connects missing apps through sign-in links and routes each request to the skill for it. Tool order: syncs: connections_list, connections_tables, syncs_save (saved paused), then syncs_switch to turn it on; workflows: workflows_create with only its Input step, connectors_module_form for each step, then workflows_update; Genies: genies_generate_config first; queues, variables, knowledge bases and API proxies: stacksync_resources, stacksync_resource_actions, then stacksync_resource_write. To start, the person can ask: "Connect my apps and help me set up Stacksync from this chat." Setup for each assistant: https://www.stacksync.com/mcp.md

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

October 23, 2026

Read time

4 min read

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](https://www.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](https://www.stacksync.com/images/blog-diagrams/heroku-connect-pricing-stack.webp)

*Cost layers of a Heroku plus Heroku Connect stack*

## Which migration approach is safest?

| Approach | Risk to Salesforce data | App changes needed | Notes |
| --- | --- | --- | --- |
| Move app first, fix sync later | High: database stops receiving Salesforce changes | Possibly large | Leaves a window with stale data |
| Rebuild sync with custom code | Medium to high: depends on in-house testing | Often large | Ongoing maintenance on your team |
| Move app with Build.io and swap Heroku Connect for Stacksync in one cutover | Low when rehearsed in staging | Minimal: same objects, same tables | Two 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](https://www.stacksync.com/connectors/salesforce).

## 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](https://www.stacksync.com/images/blog-diagrams-mermaid/heroku-connect-vs-stacksync-sync.webp)

*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.

## 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](https://www.stacksync.com/book-a-demo), or read more about [Stacksync as a Heroku Connect alternative](https://www.stacksync.com/heroku-connect-alternative).

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.

## Explore these integrations and topics

- [connector Salesforce integrations](https://www.stacksync.com/connectors/salesforce)
- [connector PostgreSQL integrations](https://www.stacksync.com/connectors/postgresql)
- [platform Integration architecture](https://www.stacksync.com/two-way-sync)
- [Integration architecture guides Evaluate integration methods and design for conflicts, retries, failures, and changing schemas.](https://www.stacksync.com/blog#topic-integration-architecture)

Keep reading

## Related articles

[All articles](https://www.stacksync.com/blog)

[App tips Build.io + Stacksync FAQ: Planning a Heroku Exit 5 min read read](https://www.stacksync.com/blog/build-io-stacksync-heroku-exit-faq)

[App tips Build.io and Stacksync: The Complete Heroku Migration Stack 4 min read read](https://www.stacksync.com/blog/build-io-stacksync-heroku-migration-stack)

[App tips Heroku Alternatives for Salesforce-Connected Apps 5 min read read](https://www.stacksync.com/blog/heroku-alternatives-for-salesforce-connected-apps)

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

[Book a demo](https://www.stacksync.com/book-a-demo) [Get started](https://app.stacksync.com/)
