huy
huy2w ago

I'm trying to restore a self-hosted instance but it's seen as a new instance

I have a backup made by docker-volume-backup which just archives the PostgreSQL bind-mounted volume. I also have a self-made backup using pg_dumpall. When I restore with either method, the server seems to think that this is a brand new instance. How do I get my old state back?
3 Replies
huy
huyOP2w ago
Never mind, I figured out my dumb mistake
grantith
grantith6d ago
@huy Can you share your answer here so others can know in case they face the same?
huy
huyOP5d ago
Sure but it’s unlikely to happen to other people. I was in the process of writing and testing backup and restore bash scripts. At some point I accidentally deleted the bind mount line in docker-compose.yml for the Postgres service. Whenever I restored, it all looked good on the host. But unbeknownst to me, Postgres was no longer seeing the restored pgdata as a bind mount and was just setting up fresh on the container’s filesystem.

Did you find this page helpful?