8 months ago
I've been using a Strapi template, and everything worked fine for six months. Recently, I noticed that all the content I had added in the Strapi admin panel disappeared (and there was quite a lot of it).
I found out that PostgreSQL now requires several environment variables to be explicitly set — for example, the value from POSTGRES_PASSWORD had to be duplicated in PGPASSWORD, among others. After adding these variables and redeploying the project, my entire database was gone.
Please help me understand what happened and how I can recover my data.
2 Replies
8 months ago
Likely cause: Railway created a new PostgreSQL service when you added those environment variables, disconnecting from your original database (which probably still exists with your data).
Possible Options you can follow -
Check Railway dashboard for multiple PostgreSQL services - your data is likely in the old one
Look for backups/snapshots in your database service settings (Railway has automatic backups for volumes)
Try reverting to your original environment variables and redeploy
railway logs --service your-database-service,railway logs --service your-strapi-servicein railway cliCheck what databases exist in your project
\l\dt