Answer the question
In order to leave comments, you need to log in
How to transfer a large database from one server to another?
You need to move from one VDS to another, cloud VDS. We have a tightly packed ssd with a database of 60 gigabytes (there is currently 6 gigabytes of free disk space). I used to dump to json through Django and then just import it, but I have no experience with such large databases. Maybe somehow you can connect from one server to another and copy the database?
In general, knowledgeable people, tell me how to transfer large databases
Answer the question
In order to leave comments, you need to log in
Set up streaming replication, take a copy through pg_basebackup, run it as a replica. When it catches up with the leading base, turn off the master and upgrade the replica to a new master.
Downtime is a minute, regardless of the amount of data. Well, maybe another minute if you need to restart the master due to a change in wal_level, listen_addresses or max_wal_senders
https://wiki.postgresql.org/wiki/Streaming_Replication
If downtime is not important, then you need to stop the database, and use one of the following options:
1. Copy the files with the database to the new server using rsync, and replace the existing ones with them. The new server must have exactly the same version of Postgres installed.
2. Direct the pg_dump output on the old server to the pg_restore input on the new one via ssh:
Otherwise, it is better to hire an experienced DBA for this operation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question