a month ago
Question: How do you maintain staging/production database sync with Replit → GitHub → Railway?
My staging PostgreSQL constantly diverges from production causing auth failures. Using Drizzle ORM with separate Railway databases per environment.
Looking for:
Reliable migration workflow
Staging database sync strategies
Replit-to-Railway deployment patterns
What's your recommended setup?
1 Replies
a month ago
First off, you shouldn't be using data from your staging environment in your prod environment, or vice versa.
The staging environment exists to test and make sure all code merging into the prod environment is fully functional.
If one were to use prod database in a staging environment, one minor bug could result in a destroyed database.
If you really do want to use the prod database in staging, you could use the public URL (note that this would incur egress charges).
IIRC there isn't really a way to "sync" prod and staging database.