How to restore Postgres backup as copy
evhaus
PROOP

5 months ago

I lost some data in my database. I'd like to grab data from one of the backups. I can't figure out any way to do this in Railway. It seems like (maybe?) the "Restore" button will replace the data in my current database with the backup. I don't want to do this. I want to simply review the data inside a backup. Can I somehow restore it into a new Postgres instance? I can't figure out how to do this.

Solved

6 Replies

Railway
BOT

5 months ago

Our team is working on getting back to you as soon as possible. In the meantime, we've found the following might help you get unlocked faster:

If you find the answer from one of these, please let us know by solving the thread! Otherwise, we’ll be in touch.


evhaus
PROOP

5 months ago

Nevermind. I figured it out:

1. Click "Restore backup". Click the scary red "Confirm" button

  1. Railway will stage a change

  2. Click "Review changes"

  3. Delete the change that mounts the backup restore as the new database volume. Keep the change that mounts the backup to a new volume.

  4. Deploy the change (just the backup volume getting added)

  5. Create new Postgres database

  6. Right click the YYYY-MM-DD backup volume, choose "Mount volume" and select the new Postgres database

  7. Copy all the variables from the original Postgres to the copy Postgres

  8. Submit the changes

  9. Connect to the new Postgres database and extract whatever data you need


evhaus

Nevermind. I figured it out:1. Click "Restore backup". Click the scary red "Confirm" buttonRailway will stage a changeClick "Review changes"Delete the change that mounts the backup restore as the new database volume. Keep the change that mounts the backup to a new volume.Deploy the change (just the backup volume getting added)Create new Postgres databaseRight click the YYYY-MM-DD backup volume, choose "Mount volume" and select the new Postgres databaseCopy all the variables from the original Postgres to the copy PostgresSubmit the changesConnect to the new Postgres database and extract whatever data you need

chandrika
EMPLOYEE

5 months ago

Glad you were able to figure it out! Do you have any feedback on how the Restore backup flow could be made more clearer, etc?


Status changed to Awaiting User Response Railway 5 months ago


chandrika

Glad you were able to figure it out! Do you have any feedback on how the Restore backup flow could be made more clearer, etc?

evhaus
PROOP

5 months ago

Yeah, I definitely have a lot of feedback:

  1. Clicking the "Restore backup" button is very scary. The button is red and you have no idea what it's going to do. At first I thought for sure it would replace my current DB's volume with the backup, which would be really bad. Adding more information here about what will happen would be helpful. Although, since the button here is fairly benign and there's a separate confirmation step later before you apply the deployment changes, maybe the confirmation isn't needed at all.

  2. Give me a "Restore this backup to a new DB" button. That would be excellent! Instead of 10 manual steps, it would reduce the pain down to just 1 click.

  3. After creating a new Postgres instance I wasn't always able to mount the backup volume to it. I'm not sure what ultimately did it, but for a long time the option to mount the volume to that new Postgres instance wouldn't show up. Eventually it did, but it would be nice if it was available right away. ie. User should be able to change a Postgres node's volume at anytime.


Status changed to Awaiting Railway Response Railway 5 months ago


evhaus

Yeah, I definitely have a lot of feedback:Clicking the "Restore backup" button is very scary. The button is red and you have no idea what it's going to do. At first I thought for sure it would replace my current DB's volume with the backup, which would be really bad. Adding more information here about what will happen would be helpful. Although, since the button here is fairly benign and there's a separate confirmation step later before you apply the deployment changes, maybe the confirmation isn't needed at all.Give me a "Restore this backup to a new DB" button. That would be excellent! Instead of 10 manual steps, it would reduce the pain down to just 1 click.After creating a new Postgres instance I wasn't always able to mount the backup volume to it. I'm not sure what ultimately did it, but for a long time the option to mount the volume to that new Postgres instance wouldn't show up. Eventually it did, but it would be nice if it was available right away. ie. User should be able to change a Postgres node's volume at anytime.

chandrika
EMPLOYEE

5 months ago

Thank you so much, appreciate you sharing and have passed it along to our product team


Status changed to Awaiting User Response Railway 5 months ago


Status changed to Solved chandrika 5 months ago


chandrika

Thank you so much, appreciate you sharing and have passed it along to our product team

evhaus
PROOP

5 months ago

I just had to recover a backup again today and I saw the team made some immediate text changes. Thank you! This is much more clear.

Attachments


Status changed to Awaiting Railway Response Railway 5 months ago


Status changed to Solved itsrems 5 months ago


Loading...