a year ago
Hello!
I would like to know if Railway provides a way to duplicate a database to work in an isolated environment so I can work by not touching the prod database
7 Replies
a year ago
Hello!
Indeed we do, please see our documentation around this feature -
https://docs.railway.com/guides/environments#copy-volume-data
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
thank you, yes I did that, created a new env called "Dev" that is being duplicated from the "Prod" env, but when I try to see the data in the database in the new Dev environment, it is empty, it supposed that the new environment was cloned from the Prod one, so why the database does not have a copy from the Prod environment, I attached a screenshot
Attachments
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
Hello,
The Copy Volume Data is used only when you open a PR, the volume data in the base environment will be copied into the volumes within the PR environment -
When enabled, any volume data from the base environment is copied to a new PR Environment.
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
ok, here is an attachment to check if I understood well
I enable the PR Environments
Set the Base Environment to be Prod (this supposed to be the one to be copied to Dev)
Enable Copy Volume Data
the next step would be to open a PR on github? what I don't understand is what has the PR (Pull Request) that I open for the Node JS to do with the volume of MySql in prod to be copied to Dev?
Attachments
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
We only support copying volume data from the base env to PR envs.
When enabled, any volume data from the base environment is copied to a new PR Environment.
Status changed to Awaiting User Response Railway • about 1 year ago
a year ago
ok, the volume data I want to copy is the one for MySQL database
but the branch Main is set to Node Js
that means that if I set a branch called "Dev" to the "Dev" environment on NodeJs repo and open a PR, the MySql data from Prod environment will be copied into MySql data in Dev environment?
Status changed to Awaiting Railway Response Railway • about 1 year ago
a year ago
I'm sorry, but there's a misunderstanding here. Nothing I mentioned is related to the branch you deploy your code from.
I am talking about the base environment in the project settings.
Please see our documentation around this feature -
https://docs.railway.com/guides/environments#copy-volume-data
Status changed to Awaiting User Response Railway • about 1 year ago
7 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 7 months ago