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