an experience of recovery from Postgresql database files
Ooh weirdness.
I had a significant drive failure a few weeks ago during backup, which managed to take out both the source and destination drives. OK I should be rotating backups to avoid this problem, check that for the future. Amongst the files was the most-recent-state postgres, and this is tricky. I could have restored from the last dump, but thanks to a months-long bout of illness this was a bit behind.
I managed to recover basically everything else by dint of some older recovery software on an older machine, but as I suspected, just switching the recovered postgres data folder to the new installation didn’t work. Part of which might be that the recovery software writes all its recovered files under ownership of ‘privoxy’ rather than the original owners . . . perhaps on the basis that you won’t know how to chown
, not sure. Or perhaps because the original owners might not be present on the new system, fair enough. Maybe that’s enough to prevent postgres starting with the old folder (even with a few configuration tweaks).
So instead I cloned the whole drive . . . slightly overkill for 100-odd MB of database gunk, but hopefully simpler than either figuring it out or trying to reconstruct manually — and I think the latter would be easier of those two. This isn’t really critical data, just a convenience thing. But it took several hours.
The particular implementation of postgres here is Bitnami’s MAPPstack, and this makes one particular option attractive — to run the whole thing again from the cloned drive (which would include the data files), do a dump, and restore to the new installation. Will it work?
more →