R
Railway11mo ago
mattey

Quick Question "Warning: Hard coded connection URL detected"

I have migrated my database, Now the legacy plugins display this message: "Warning: Hard coded connection URL detected". Should I use the updated database's *_url connections?, The thing is some data have been added to the legacy databases since, i did not update to the NEW *_url connections. If I use the new connection url, will I have the new data in the updated DB, I added since the migration? Note: The reason I did not update to the new connection was because, during the automatic migrations it stated something like updating the 'url_link (not specifically this but something like this), to the new database. thanks.
50 Replies
Percy
Percy11mo ago
Project ID: 0c7fec98-322c-4deb-ac9d-d61c6c0278bf
mattey
matteyOP11mo ago
project id: 0c7fec98-322c-4deb-ac9d-d61c6c0278bf
Brody
Brody11mo ago
i would recommend using reference variables https://docs.railway.app/guides/variables#referencing-another-services-variable then re-running the migration
mattey
matteyOP11mo ago
where can i find the previous DB's service name, in the doc it says Clickhouse I have attached an image of my projects services.
No description
No description
Brody
Brody11mo ago
right from your screenshot, it's Postgres Legacy
mattey
matteyOP11mo ago
So it should be something like this, right, DATABASE_URL=${{ Postgres_Legacy.DATABASE_URL }} in my migrated DB. with an underscore instead of a space.
Brody
Brody11mo ago
1. that variable would be set in your apps service 2. no? the legacy database's name doesn't have an underscore
mattey
matteyOP11mo ago
Sorry the variable would go the apps services, my bad. what i want to clarify is, after the DB migration, whenever my app sends data to the backend, the data will be saved in the Migrated DB as well as in the Legacy Db for the time being until it is discontinued?
Brody
Brody11mo ago
the app will save data into whatever database it is connected to, it's only going to connect to one database at a time
mattey
matteyOP11mo ago
I see, since I did not connect the new DB after the successful migration, there are 5 days of data saved in them, is there a way i could do another migration from my legacy DB to the updated DB from railways end?
Brody
Brody11mo ago
nothing needs to be done from railways end, this is all something you are able to do from your account. let's walk through re-running a migration are you using reference variables now?
mattey
matteyOP11mo ago
not yet.
Brody
Brody11mo ago
please go ahead and do that, reference the legacy database
mattey
matteyOP11mo ago
is this correct?:
No description
Brody
Brody11mo ago
nope, the docs link i sent shows the exact syntax
mattey
matteyOP11mo ago
this one? this is from my app services, i will delete the duplicated one once confirmed.
No description
Brody
Brody11mo ago
looks good to me
mattey
matteyOP11mo ago
so m deleting the old DATABASE_URL and continuing withe the new one.
Brody
Brody11mo ago
correct
mattey
matteyOP11mo ago
done
Brody
Brody11mo ago
your app has redeployed and it is working?
mattey
matteyOP11mo ago
yep
Brody
Brody11mo ago
great, delete the new database the migration made
mattey
matteyOP11mo ago
ok, m deleting the legacy DB. sorry M deleting the new one
Brody
Brody11mo ago
damn you nearly made my heart skip a beat
mattey
matteyOP11mo ago
pls wait a sec, m backupping the Legacy DB to my local system, just in case.
Brody
Brody11mo ago
haha good idea
mattey
matteyOP11mo ago
Done, backed up my Legacy DB to my local machine, and Deleted the New DB created by migration in Railways end.
Brody
Brody11mo ago
show me a screenshot of your project just so where on the same page?
mattey
matteyOP11mo ago
No description
mattey
matteyOP11mo ago
iv just deleted the Postgres DB, nothing else.
Brody
Brody11mo ago
delete the stray volume
mattey
matteyOP11mo ago
ok done.
Brody
Brody11mo ago
rename your legacy database to just Postgres this won't break that reference, the reference will be dynamically updated
mattey
matteyOP11mo ago
sorry where can i find the rename options,
Brody
Brody11mo ago
in its settings
mattey
matteyOP11mo ago
Thanks, Done.
Brody
Brody11mo ago
rerun the migration
mattey
matteyOP11mo ago
migrating.... migrations finished, Deploying...... Finished, should i connect the new DB's DATABASE_URL to my app?
Brody
Brody11mo ago
the migration does that for you, click on the eye icon of that variable in your app to confirm
mattey
matteyOP11mo ago
yep seems both are the same so if I want to update the REDIS_URL, the same procedure should be followed right?
Brody
Brody11mo ago
yep exact same thing
mattey
matteyOP11mo ago
Thanks for the instruction.
Brody
Brody11mo ago
no problem, anything else you need help with?
mattey
matteyOP11mo ago
think m good, cannot find MARK SOLUTION in the right click 'Apps' though.
Brody
Brody11mo ago
users can no longer do that, sorry marking a single message as the solution would also not fit this thread because it was solved via conversation and not by one singular message
mattey
matteyOP11mo ago
That is true, one more question, in the updated Redis, the port changed from: 7047 to 43786 right?
Brody
Brody11mo ago
yep that looks right, but as long as you are using reference variables, you dont need to worry about the port
mattey
matteyOP11mo ago
thanks.
Brody
Brody11mo ago
no problem!
Want results from more Discord servers?
Add your server