▲ | eirikbakke 3 days ago | |||||||||||||||||||||||||||||||
The PostgreSQL data directory format is not very stable or portable. You can't just ZIP it up and move it to a different machine, unless the new machine has the same architecture and "sufficiently" similar PostgreSQL binaries. In theory the data directory works with any PostgreSQL binaries from the same major version of PostgreSQL, but I have seen cases where this fails e.g. because the binaries were from the same major version but compiled with different build options. | ||||||||||||||||||||||||||||||||
▲ | OutOfHere 3 days ago | parent | next [-] | |||||||||||||||||||||||||||||||
I would never ever zip up a PostgreSQL data directory and expect it to restore elsewhere. I would use a proper export. If the export is too slow, it could help to use streaming replication to write intermediate files which can be moved to a backup location. Even with SQLite, for a simple file copy to work reliably, one has to set these three:
| ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | tracker1 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
Yeah, I was going to mention, just upgrading between PG versions can be a bit of a pain. Dump/Restore really seems like a less than stellar option of you have a LOT of data. I mean you can stream through gzip/bzip to save space but still. I often wish that Firebird had a license that people found friendlier to use as it always felt like a perfect technical option for many use cases from embedded to a standalone server. PG has clearly eclipsed it at this point though. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | markusw 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
Yeah, that really is a great thing about SQLite. I wonder whether packaging everything in Docker (including a specific Postgres container identified by hash or whatever) and deploying on the same architecture would solve this? | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | oulipo2 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
So the alternative would be to just pg_dump / pg_restore the content? Is it an issue? | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | freedomben 3 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||
I've been hit by this too, so definitely a risk. I've also had permissions on the files get broken which is a bitch to debug |