Strapi Admin Content Missing After PostgreSQL Environment Variable Changes and Redeployment
sasha
HOBBYOP

a year 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.

$10 Bounty

2 Replies

sasha
HOBBYOP

a year ago

f0906ca0-c156-4119-923e-fc7ac7a17e22


tomhagen
FREE

a year 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 -

  1. Check Railway dashboard for multiple PostgreSQL services - your data is likely in the old one
  2. Look for backups/snapshots in your database service settings (Railway has automatic backups for volumes)
  3. Try reverting to your original environment variables and redeploy
  4. railway logs --service your-database-service , railway logs --service your-strapi-service in railway cli
  5. Check what databases exist in your project \l\dt

Welcome!

Sign in to your Railway account to join the conversation.

Loading...