How to attach existing unattached restored volume to temporary PostgreSQL service for integrity testing
misterjobsai
PROOP

a month ago

I have a restored volume named:

postgres-2026-06-24 00:10 UTC

It is currently READY / unattached.

I created a new temporary PostgreSQL service:

ikiyu-postgres-restore-test-20260625

The goal is to attach the restored volume to this temporary

PostgreSQL service in order to verify backup integrity without

affecting production.

Railway Support previously indicated that this should be done

by selecting the restored volume in the temporary service's

volume settings. However, in the current dashboard UI, the

temporary PostgreSQL service does not show a "Volumes" section

in Settings, and I cannot find an option to attach an existing

unattached volume.

Questions:

  1. How do I attach an existing unattached restored volume to

    a new temporary PostgreSQL service in the current Railway

    dashboard?

  2. Is this action only available through Railway CLI?

  3. If CLI is required, what exact command should be used?

  4. What service ID, environment ID, volume ID, and mount path

    are required?

  5. Should the mount path be /var/lib/postgresql/data for the

    Railway PostgreSQL image?

  6. How do we ensure the temporary service does not initialize

    a new empty database over the restored volume?

  7. Is there any risk of data overwrite when attaching the

    restored volume to a fresh PostgreSQL service?

  8. Should the default volume of the temporary PostgreSQL

    service be removed first?

  9. What is the safest supported procedure to test a restored

    PostgreSQL backup volume without replacing production?

Important context:

  • Production PostgreSQL is healthy.

  • Production uses postgres-volume.

  • The restored volume is not mounted to production.

  • We do not want to modify production.

  • We do not want to change DATABASE_URL.

  • We do not want to overwrite or initialize the restored volume.

  • We only want to mount the restored volume to an isolated

    temporary service and run read-only integrity checks.

Project: beneficial-dedication

Environment: production

Production service: Postgres

Temporary service: ikiyu-postgres-restore-test-20260625

Restored volume: postgres-2026-06-24 00:10 UTC

$20 Bounty

1 Replies

Railway
BOT

a month ago

This thread has been opened as a public bounty so the community can help solve it. The thread and any further activity are now visible to everyone.

Status changed to Open Railway about 1 month ago


You can drag the unattached volume over the Postgres service in the dashboard to execute a volume swap. Keep in mind that you may encounter authentication errors. If you do, follow the steps below:

  1. Click into your database service and go to the console tab
  2. Run this command: sed -i 's/host all all all scram-sha-256/host all all ::\/0 trust/' /var/lib/postgresql/data/pgdata/pg_hba.conf (This will bypass user authentication)
  3. Redeploy your database
  4. SSH again, and run the command psql
  5. Run ALTER USER postgres with password '<PASSWORD>'; where <PASSWORD> is the value of the variable PGPASSWORD in your Railway dashboard
  6. Type exit
  7. Run sed -i 's/host all all ::\/0 trust/host all all all scram-sha-256/' /var/lib/postgresql/data/pgdata/pg_hba.conf (This will re-enable user authentication)
  8. Redeploy your database

Welcome!

Sign in to your Railway account to join the conversation.

Loading...