Data lost after Postgres version upgrade to v17
nick-choudhary
PROOP

2 months ago

Hi Railway team,

I upgraded my Postgres service from a previous version to Postgres 17 on the project "exciting-trust" (Project ID: 4b3d94e3-bd3e-49cc-a751-b6ff78150d2a).

After the upgrade, my database is completely empty — all tables show 0 rows. However, the attached volume (volume ID: 68bb418e-8dd3-4a8f-8abd-2be0678ce3b5) still shows ~170 GB of data, which matches the original database size.

Details:

Service: Postgres (Service ID: 706eefc1-93bb-4e05-a3ba-3a6acb53383e)

Environment: production

Volume: postgres-volume, mounted at /var/lib/postgresql/data

Volume size: ~170 GB

Expected data: ~87.5 million rows in a "leads" table (LinkedIn leads database)

Current state: Table structure exists but 0 rows. pg_class still shows stale stats of 87M rows.

It appears the upgrade created a fresh Postgres 17 data directory without migrating the data from the previous version. The old data files should still be on the volume.

Could you help recover the data from the old volume, or roll back to the previous Postgres version so I can do a proper pg_dump before upgrading?

I have not modified the volume or run any destructive commands. The volume is untouched.

Thanks

$30 Bounty

6 Replies

Status changed to Awaiting Railway Response Railway about 2 months ago


2 months ago

What version was the "previous version"?


Status changed to Awaiting User Response Railway about 2 months ago


brody

What version was the "previous version"?

nick-choudhary
PROOP

2 months ago

I even tried the rollback but not happening. can you help? It's ~200 GB data and I've been spending credits for those over a month and now they are gone.

Attachments


Status changed to Awaiting Railway Response Railway about 2 months ago


2 months ago

I'm sorry but our databases are unmanaged, so we cannot assist with user initiated data loss.


Status changed to Awaiting User Response Railway about 2 months ago


nick-choudhary
PROOP

2 months ago

that's crazy, the data loss was because of the upgrade and I've not lost the data technically. If you read my initial comment you'll know more about the situation here. How can i get that data back which is on the postres_volume but I am not seeing in the database.


Status changed to Awaiting Railway Response Railway about 2 months ago


nick-choudhary

that's crazy, the data loss was because of the upgrade and I've not lost the data technically. If you read my initial comment you'll know more about the situation here. How can i get that data back which is on the postres\_volume but I am not seeing in the database.

nick-choudhary
PROOP

2 months ago

see here's the data

Attachments


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 about 2 months ago


fra
HOBBYTop 5% Contributor

2 months ago

from the last image you shared it seems like the data are gone? do you have backups?

just throwing ideas in the bucket (but I'm not an DB admin, so do your research), did you try creating a new PG instance with the old PG version and attached the volume to the instance with the old PG?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...