Production database dropped by shadow-database-url mistake
azarapersi
FREEOP

a month ago

My production Postgres database (railway.internal, project on maglev.proxy.rlwy.net:55673) was completely dropped a few minutes ago.

Cause: I ran npx prisma migrate diff --from-migrations prisma/migrations --to-schema-datamodel prisma/schema.prisma --shadow-database-url "<production DB URL>" — mistakenly passing my PRODUCTION database URL as the --shadow-database-url parameter. Prisma resets/drops the database passed as shadow-database-url before running the diff. This deleted all tables in my production database.

Current state: 0 tables in the public schema. No _prisma_migrations, no application tables. Before this happened, the database was healthy with 66 applied migrations.

I do NOT have the Pro plan, so I have no automatic backups available in the dashboard.

Request: Is there ANY way to recover this data at the infrastructure/volume level — even without Pro plan backups? This is critical production data for a live business. Any snapshot, disk-level backup, or recovery option would be enormously helpful. Please treat this as extremely urgent.

Project: sistema-erp

Service: Postgres (production)

Solved

1 Replies

Railway
BOT

a month ago

Our databases are unmanaged at the DB layer, so automatic snapshots, WAL archiving, and PITR aren't available to recover your data. We're not able to restore data lost to user-initiated actions. Going forward, you can enable volume backups on your stateful services from the service Settings page (available on Hobby and Pro) so you have a self-restore option if something like this happens again.


Status changed to Awaiting User Response Railway about 1 month ago


Railway
BOT

a month ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway about 1 month ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...