My Hobby plan expired and less than a month later I have resubscribed but my apps shows removed
Both Strapi and Postgres. How can I reactivate them?
63 Replies
Project ID:
7f64daff-585a-4948-99d9-3722f6dfefe5
7f64daff-585a-4948-99d9-3722f6dfefe5
redeploy postgres first
In progress fingers crossed
Both restored, but the data is not there
how have you verified that the data isnt there?
I opened my strapi application and there is no data
is the data in the database?
No
where you running strapi in development mode?
The DB variables are in the application
Should be linked
Yes in development
then data is not written to the database
im sorry to say but the data is likely gone, you should have ran strapi in production mode
Its okay, I have a db dump, is there a way I can restore it?
how did you take the db backup?
Through pg_dump -U railway -h
Asking if there is a way in the ui itself
nope no native database restore, you would need to use pg_restore
Thank you @Brody
Let me try that and hopefully all will be good
going forward, please only run strapi in production mode when on railway
sure thing
In the pg restore, should I use the db URL starts with postgres:... or the project url?
the database url
Is it this one proxy.rlwy.net
....proxy.rlwy.net
As I used this last time for the dump
yep it would include that in the url
Btw why I am getting the error in the above screenshot?
While both db and app variables show in both sides
no clue, the data tab is not reliable
Understood
Thanks again
Got errors for all tables, already exists!
interesting
I guess it means these tables already exists and no changes made to override!? Typically pg_restore should delete existing and replace it with the dump
pg_restore: from TOC entry 3392; 1259 16501 INDEX upload_files_folder_path_index railway
pg_restore: error: could not execute query: ERROR: relation "upload_files_folder_path_index" already exists
Command was: CREATE INDEX upload_files_folder_path_index ON public.files USING btree (folder_path);
then what is going on with strapi
Weird
Did a rollback to the previous last month's deployment
Let's see
Same same 😦
check the database's table manually with desktop software like dbgate
restarting starpi could have just caused it to create a migration with empty tables, you might need to overwrite them
Checking now
is your data in them
Yes
run strapi in production mode then
Man I love railway, very efficient. The only challenge I am facing is in the environments, tried setting up both environments but ran into many issues
it may be more intuitive with staged changed turned on https://railway.app/account/feature-flags
Still no data in production mode
is strapi connecting to the correct database?
It should be, last time it ran it was connected
On graphql playground, I can't find my data queries
So its not
then I'm not actually sure what's going on, I don't use strapi myself
maybe strapi has a community you could ask in?
railway isn't adding any real magic to the setup, it's a postgres docker image and strapi running in a container
I am sure there is a problem in connecting both services
But as you said, it probably from strapi configurations side
well are there any error logs in the strapi deployment?
No!
im out of ideas
Its allright, let me playaround and figure it out
sounds good, let me know if you find out anything!
@Brody my dump is very good and contains all the required data. The only issue is I am unable to restore it as there is no “railway role” which was the user who created the dump
Is there a way to change a postgres service role/user name?
if you application works without, you can leave it at that
The db created has a role called postgres, I want to change that role name, is there a way?
When I edited through the variables view, it throws authentication error
But still success with connecting using the postgres, which means changing the role name didn't take effect
imports will display errors because it could not execute the line that changes the owner/role
but the other parts wont fail bcause of that
Didn't get you tbh
Is there a way to change the roles for a postgres deployed service?
if you run an import/restore it will execute all lines in the provided file
it will continue the job eventho errors occure
so if you have a role change or something, it will just give you an error and continue with the next line of the import
resulting in no dataloss or anything weired
its probably fine to leave it like this
other option is to make the desired role(s) yourself within postgres but it wont do much
Ok
Thank you
All errors
Restored the db on other postgres instances and restored successfully
Even locally, restored without a single error or warning
seems like the db is not empty, the restore will asume that there is nothing blocking in its way
so you have 2 options, create a new DB and restore it into there
and no data
seems like there is data, otherwise it would not say that the fk relation already exists
Oh let me try that
Yes created a new one and restored successfully
I was nervous because of this 'role doesn't exist' error and thought it would jeobradaize (however its spelled :D) the data integrity
i get it but lucky it doesnt 🙂