Thread: How to move a postgres server
I have a postgres server with 2 databases residing on a host which is being de-commissioned.
I need to move the postgres server itself, including the databases to a new host.
All the stuff I can find on the web talks about moving the database, but I need to move the entire server.
Am I missing something here?
Am I suppose to create an identical server on the new host (with the same server name), then backup/restore the databases individually? Is there not any way to move the entire server?
From: Ron Watkins [mailto:rwatki@gmail.com]
Sent: Saturday, 17 February 2018 6:05 AM
To: pgsql-admin@lists.postgresql.org
Subject: How to move a postgres server
I have a postgres server with 2 databases residing on a host which is being de-commissioned.
I need to move the postgres server itself, including the databases to a new host.
All the stuff I can find on the web talks about moving the database, but I need to move the entire server.
Am I missing something here?
Am I suppose to create an identical server on the new host (with the same server name), then backup/restore the databases individually? Is there not any way to move the entire server?
Hi,
The best way to do that with minimal downtime would be to use streaming replication. But that depends on a few other findings as below
1) Version of the PostgreSQL server
2) Size of the databases
3) What OS: Linux/Win etc. and their versions
If the downtime is affordable, then build a new server with most recent patch updates and an installation of the same PostgreSQL version on it. Then, shutdown the database cluster, copy the files across and bring up the cluster on the new server. Although, I would not recommend this approach but this is the simplest way to move the PostgreSQL server when downtime is not a big deal.
~
Nawaz Ahmed
Disclaimer
The information in this e-mail is confidential and may contain content that is subject to copyright and/or is commercial-in-confidence and is intended only for the use of the above named addressee. If you are not the intended recipient, you are hereby notified that dissemination, copying or use of the information is strictly prohibited. If you have received this e-mail in error, please telephone Fujitsu Australia Software Technology Pty Ltd on + 61 2 9452 9000 or by reply e-mail to the sender and delete the document and all copies thereof.
Whereas Fujitsu Australia Software Technology Pty Ltd would not knowingly transmit a virus within an email communication, it is the receiver’s responsibility to scan all communication and any files attached for computer viruses and other defects. Fujitsu Australia Software Technology Pty Ltd does not accept liability for any loss or damage (whether direct, indirect, consequential or economic) however caused, and whether by negligence or otherwise, which may result directly or indirectly from this communication or any files attached.
If you do not wish to receive commercial and/or marketing email messages from Fujitsu Australia Software Technology Pty Ltd, please email unsubscribe@fast.au.fujitsu.com
Im a relative newbie…
Can I create a new Postgresql server with the same name as the running server?
I need to preserve both the database name as well as the server name. The only difference is the hostname.
We can take an outage.
From what I read, it seems that all I need to do is copy the files from one postgres server directory over to the other on the new host, then when the host reboots it will start that database automatically?
Also, im a bit worried about how to preserve the config of the server if I am forced to create a new one rather than just copying it. How can I make sure the postgres server config is copied properly?
From: Ahmed, Nawaz [mailto:Nawaz@fast.au.fujitsu.com]
Sent: Friday, February 16, 2018 1:52 PM
To: 'Ron Watkins'; pgsql-admin@lists.postgresql.org
Subject: RE: How to move a postgres server
From: Ron Watkins [mailto:rwatki@gmail.com]
Sent: Saturday, 17 February 2018 6:05 AM
To: pgsql-admin@lists.postgresql.org
Subject: How to move a postgres server
I have a postgres server with 2 databases residing on a host which is being de-commissioned.
I need to move the postgres server itself, including the databases to a new host.
All the stuff I can find on the web talks about moving the database, but I need to move the entire server.
Am I missing something here?
Am I suppose to create an identical server on the new host (with the same server name), then backup/restore the databases individually? Is there not any way to move the entire server?
Hi,
The best way to do that with minimal downtime would be to use streaming replication. But that depends on a few other findings as below
1) Version of the PostgreSQL server
2) Size of the databases
3) What OS: Linux/Win etc. and their versions
If the downtime is affordable, then build a new server with most recent patch updates and an installation of the same PostgreSQL version on it. Then, shutdown the database cluster, copy the files across and bring up the cluster on the new server. Although, I would not recommend this approach but this is the simplest way to move the PostgreSQL server when downtime is not a big deal.
~
Nawaz Ahmed
Disclaimer
The information in this e-mail is confidential and may contain content that is subject to copyright and/or is commercial-in-confidence and is intended only for the use of the above named addressee. If you are not the intended recipient, you are hereby notified that dissemination, copying or use of the information is strictly prohibited. If you have received this e-mail in error, please telephone Fujitsu Australia Software Technology Pty Ltd on + 61 2 9452 9000 or by reply e-mail to the sender and delete the document and all copies thereof.
Whereas Fujitsu Australia Software Technology Pty Ltd would not knowingly transmit a virus within an email communication, it is the receiver’s responsibility to scan all communication and any files attached for computer viruses and other defects. Fujitsu Australia Software Technology Pty Ltd does not accept liability for any loss or damage (whether direct, indirect, consequential or economic) however caused, and whether by negligence or otherwise, which may result directly or indirectly from this communication or any files attached.
If you do not wish to receive commercial and/or marketing email messages from Fujitsu Australia Software Technology Pty Ltd, please email unsubscribe@fast.au.fujitsu.com
—
Im a relative newbie…
Can I create a new Postgresql server with the same name as the running server?
I need to preserve both the database name as well as the server name. The only difference is the hostname.
We can take an outage.
From what I read, it seems that all I need to do is copy the files from one postgres server directory over to the other on the new host, then when the host reboots it will start that database automatically?
Also, im a bit worried about how to preserve the config of the server if I am forced to create a new one rather than just copying it. How can I make sure the postgres server config is copied properly?
From: Ahmed, Nawaz [mailto:Nawaz@fast.au.fujitsu.com]
Sent: Friday, February 16, 2018 1:52 PM
To: 'Ron Watkins'; pgsql-admin@lists.postgresql.org
Subject: RE: How to move a postgres server
From: Ron Watkins [mailto:rwatki@gmail.com]
Sent: Saturday, 17 February 2018 6:05 AM
To: pgsql-admin@lists.postgresql.org
Subject: How to move a postgres server
I have a postgres server with 2 databases residing on a host which is being de-commissioned.
I need to move the postgres server itself, including the databases to a new host.
All the stuff I can find on the web talks about moving the database, but I need to move the entire server.
Am I missing something here?
Am I suppose to create an identical server on the new host (with the same server name), then backup/restore the databases individually? Is there not any way to move the entire server?
Hi,
The best way to do that with minimal downtime would be to use streaming replication. But that depends on a few other findings as below
1) Version of the PostgreSQL server
2) Size of the databases
3) What OS: Linux/Win etc. and their versions
If the downtime is affordable, then build a new server with most recent patch updates and an installation of the same PostgreSQL version on it. Then, shutdown the database cluster, copy the files across and bring up the cluster on the new server. Although, I would not recommend this approach but this is the simplest way to move the PostgreSQL server when downtime is not a big deal.
~
Nawaz Ahmed
Disclaimer
The information in this e-mail is confidential and may contain content that is subject to copyright and/or is commercial-in-confidence and is intended only for the use of the above named addressee. If you are not the intended recipient, you are hereby notified that dissemination, copying or use of the information is strictly prohibited. If you have received this e-mail in error, please telephone Fujitsu Australia Software Technology Pty Ltd on + 61 2 9452 9000 or by reply e-mail to the sender and delete the document and all copies thereof.
Whereas Fujitsu Australia Software Technology Pty Ltd would not knowingly transmit a virus within an email communication, it is the receiver’s responsibility to scan all communication and any files attached for computer viruses and other defects. Fujitsu Australia Software Technology Pty Ltd does not accept liability for any loss or damage (whether direct, indirect, consequential or economic) however caused, and whether by negligence or otherwise, which may result directly or indirectly from this communication or any files attached.
If you do not wish to receive commercial and/or marketing email messages from Fujitsu Australia Software Technology Pty Ltd, please email unsubscribe@fast.au.fujitsu.com