Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eISxD-0005mR-R9 for pgsql-admin@arkaria.postgresql.org; Sat, 25 Nov 2017 05:24:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eISxC-0000ng-Tp for pgsql-admin@arkaria.postgresql.org; Sat, 25 Nov 2017 05:24:38 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eISxC-0000nW-K5 for pgsql-admin@lists.postgresql.org; Sat, 25 Nov 2017 05:24:38 +0000 Received: from cat-porwal-prod-mail1.catalyst.net.nz ([202.78.240.226]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eISx7-0003Yu-KT for pgsql-admin@postgresql.org; Sat, 25 Nov 2017 05:24:36 +0000 Received: from [IPv6:2406:e001:859:1:101:e1d7:a7f9:c466] (unknown [IPv6:2406:e001:859:1:101:e1d7:a7f9:c466]) (Authenticated sender: mark.kirkwood@catalyst.net.nz) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTPSA id C2A45809A7; Sat, 25 Nov 2017 18:24:28 +1300 (NZDT) Subject: Re: Faster way of upgrading postgresql to 10 from 9.5 To: Debraj Manna , Alvaro Aguayo Garcia-Rada Cc: pgsql-admin References: From: Mark Kirkwood Message-ID: <4d397bf0-14c3-2bf8-bee6-c023a654b7ef@catalyst.net.nz> Date: Sat, 25 Nov 2017 18:24:28 +1300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Authentication-Results: auth=pass smtp.auth=mark.kirkwood@catalyst.net.nz smtp.mailfrom=mark.kirkwood@catalyst.net.nz List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I'd recommend looking at pg_upgrade again, but using the --link (-k) option to avoid copying the data. Should be quite a bit faster. regards Mark On 25/11/17 18:17, Debraj Manna wrote: > Ok. > > Is there any other approach by which I can do the migration without > doubling the disk space? > > I can bear small downtime. > > Sent from GMail on Android > > On Nov 25, 2017 10:40 AM, "Alvaro Aguayo Garcia-Rada" > > wrote: > > Yes, but only during the migration. After fi ishing and checking > your data, you can stop & destroy the old instance > > Of course, this is only needed if you want a zero or little > downtime migration, specially on production environment. > > > Regards, > > Alvaro Aguayo > Jefe de Operaciones > Open Comb Systems E.I.R.L. > > Oficina: (+51-1 ) 3377813  | RPM: #034252 > / (+51) 995540103 | RPC: (+51) 954183248 > > Website: www.ocs.pe > > Sent from my Sony Xperia™ smartphone > > ---- Debraj Manna wrote ---- > > > I am using one node postgres. > > So if I am setting up pglogical then I guess disk space will > double up? > > Sent from GMail on Android > > On Nov 25, 2017 9:34 AM, "Alvaro Aguayo Garcia-Rada" > > wrote: > > You can do an (almost) zero downtime migration between any > postgres version starting with 9.2 using pglogical. > > Basically, you first set up your new instance as a full > replica of the old one. Then, you change whatever > configuration your app has, changing the connection parameters > so they point to the new instance, reboot your app(s) if > needed, and that's all. As pglogical does not blocks changes > on slaves, your app will run normally even with pglogical > installed and active, letting you a time frame where you can  > have some connections still pointing to your old instance, > with changes made on such connections being reflected on your > new instance(warning: the opposite way will not happen. > > Regards, > > Alvaro Aguayo > Jefe de Operaciones > Open Comb Systems E.I.R.L. > > Oficina: (+51-1 ) 3377813  | RPM: > #034252 / (+51) 995540103 | RPC: (+51) > 954183248 > Website: www.ocs.pe > > Sent from my Sony Xperia™ smartphone > > ---- Debraj Manna wrote ---- > > > Cross posting from stack-exchange > > > > /I am trying to test the migration of postgres to 10 from 9.5/ > / > / > /On trying in a test DB of size 490 GB in one postgres node it > is taking about 18 mins. The command I used/ > / > / > /sudo -H -u postgres /usr/lib/postgresql/10/bin/pg_upgrade \/ > / -b /usr/lib/postgresql/9.5/bin \/ > / -B /usr/lib/postgresql/10/bin \/ > / -d /var/lib/postgresql/data/postgresql0 \/ > / -D /var/lib/postgresql/10/data/postgresql0 \/ > / -o ' -c config_file=/etc/postgresql/9.5/main/postgresql.conf' \/ > / -O ' -c config_file=/etc/postgresql/10/main/postgresql.conf' > -k / > / > / > /Is there any faster way of doing this?/ > >