Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eISj8-00055w-VV for pgsql-admin@arkaria.postgresql.org; Sat, 25 Nov 2017 05:10:07 +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 1eISj8-0006xW-DM for pgsql-admin@arkaria.postgresql.org; Sat, 25 Nov 2017 05:10:06 +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 1eISj8-0006xD-3d for pgsql-admin@lists.postgresql.org; Sat, 25 Nov 2017 05:10:06 +0000 Received: from adriana.opensysperu.com ([2607:5300:60:8392::1004]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eISj4-0003GE-Sr for pgsql-admin@postgresql.org; Sat, 25 Nov 2017 05:10:04 +0000 Received: from localhost (localhost [IPv6:::1]) by adriana.opensysperu.com (Postfix) with ESMTP id 5C3231410FA; Sat, 25 Nov 2017 00:11:21 -0500 (-05) Received: from adriana.opensysperu.com ([IPv6:::1]) by localhost (adriana.opensysperu.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id lYxi5m1LT3Tj; Sat, 25 Nov 2017 00:11:20 -0500 (-05) Received: from localhost (localhost [IPv6:::1]) by adriana.opensysperu.com (Postfix) with ESMTP id AD7A81410FE; Sat, 25 Nov 2017 00:11:20 -0500 (-05) X-Virus-Scanned: amavisd-new at opensysperu.com Received: from adriana.opensysperu.com ([IPv6:::1]) by localhost (adriana.opensysperu.com [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id JobDvMfYGyDS; Sat, 25 Nov 2017 00:11:20 -0500 (-05) Received: from adriana.opensysperu.com (adriana.opensysperu.com [158.69.30.115]) by adriana.opensysperu.com (Postfix) with ESMTP id 8AAD31410FA; Sat, 25 Nov 2017 00:11:20 -0500 (-05) Date: Sat, 25 Nov 2017 00:11:20 -0500 (PET) Subject: RE: Faster way of upgrading postgresql to 10 from 9.5 Message-ID: From: Alvaro Aguayo Garcia-Rada To: Debraj Manna Cc: pgsql-admin MIME-Version: 1.0 In-Reply-To: References: Content-Type: multipart/alternative; boundary="----=_Part_480139_1270067389.1511586680483" X-Mailer: Zimbra 8.6.0_GA_1153 (MobileSync - SonyF5122/7.0-EAS-2.0) Thread-Topic: Faster way of upgrading postgresql to 10 from 9.5 Thread-Index: pzY/1cF/vT+TqtkczxC10sTrSysyKg== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_480139_1270067389.1511586680483 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 migrat= ion, specially on production environment. Regards, Alvaro Aguayo Jefe de Operaciones Open Comb Systems E.I.R.L. Oficina: (+51-1)=C2=A03377813=C2=A0| RPM: #034252 / (+51)=C2=A0995540103=C2= =A0 | RPC: (+51)=C2=A0954183248 Website:=C2=A0www.ocs.pe Sent from my Sony Xperia=E2=84=A2 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" < aaguayo@opensysperu.com> 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 ol= d > 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 bein= g > 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=E2=84=A2 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=3D/etc/postgresql/9.5/main/postgresql.conf' \* > * -O ' -c config_file=3D/etc/postgresql/10/main/postgresql.conf' -k * > > *Is there any faster way of doing this?* > ------=_Part_480139_1270067389.1511586680483 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Yes, but only during the migration. After fi ishing and ch= ecking your data, you can stop & destroy the old instance

Of cou= rse, this is only needed if you want a zero or little downtime migration, s= pecially on production environment.

Regards,

Alvaro AguayoJefe de Operaciones
Open Comb Systems E.I.R.L.

Oficina: (+51-1)=C2=A03377813=C2=A0| R= PM: #034252 / (+51)=C2=A0995540103=C2=A0 | RP= C: (+51)=C2=A0954183248
Website:=C2=A0www.ocs.pe

Sent from my Sony Xperia=E2= =84=A2 smartphone

---- Debraj Manna wrote ----


I am using one node postgres.=C2=A0
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 Agu= ayo Garcia-Rada" <aaguay= o@opensysperu.com> wrote:
You can do an (almost) zero downtime migration betw= een any postgres version starting with 9.2 using pglogical.

Basicall= y, you first set up your new instance as a full replica of the old one. The= n, 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 a= pp will run normally even with pglogical installed and active, letting you = a time frame where you can=C2=A0 have some connections still pointing to yo= ur old instance, with changes made on such connections being reflected on y= our new instance(warning: the opposite way will not happen.

Regards,=

Alvaro Aguayo
Jefe de Operaciones
Open Comb Systems E.I.R.L.<= br>
Oficina: (+51-1)=C2=A03377813=C2=A0| RPM: #034252 / (= +51)=C2=A0995540103=C2=A0 |= RPC: (+51)=C2=A0954183248<= br>Website:=C2=A0www.ocs.pe=

Sent from my Sony Xperia=E2=84=A2 smartphone

---- Debraj= Manna wrote ----


Cross posting from= stack-exchange
<= br>
I am trying to test the migration of postgres to 10 from 9= .5

On trying in a test DB of size 49= 0 GB in one postgres node it is taking about 18 mins. The command I used

su= do -H -u postgres /usr/lib/postgresql/10/bin/pg_upgrade \
=C2=A0 =C2=A0-b /usr/lib/po= stgresql/9.5/bin \
=C2=A0 =C2=A0-B /usr/lib/postgresql/10/bin \
=C2=A0 =C2=A0-d /var/lib/postgresql/data/= postgresql0 \
=C2=A0 =C2=A0-D /var/lib/postgresql/10/data/postgresql0 \
=C2=A0 =C2=A0-o ' -= c config_file=3D/etc/postgresql/9.5/main/postgresql.conf' \
=C2=A0 =C2=A0-O '= -c config_file=3D/etc/postgresql/10/main/postgresql.conf' -k=C2= =A0

Is there any = faster way of doing this?
------=_Part_480139_1270067389.1511586680483--