Thread: Pg_upgrade remote copy
Hi,
In pg_upgrade, how about adding a feature to copy data directory over network.
That is, we can run pg_upgrade from our new host, where old host will be a remote machine.
We can add two parameters - oldhost and if it is used, pg_upgrade will identify the old host as remote and instead of local copy, it will use remote copy.
What do you think about it?
Thanks.
On Fri, Aug 28, 2015 at 10:34:38PM -0700, AI Rumman wrote: > Hi, > > In pg_upgrade, how about adding a feature to copy data directory over network. > That is, we can run pg_upgrade from our new host, where old host will be a > remote machine. > We can add two parameters - oldhost and if it is used, pg_upgrade will identify > the old host as remote and instead of local copy, it will use remote copy. > > What do you think about it? Well, you could NFS-mount the remote directory and have it work that way. One complexity is that you need to start/stop the old and new servers, so doing something without NFS is going to be vary hard. I think it is much simpler to just copy the old clsuter to the remote server and run pg_upgrade in --link mode on the remote server. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. +
Bruce Momjian wrote: > On Fri, Aug 28, 2015 at 10:34:38PM -0700, AI Rumman wrote: > > In pg_upgrade, how about adding a feature to copy data directory over network. > > That is, we can run pg_upgrade from our new host, where old host will be a > > remote machine. > I think it is much simpler to just copy the old clsuter to the remote > server and run pg_upgrade in --link mode on the remote server. Couldn't it run pg_basebackup as a first step? -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
On Wed, Sep 2, 2015 at 04:50:32PM -0300, Alvaro Herrera wrote: > Bruce Momjian wrote: > > On Fri, Aug 28, 2015 at 10:34:38PM -0700, AI Rumman wrote: > > > > In pg_upgrade, how about adding a feature to copy data directory over network. > > > That is, we can run pg_upgrade from our new host, where old host will be a > > > remote machine. > > > I think it is much simpler to just copy the old clsuter to the remote > > server and run pg_upgrade in --link mode on the remote server. > > Couldn't it run pg_basebackup as a first step? Yes. I was thinking it would be simpler to just shut down the server and copy it, but pg_basebackup would allow the server to be up during the copy. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. +
<div dir="ltr">Thanks for the solution.</div><div class="gmail_extra"><br /><div class="gmail_quote">On Wed, Sep 2, 2015at 4:15 PM, Bruce Momjian <span dir="ltr"><<a href="mailto:bruce@momjian.us" target="_blank">bruce@momjian.us</a>></span>wrote:<br /><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px#ccc solid;padding-left:1ex"><span class="">On Wed, Sep 2, 2015 at 04:50:32PM -0300, Alvaro Herrerawrote:<br /> > Bruce Momjian wrote:<br /> > > On Fri, Aug 28, 2015 at 10:34:38PM -0700, AI Rumman wrote:<br/> ><br /> > > > In pg_upgrade, how about adding a feature to copy data directory over network.<br />> > > That is, we can run pg_upgrade from our new host, where old host will be a<br /> > > > remote machine.<br/> ><br /> > > I think it is much simpler to just copy the old clsuter to the remote<br /> > >server and run pg_upgrade in --link mode on the remote server.<br /> ><br /> > Couldn't it run pg_basebackup asa first step?<br /><br /></span>Yes. I was thinking it would be simpler to just shut down the server<br /> and copy it,but pg_basebackup would allow the server to be up during<br /> the copy.<br /><div class="HOEnZb"><div class="h5"><br/> --<br /> Bruce Momjian <<a href="mailto:bruce@momjian.us">bruce@momjian.us</a>> <a href="http://momjian.us"rel="noreferrer" target="_blank">http://momjian.us</a><br /> EnterpriseDB <a href="http://enterprisedb.com" rel="noreferrer" target="_blank">http://enterprisedb.com</a><br /><br /> + Everyonehas their own god. +<br /></div></div></blockquote></div><br /></div>