The short answer
There is no automatic synchronization. A Replit Deployment runs as a separate environment from your development workspace, and the database your workspace code talks to is not mirrored into the deployed instance. The zero-downtime routing switch Replit performs covers traffic, not data — when the deployment takes over, it connects to whatever database its own environment configuration points at, which may be a different store, an empty one, or nothing at all.
What's confirmed vs. likely
Confirmed behavior (well-established): Deployments package your code into a separate build with their own environment variables and secrets. Secrets set in the workspace do not carry over automatically — you must re-enter them in the deployment configuration. If your app reads a connection string like DATABASE_URL, the deployment will use whatever value its environment holds.
Likely explanation for the gap you're seeing: one of three things — (1) the deployment is missing the database secret entirely, so it connects to nothing; (2) it has a different connection string, so it connects to a fresh or wrong database; or (3) you're using Replit's built-in key-value Database, which is tied to the Repl/workspace rather than being a shared production store. Exact provisioning behavior is plan- and version-sensitive, so treat this as the hypothesis to verify, not settled fact.
How to verify which case you're in
From the deployed app, run a trivial read and compare with the workspace:
-- e.g., in a temporary route or startup log
SELECT count(*) FROM some_known_table;
If the counts differ (or the query fails), the two environments point at different stores. Also inspect the deployment's configured secrets and confirm the connection string matches the database you intend to be production.
The reliable pattern
- Pick one production database as the source of truth — typically a provisioned PostgreSQL instance whose connection string is stored as a deployment secret, never hardcoded.
- Apply schema through versioned migrations, not ad-hoc edits in the workspace shell. Manual table changes made in development never propagate; only repeatable migration scripts run against the production database do.
- Seed reference data explicitly rather than copying dev data.
- If you genuinely need dev data in production, do it as a deliberate one-time operation: dump from the development database, back up the production database first, then restore. This is a migration event, not an ongoing sync mechanism.
Consistency during the routing switch
There is no platform mechanism that reconciles data between workspace and production at cutover time. Consistency comes from architecture, not the deploy: because both environments can hold a connection string, the simplest consistent setup is to have the deployment and (optionally) the workspace point at the same production database, so there is nothing to synchronize. If you run migrations at deploy time, order them so the old code tolerates the new schema briefly (additive changes first), since a long migration during the switch can leave the app serving against a partially migrated schema.
One caveat
Replit's deployment and database offerings have changed over time, and whether a database is shared or per-environment depends on your plan. Confirm the current environment-separation model in Replit's documentation before finalizing your setup — and always back up production before any restore.