I have had to delete PostgreSQL for an issue and reinstall it, however before uninstalling I did not execute the command pg_dump. I still have the data directory from this instance. After reinstalling PostgreSQL, I receive all the same tables and schemas from my prior database, but not the same data. The data directories are two separate, but I want to combine the previous data directory into the new one. How would I go about such a process, if possible?
Postgresql – Repopulating PostgreSQL database with data directory from another database Instance
postgresql
Related Question
- PostgreSQL Restore – How to Restore One File from Directory Format Dump
- PostgreSQL – Configuring wal_archive Directory for Write-Ahead Logging
- Mysql – How to daily copy selected data from MySQL and PostgreSQL servers to another PostgreSQL server
- PostgreSQL for windows create tablespace on network location (nfs shared) failed because directory not exist
- Postgresql – Why does Postgresql Data directory revert to default after updates/reboots
- PostgreSQL Upgrade – Why Some Files in Data Directory Are Symlinks
Best Answer
Assumptions
I'm assuming you have two instances each one with a different data directory but with the same schema for the same version of postgres installed. I'm also assuming when the server starts is using your newly created, possibly empty, instance
What to do
You should try to start a new instance of the server pointing to your backup data directory...
Somenthing like
If this works, your backup instance is running on port 5433.
Check if everything is in place and the data is consistent.
If so then you could simply make arrangements for your server to always start pointing to your backup directory and safely delete your newly created data directory.