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

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.

$10 Bounty

3 Replies

nhatphatt
FREE

8 months ago

The loss of data after redeploying is usually because Strapi is now connecting to a completely new database, not the original one that contained your content. This often happens when you change or add environment variables (like POSTGRES_PASSWORD, PGPASSWORD, etc.), causing Strapi to no longer access the correct database.

Your data is very likely still there — Strapi just isn’t connected to the right place. You should check your old database connection settings in the .env file or on your hosting provider's dashboard (Railway, Supabase, etc.) and update them accordingly. After that, redeploy the project and your data should reappear.


sim
FREE

8 months ago

(and there was quite a lot of it).

Check your volume size to see if the data is still there?


sim
FREE

8 months ago

and everything worked fine for six months

Did you ever restart the application in that time? Data being gone is symptomatic of faulty volume configuration


Loading...