R
Railway10mo 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
Percy10mo ago
Project ID: 0c7fec98-322c-4deb-ac9d-d61c6c0278bf
mattey
mattey10mo ago
project id: 0c7fec98-322c-4deb-ac9d-d61c6c0278bf
Brody
Brody10mo ago
i would recommend using reference variables https://docs.railway.app/guides/variables#referencing-another-services-variable then re-running the migration
mattey
mattey10mo 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
Brody10mo ago
right from your screenshot, it's Postgres Legacy
mattey
mattey10mo 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
Brody10mo ago
1. that variable would be set in your apps service 2. no? the legacy database's name doesn't have an underscore
mattey
mattey10mo 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
Brody10mo 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
mattey10mo 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
Brody10mo 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
mattey10mo ago
not yet.
Brody
Brody10mo ago
please go ahead and do that, reference the legacy database
mattey
mattey10mo ago
is this correct?:
No description
Brody
Brody10mo ago
nope, the docs link i sent shows the exact syntax
mattey
mattey10mo ago
this one? this is from my app services, i will delete the duplicated one once confirmed.
No description
Brody
Brody10mo ago
looks good to me
mattey
mattey10mo ago
so m deleting the old DATABASE_URL and continuing withe the new one.
Brody
Brody10mo ago
correct
mattey
mattey10mo ago
done
Brody
Brody10mo ago
your app has redeployed and it is working?
mattey
mattey10mo ago
yep
Brody
Brody10mo ago
great, delete the new database the migration made
mattey
mattey10mo ago
ok, m deleting the legacy DB. sorry M deleting the new one
Brody
Brody10mo ago
damn you nearly made my heart skip a beat
mattey
mattey10mo ago
pls wait a sec, m backupping the Legacy DB to my local system, just in case.
Brody
Brody10mo ago
haha good idea
mattey
mattey10mo ago
Done, backed up my Legacy DB to my local machine, and Deleted the New DB created by migration in Railways end.
Brody
Brody10mo ago
show me a screenshot of your project just so where on the same page?
mattey
mattey10mo ago
No description
mattey
mattey10mo ago
iv just deleted the Postgres DB, nothing else.
Brody
Brody10mo ago
delete the stray volume
mattey
mattey10mo ago
ok done.
Brody
Brody10mo ago
rename your legacy database to just Postgres this won't break that reference, the reference will be dynamically updated
mattey
mattey10mo ago
sorry where can i find the rename options,
Brody
Brody10mo ago
in its settings
mattey
mattey10mo ago
Thanks, Done.
Brody
Brody10mo ago
rerun the migration
mattey
mattey10mo ago
migrating.... migrations finished, Deploying...... Finished, should i connect the new DB's DATABASE_URL to my app?
Brody
Brody10mo ago
the migration does that for you, click on the eye icon of that variable in your app to confirm
mattey
mattey10mo ago
yep seems both are the same so if I want to update the REDIS_URL, the same procedure should be followed right?
Brody
Brody10mo ago
yep exact same thing
mattey
mattey10mo ago
Thanks for the instruction.
Brody
Brody10mo ago
no problem, anything else you need help with?
mattey
mattey10mo ago
think m good, cannot find MARK SOLUTION in the right click 'Apps' though.
Brody
Brody10mo 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
mattey10mo ago
That is true, one more question, in the updated Redis, the port changed from: 7047 to 43786 right?
Brody
Brody10mo ago
yep that looks right, but as long as you are using reference variables, you dont need to worry about the port
mattey
mattey10mo ago
thanks.
Brody
Brody10mo ago
no problem!
Want results from more Discord servers?
Add your server