Accidentally deleted Postgres
botwhatsapp
FREEOP

2 months ago

Hi Railway team,

I accidentally deleted my PostgreSQL service a few hours ago (today, March 8, 2026) in my project "insightful-clarity". The database contained all workflows, credentials, and execution history for my n8n instance.

The Postgres service was connected to the volume that was previously at 500MB (I had just resized it to 1GB before deleting). The database name was railway, user postgres.

I've already created a new Postgres instance and n8n is running again, but I desperately need the data from the old database restored — specifically the workflow definitions and credential configurations.

Is there any way to recover the deleted PostgreSQL service or its data? It was deleted less than 6 hours ago.

My project URL: https://railway.com/project/insightful-clarity (or however it appears in your system)

Thank you for any help you can provide.

$20 Bounty

6 Replies

sam-a
EMPLOYEE

2 months ago

Hey! Good news - your old data is still here.

When you deleted the Postgres service, the volume it was using (diplomatic-volume, ~783MB of data) was detached but not deleted. You should be able to see it as a standalone node on your project canvas.

To recover your data:

  1. Create a new temporary Postgres service (same image: ghcr.io/railwayapp-templates/postgres-ssl:17)
  2. On the canvas, click the orphaned diplomatic-volume node, then use "Mount to service" to attach it to the new temporary Postgres
  3. Once it's running, pg_dump your data from the temporary service
  4. Restore that dump into your current Postgres-vahV service

Alternatively, you could disconnect the volume from the new Postgres-vahV, mount the old diplomatic-volume to it directly, and skip the dump/restore - but that's riskier if you've already set up data in the new instance.

Let me know if you need help with the dump/restore steps!


Status changed to Awaiting User Response Railway 2 months ago


botwhatsapp
FREEOP

2 months ago

Hi, I mounted the diplomatic-volume on a new Postgres service, but the data appears to have been overwritten by the new Postgres initialization. You mentioned the volume had 783MB of data. Is there a backup or snapshot of the volume from before I mounted it? Or is there another volume with the original n8n data?


Status changed to Awaiting Railway Response Railway 2 months ago


botwhatsapp
FREEOP

2 months ago

Now the volume is not mountin2026-03-10 11:35:31.658 UTC [12] FATAL: database files are incompatible with server

2026-03-10 11:35:31.658 UTC [12] DETAIL: The data directory was initialized by PostgreSQL version 16, which is not compatible with this version 17.7 (Debian 17.7-3.pgdg13+1).

Please help! Really need to recover my n8n workflows.


2 months ago

I'm sorry, but we do not provide data recovery services. I'll open this thread up to the community so that they may help you.


Status changed to Awaiting User Response Railway 2 months ago


Railway
BOT

2 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open Railway 2 months ago


ilyass012
FREE

2 months ago

i think your data isn't lost. the error means the volume has postgres 16 data files, but you're trying to mount it to a postgres 17 service , pg17 simply refuses to read pg16 files, it didn't overwrite anything. you need to mount that volume to a postgres 16 service instead, then dump the data from there and restore it into your current instance


You can deploy a Postgres 16 database by using the tag postgres:16 when deploying a new service in Railway.

Make sure to set up the environment variables as noted by the documentation: https://hub.docker.com/%5F/postgres


Welcome!

Sign in to your Railway account to join the conversation.

Loading...