Replit database empty after publish
Rows you saved in the Replit editor are missing on the published app? The published app uses a separate production database. Preview keeps using development.
Reviewed October 17, 2026
What it means in plain English
The Database tool in the editor shows your rows. The published URL does not. Replit gives every app two databases. The development database is what you and Agent use while building. The production database is what the published app reads. After you publish, the editor keeps using development, so later edits there do not change live rows.
Agent can change the development database. Agent cannot change the production database. When you publish, structure changes Agent made on development (added or deleted columns or tables) are applied to production.
You can edit production rows yourself: open the Database tool, select the production database, open My Data, and turn on Edit.
Likely causes
- You are looking at development data and the published app is reading production. They are separate. On current Helium infrastructure, Replit creates the production database when you publish, if the development database contains data. The docs describe that as a new production database, and the copy-into-production switch is documented for legacy Neon, not as an automatic Helium row copy.
- The app still uses a legacy Neon development database. Replit says you create production from the publish settings: Production database settings, turn on Create production database, and optionally turn on Set up your production database with your current development data. Copy development data only when that data is safe to show to real users. It can include test accounts and sample rows. Copying overwrites existing production data.
- Check which infrastructure you have in the Database Settings tab. A
DATABASE_URLcontainingneon.techis legacy Neon.heliumis current. Before December 4, 2025, development databases were on Neon. Under that older publishing workflow, development and production shared one database. - A forked or remixed app kept another app's
DATABASE_URL. Replit says shared legacy databases were shut down on June 8, 2026. If the published app lost access to its data, the fix is a production database of its own. Use the guide if the published app shows database connection errors, or ifDATABASE_URLin Secrets still points atneon.tech. - The "missing" data was files on disk. The published filesystem is not persistent and resets every time you publish. Replit says to store that data in a database or storage service.
A published URL that will not boot at all is a different page. See Replit app works in preview but not when published.
How to fix it, step by step
- In the Database tool, open the production database and My Data. Compare those rows with the development database. The published app reads production.
- On a legacy Neon app, publish again with Create production database turned on. Turn on Set up your production database with your current development data only if those rows should be live. Replit sets the published
DATABASE_URLto that production database. You do not edit that secret by hand in this flow. - To change live rows without a copy, select the production database, open My Data, and turn on Edit.
- If this app was remixed from an app that had a database before January 9, 2026, or Secrets still has a
neon.techDATABASE_URL, compare URLs. In the source app, readNEON_DATABASE_URL, orDATABASE_URLif that secret is absent. In the published app, open Publishing, Adjust settings, Secrets, and readDATABASE_URL. The same value means the published app is still on the source app's shared Neon database. - If the Database panel in this app already shows the rows you need, republish with Create production database and Set up your production database with your current development data. Then open the published app and confirm the rows are there.
- If the Database panel does not show those rows, Replit's Case 2 is an export from the old URL. In the Shell:
pg_dump -Fc "database_url" --no-owner --no-privileges -f backup.dump
database_url is the source app's URL from the comparison above. If people are still writing data, Replit says to plan a short maintenance window first. An "external database detected" warning in the Database panel means the app is still pointed at another app's database.
- Delete the old
DATABASE_URLin the Secrets tool, then refresh. Replit says the app should then use its current development database. Import with:
pg_restore --clean --if-exists --single-transaction --no-owner --no-privileges --exit-on-error -d "$DATABASE_URL" backup.dump
If that fails because of custom roles or policies, Replit says the manual restore does not recreate those roles, and to contact support. When My Data shows the rows, repeat the republish in step 5.
- If the published app already has its own production database and the data is there, Replit says there is nothing else to do.
- Paste this to Agent:
The published app does not show the rows I see in the editor. Do not point the published app at the development database. Check whether DATABASE_URL is helium or neon.tech. On legacy Neon, republish with Create production database. Copy development data only if I say those rows are safe for production. If this is a remix still using a shared neon.tech database, follow Replit's shared-database cases before republishing.
How to check it worked
- A row created on the published URL is visible in the production database's My Data, and a row that exists only in development stays off the published URL.
- Publishing, Adjust settings, Secrets shows a
DATABASE_URLfor the production database, not the source app's shared Neon URL. - Files you need after the next publish are in the database or a storage service, not only on the published disk.
Sources
Related fixes
More Replit fixes
Keep going on your own.
The guides stay free. A deep leak report is $15. Fix packs are $24, or $49 for all three. There is no done-for-you repair.