#Strapi/Postgres template data loss

29 messages · Page 1 of 1 (latest)

latent stirrup
#

My Railway account became frozen at the beginning of the month because the attached credit card got cancelled. I finally was able to put in a valid one today but when I went to check on one of my projects using Strapi and Postgres they were both down. I ran redeploy and when I started up Strapi all my data/settings are gone. I then checked my database and its been completely scrubbed. I had a close call like this last month when I did the recommended update to the database but I was able to recover most of the data from the legacy DB, now I can't access the legacy DB. What did I do wrong? is there a way for me to access the database before it was frozen now that my billing is up to date? Is there any way for me to get back the DB data?

obtuse harnessBOT
#

Project ID: N/A

lament oxide
#

what mode where you running strapi in?

latent stirrup
#

I was running it develop since I was still changing some of the collections.

lament oxide
#

on railway?

latent stirrup
#

yeah I was running develop mode on railway so that my coworkers could change some of the content types. Is this where I went wrong? Should I only ever run develop locally? I am more worried about the database, did the redeploy with strapi in developermode scrub the DB?

lament oxide
#

very likely something along those lines, this is far from the first report of users loosing data after having run strapi in development mode when on railway. going forward please use development mode locally and production when on railway

latent stirrup
#

Understood, won't make that mistake again lol. As far as the postgres DB goes, is there anyway to recover the old data? I had a very similar experience to this a couple of months ago after I updated the DB but was able to find the the backed up tables. Did Railway scrub these with their new DB change?

lament oxide
#

have you migrated?

latent stirrup
#

I did at the beginning of the year but it dropped all the tables. I ended up having to rebuild the DB based off of a backup of the original DB

lament oxide
#

so the legacy database is not involved in anyway?

latent stirrup
#

not anymore but its still in the dashboard with the option to delete previous migration and re-migrate. The database still has all the uploaded media and user permissions, just none of the tables I made

lament oxide
#

The database still has all the uploaded media and user permissions, just none of the tables I made
this referring to the new database, correct?

latent stirrup
#

yeah!

lament oxide
#

then yes this was a result of running in development mode on railway

latent stirrup
#

Alright much appreciated, you are a boss ty:)

#

Do you think re-migrating would bring back the old values?

lament oxide
#

you said the legacy database was not involved

latent stirrup
#

Oh sorry I thought you meant if it was still being accessed on the live server. The legacy database is what I originally build the site with

lament oxide
#

then you can try it, but no one but yourself is responsible if something goes wrong

latent stirrup
#

lol yup I only blame myself for getting into this mess. The re-migration is supposed to migrate the database and the data or just the databse structure?

lament oxide
#

everything

latent stirrup
#

epic

#

last thing

#

Not sure if you're the right person to ask but if I rebuild the strapi settings locally and commit it with production mode instead of develop would the redeploy cause the same situation?

lament oxide
#

as long as you stick to development mode locally, and have railway run strapi in production mode you will be fine, as that is the intended workflow

latent stirrup
#

roger that

#

I really appreciate all your help. You saved my weekend

lament oxide
#

happy to help!