I am migrating my server application from the existing system to another system. Unfortunately, the existing system is also the database server. It has data stored. Is it possible to copy this data to the other system? I have a copy of all the table schemas.
I have no idea on how to proceed. I am using PostgreSQL.
Postgresql – Copy PostgreSQL data from one PC to another
backuppostgresqlrestore
Related Question
- Postgresql – Repopulating PostgreSQL database with data directory from another database Instance
- Postgresql – How to copy table data from one db to another
- PostgreSQL – Copy Table Functions to Another Database Schema
- PostgreSQL – PUBLICATION Tries to Copy Existing Data in Another Database
- Mysql – How to daily copy selected data from MySQL and PostgreSQL servers to another PostgreSQL server
- PostgreSQL – Listing Active Foreign Data Wrappers
Best Answer
You could dump the database using
pg_dump
and then restore it on the new server using psql. Here's a couple of commands from the above link:Create the backup:
pg_dump mydb > db.sql
Copy
db.sql
to the new server (specific command depends on OS)Go to the new server
createdb mydb -E UTF8
(you don't have to specify UTF8 encoding, but I always do)Then:
psql -d mydb -f db.sql
As I was answering, JohnP just answered with a fine answer but assumes that
pg_hba.conf
has been edited to allow remote connections andpostgres.conf
has been edited to listen on the network.