R
Railway5mo ago
kane

Postgres Db migration issues

I've been trying to migrate my db but it keeps stoping when it gets to the migrating step, i did not make any extra configuration and my project env is already lithered with so many migrations, how do i fix this please
No description
No description
No description
No description
65 Replies
Percy
Percy5mo ago
Project ID: 4713c1f6-1710-4e59-bfc6-2aaa0aaea3e0
kane
kane5mo ago
4713c1f6-1710-4e59-bfc6-2aaa0aaea3e0
Brody
Brody5mo ago
lets get back to a clean slate, delete these services / volumes
No description
Brody
Brody5mo ago
hey @kane - did you ever get a successful migration?
kane
kane5mo ago
Hello No I didn’t
Brody
Brody5mo ago
did you have time to try to work through this?
kane
kane5mo ago
Yes please I’m opening raway
Brody
Brody5mo ago
can you send me a new screenshot of your project?
kane
kane5mo ago
okay
kane
kane5mo ago
i get this when i try to delete one of the migrations , its a production db and i cant risk to loose my data
No description
No description
Brody
Brody5mo ago
slow down there, click here and then click discard changes
No description
Brody
Brody5mo ago
id like another screenshot of your project so i can be absolutely sure that my above screenshot is still correct
kane
kane5mo ago
okay... i discarded as requested
No description
Brody
Brody5mo ago
okay you are not slowing down lol
kane
kane5mo ago
now i'm confused on whihc is my real db, but my instinct says it's the one on the bottom right end lol ... no changes made
Brody
Brody5mo ago
you would unfortunately be wrong, the original database is on the left what database variables are you using in code?
kane
kane5mo ago
see the one i mentioned have the variable section and the legacy doesn't
No description
No description
Brody
Brody5mo ago
yeah the legacy database is an entirely different old system, thats why you need to migrate away from it think you could let me know this?
kane
kane5mo ago
what info can i give you, or should i reveal the values to you? i dont get the request sorry
Brody
Brody5mo ago
what environment variables are you using in code for your database? maybe DATABASE_URL?
kane
kane5mo ago
no i use the normal db configs to connect to the backend (PGPORT, PGUSER, PGHOST, PGDATA...)
kane
kane5mo ago
thats connection to the backend service
No description
Brody
Brody5mo ago
if you clicked edit on one of those, would it contain a reference like ${{Postgres Legacy.PGHOST}} specifically legacy
kane
kane5mo ago
okay let me check
kane
kane5mo ago
this is my service revealed
No description
Brody
Brody5mo ago
if you clicked edit on one of those...
kane
kane5mo ago
this was the one i thought it was , i was wrong perhaps 😦
No description
kane
kane5mo ago
this is the one you agreed is , i think it has the same settings
No description
kane
kane5mo ago
with my service
Brody
Brody5mo ago
sorry, i should have been more clear, this question is asking about the database variables on your apps service
kane
kane5mo ago
okay i'd send them
kane
kane5mo ago
wow,
No description
kane
kane5mo ago
its the legacy
Brody
Brody5mo ago
okay thats good and to double check, we are looking at the raw editor for your accountGig service?
kane
kane5mo ago
yes sir
Brody
Brody5mo ago
okay okay we doing good
Brody
Brody5mo ago
you can safely delete everything shown in red
No description
kane
kane5mo ago
alright doing that now
kane
kane5mo ago
@Brody we've got this left
No description
kane
kane5mo ago
it's fine yea
Brody
Brody5mo ago
you didnt delete the v2 postgres database?
kane
kane5mo ago
i mean the dude on the bottom right has got no issues 😄
Brody
Brody5mo ago
dude on the bottom right? im not sure i follow? dude == postgres service?
kane
kane5mo ago
sorry, bad humor, i meant this postgres service
No description
Brody
Brody5mo ago
but we dont want that dude or that dude's volume you confirmed that your service is not using it, it will only get in tha way
kane
kane5mo ago
alright he's going then 🚮
kane
kane5mo ago
Done. But we got this "mount" action up ther
No description
Brody
Brody5mo ago
^
kane
kane5mo ago
oh thats the volume 🤔
Brody
Brody5mo ago
yep
kane
kane5mo ago
ok so i'm to mount? click it i mean?
Brody
Brody5mo ago
delete it
kane
kane5mo ago
oh
kane
kane5mo ago
done
No description
Brody
Brody5mo ago
rename that database to just Postgres
kane
kane5mo ago
okay
kane
kane5mo ago
done
No description
Brody
Brody5mo ago
now run the migration again
kane
kane5mo ago
okay
kane
kane5mo ago
t'was successful, didn't get to this point initially
No description
Brody
Brody5mo ago
let me know if your app works as it should after it deploys
kane
kane5mo ago
okay it does thank you so much
Brody
Brody5mo ago
now you can go throught the data and confirm everything made it over, then delete your legacy database when you are absolutely sure its safe
kane
kane5mo ago
oh okay ,, thanks again man!
Brody
Brody5mo ago
no problem!