Repository navigation
Railway template deploys before 1 October 2026: move your Postgres data onto the volume #655
abhinavxd
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Moving your Railway Postgres data onto the volume
This applies only if you deployed libredesk with the Railway template.
The template had a typo in the Postgres volume mount path (a trailing space). Postgres kept its data on the container's own disk instead of the volume. Railway throws that disk away every time it redeploys the Postgres service, for example after you change the image, a variable or the mount path. The template was fixed on 1 October 2026. If you deployed before that date, your instance is affected until you follow the steps below.
Details on issue: #654
Warning
Until you have moved your data, do not redeploy the Postgres service, change its image or variables, or change its mount path. Any of these erases the database. Restarting it is safe.
Before you start
Postgresandlibredesk.Install the Railway CLI with one of:
Or download a binary from https://github.com/railwayapp/cli/releases.
Log in, link your project, and register your SSH key. When
railway linkasks, pick your libredesk project, theproductionenvironment, and thePostgresservice.1. Check if you are affected
This shows which disk holds your database. Look at the first word of the second line.
You are affected if it says
overlay, which is the container's own disk. Continue with step 2.You are not affected if it starts with
/dev/, which is the volume. You can stop here.2. Stop libredesk
This stops libredesk so nothing is written to the database during the move.
3. Back up the database onto the volume
The output must list
backup.dump. Do not continue if it does not.4. Fix the mount path
In the Railway dashboard, click the volume shown under the Postgres service, then open Settings. Change the Mount Path to:
Leave the
PGDATAvariable as it is (/var/lib/postgresql/data/pgdata).Click Deploy in the banner at the top of the project to apply the change, and wait until Postgres is running. Postgres starts with an empty database, which is expected.
5. Restore the backup
The output must end with
RESTORE OK.6. Start libredesk
Railway starts a new libredesk deployment whenever one of its variables changes.
Wait until libredesk is running, then log in and check that your conversations and settings are there.
7. Confirm the fix
The first column should now show
/dev/...and the data directory should be/var/lib/postgresql/data/pgdata.8. Remove the backup file (optional)
The backup stays on the volume at
/var/lib/postgresql/data/backup.dumpand uses about as much space as your database. Once you have checked that your data is all there, you can delete it:All reactions