Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j6aQH-00077j-Tv for pgsql-general@arkaria.postgresql.org; Tue, 25 Feb 2020 13:38:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j6aQG-0000Su-Q8 for pgsql-general@arkaria.postgresql.org; Tue, 25 Feb 2020 13:38:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j6aQG-0000Sk-AD for pgsql-general@lists.postgresql.org; Tue, 25 Feb 2020 13:38:52 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j6aQA-0003Ct-T6 for pgsql-general@lists.postgresql.org; Tue, 25 Feb 2020 13:38:51 +0000 Received: by mail-wm1-x333.google.com with SMTP id a5so3045445wmb.0 for ; Tue, 25 Feb 2020 05:38:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=gdPHv1AVMSXs2ZddU/Kar9q6Dp4rk6ns3JV2rA0y3Wo=; b=t/ADDFNS0wDgvYwPrp9ogZA6s6FxAidRjBilj4NsFlabwzu+QldgDnrMsPxQgEPA5x M0kBuqwZzGS8hHphrfX1NGhfA4ZcIGJOr9WE/AajM05PP9paU5/WI3pRs3XGlS/YaxPa 5GElIfxL1N3c+nUNfqS1gb/ZBwo/LisVzyeO/E7BB7wVDFSuwXom/jE1Pw0bSaFu9iji 5ADOkZD53dMXOpVThgs12WUH2fuZY/orDqnfqbKkfCxt+KoXjcs/1ExK6BNiHxZbIt0f wPiCqodkAL9zh3vegpKSAr4RX7v9sDI2sCvcUPczPUDfPQRv/+7uAlMB9Nt3pSCL9bln YqQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=gdPHv1AVMSXs2ZddU/Kar9q6Dp4rk6ns3JV2rA0y3Wo=; b=BJUc4fPUYQpG/rRw4b1g+YGBns2khP7er3hZxdNJnqIdkWpEpLqHN7QmFnNx9tljpS zoNp+/4JNrhyLqXWvP/cmg0PaMykqKmNXKdhXl17Wn4SP8hLW8dKgpEOsgiS7MjxRPnq TSbHunc2gz62juuT6wczbRsZu4987Ozj79HgXVKjsp4oBk5CB7IRBM8eYCt4Z5ZfUNjq ImZkKdJRPOQgp1v08SIJlRoY12xyu1ZzTXnM7iQBdjOOnM7gMjRHnuKyYK0ugoFqsGV1 rXMMJxHKcIpHGmpaHhA17QJB5YfbWxZ91FUfDs6Ms4aqY/N8U6pn9jZHOMpd7dkK0lJp xvCg== X-Gm-Message-State: APjAAAU0PV8sBvOIeTFlM88kzGFU3M/cJG2Ss3VJB8f0IKe2bmwnec8y qfPY2mx6xNJqIwG3AbgfZu+HEno/ X-Google-Smtp-Source: APXvYqx32mM/S90LlbHHGoEPfJ8OwJDpIGvyT8j2+C6rZor++3wIgWRk5L/bA+6NiWT2rCiG+PUxvQ== X-Received: by 2002:a1c:1d8d:: with SMTP id d135mr5390210wmd.92.1582637924620; Tue, 25 Feb 2020 05:38:44 -0800 (PST) Received: from [192.168.1.8] (137-33-239-77.dyn.cable.fcom.ch. [77.239.33.137]) by smtp.gmail.com with ESMTPSA id n8sm23041655wrx.42.2020.02.25.05.38.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Feb 2020 05:38:44 -0800 (PST) From: =?utf-8?Q?Paul_F=C3=B6rster?= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: Upgrade to 12.2 using same data directory Date: Tue, 25 Feb 2020 14:38:43 +0100 References: <0c80da35a7fe4c8fa8c085d9569931f6@cewexch403.ad.cetin> To: "pgsql-general@lists.postgresql.org" In-Reply-To: <0c80da35a7fe4c8fa8c085d9569931f6@cewexch403.ad.cetin> Message-Id: X-Mailer: Apple Mail (2.3608.60.0.2.5) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi J, you can do the following: mkdir /alias/data/dbname-new initdb -D /alias/data/dbname-new pg_upgrade \ -b /old/bin/dir \ -B /new/bin/dir \ -d /alias/data/dbname \ -D /alias/data/dbname-new \ -k After the successful upgrade: rm -rf /alias/data/dbname mv /alias/data/dbname-new /alias/data/dbname This is how I always do it. You can't initialize a new database cluster = into the same data directory as the old one(!!), which makes sense, but = which is exactly what you are trying to do and why it fails on you. = Doing it the way described above has the advantages, that a) you don't need double disk space, espacially in a commercial = environment, and which is ugly if pg_upgrade has to copy terabytes of = data, and b) saves time because there is no file copy, and c) you then have the same data directory naming conventions that you are = used to Also see: initdb --help pg_upgrade --help You can properly put this into a script. My last migrations (11.5 to = 12.1) took about 18 seconds each. This interruption usually can be = communicated to the users. If they're used to Oracle, they're used to interruptions in the range = 90-120 minutes. :-D So there should be no problems with about a minute! = But that of course requires proper planning and proper scripting. :-) = Practice that (including the scripting!) on an identical test database = setup in advance. Hope this helps, Paul > On 25. Feb, 2020, at 13:52, Mihalidesov=C3=A1 Jana = wrote: >=20 > I think it=E2=80=99s strange to change the data directory $PATH every = time I upgrade the software, when the data are the same. I have a = specific naming convention not using a db version. > =20 > /alias/data/ > =20 > J > =20 > From: Josef =C5=A0im=C3=A1nek =20 > Sent: Tuesday, February 25, 2020 1:05 PM > To: Mihalidesov=C3=A1 Jana > Cc: pgsql-general@lists.postgresql.org > Subject: Re: Upgrade to 12.2 using same data directory > =20 > I think that's not possible. What's the reason to reuse old directory? > =20 > =C3=BAt 25. 2. 2020 v 12:59 odes=C3=ADlatel Mihalidesov=C3=A1 Jana = napsal: > Hi, > =20 > Is there possibility to upgrade from 10.6 to 12.2 using exact same = data directory? First problem is with initialing of =E2=80=9Cnew=E2=80=9D = cluster. Then pg_upgrade check fail. > =20 > =20 > ./pg_upgrade -b $OLD/bin -B $NEWd/bin -d $OLD -D $OLD -k -c > =20 > =20 > Thx, > Jana >=20 >=20 > Obsah t=C3=A9to zpr=C3=A1vy m=C3=A1 v=C3=BDlu=C4=8Dn=C4=9B = komunika=C4=8Dn=C3=AD charakter. Nep=C5=99edstavuje n=C3=A1vrh na = uzav=C5=99en=C3=AD smlouvy =C4=8Di na jej=C3=AD zm=C4=9Bnu ani p=C5=99ijet= =C3=AD p=C5=99=C3=ADpadn=C3=A9ho n=C3=A1vrhu. Smlouvy =C4=8Di jejich = zm=C4=9Bny jsou spole=C4=8Dnost=C3=AD CETIN a.s. uzav=C3=ADr=C3=A1ny v = p=C3=ADsemn=C3=A9 form=C4=9B nebo v podob=C4=9B a postupem podle = p=C5=99=C3=ADslu=C5=A1n=C3=BDch v=C5=A1eobecn=C3=BDch podm=C3=ADnek = spole=C4=8Dnosti CETIN a.s., a pokud jsou dohodnuty v=C5=A1echny = n=C3=A1le=C5=BEitosti. Smlouvy jsou uzav=C3=ADr=C3=A1ny opr=C3=A1vn=C4=9Bn= ou osobou na z=C3=A1klad=C4=9B p=C3=ADsemn=C3=A9ho pov=C4=9B=C5=99en=C3=AD= . Smlouvy o smlouv=C4=9B budouc=C3=AD jsou uzav=C3=ADr=C3=A1ny = v=C3=BDhradn=C4=9B v p=C3=ADsemn=C3=A9 form=C4=9B, vlastnoru=C4=8Dn=C4=9B = podepsan=C3=A9 nebo s uzn=C3=A1van=C3=BDm elektronick=C3=BDm podpisem. = Podm=C3=ADnky, za nich=C5=BE CETIN a.s. p=C5=99istupuje k jedn=C3=A1n=C3=AD= o smlouv=C4=9B a jak=C3=BDmi se =C5=99=C3=ADd=C3=AD, jsou dostupn=C3=A9 = zde. >=20 > The content of this message is intended for communication purposes = only. It does neither represent any contract proposal, nor its amendment = or acceptance of any potential contract proposal. CETIN a.s. concludes = contracts or amendments thereto in a written form or in the form and the = procedure in accordance with relevant general terms and conditions of = CETIN a.s., if all requirements are agreed. Contracts are concluded by = an authorized person entitled on the basis of a written authorization. = Contracts on a future contract are concluded solely in a written form, = self-signed or signed by means of an advanced electronic signature. The = conditions under which CETIN a.s. negotiates contracts and under which = it proceeds are available here. >=20 >=20 > Obsah t=C3=A9to zpr=C3=A1vy m=C3=A1 v=C3=BDlu=C4=8Dn=C4=9B = komunika=C4=8Dn=C3=AD charakter. Nep=C5=99edstavuje n=C3=A1vrh na = uzav=C5=99en=C3=AD smlouvy =C4=8Di na jej=C3=AD zm=C4=9Bnu ani p=C5=99ijet= =C3=AD p=C5=99=C3=ADpadn=C3=A9ho n=C3=A1vrhu. Smlouvy =C4=8Di jejich = zm=C4=9Bny jsou spole=C4=8Dnost=C3=AD CETIN a.s. uzav=C3=ADr=C3=A1ny v = p=C3=ADsemn=C3=A9 form=C4=9B nebo v podob=C4=9B a postupem podle = p=C5=99=C3=ADslu=C5=A1n=C3=BDch v=C5=A1eobecn=C3=BDch podm=C3=ADnek = spole=C4=8Dnosti CETIN a.s., a pokud jsou dohodnuty v=C5=A1echny = n=C3=A1le=C5=BEitosti. Smlouvy jsou uzav=C3=ADr=C3=A1ny opr=C3=A1vn=C4=9Bn= ou osobou na z=C3=A1klad=C4=9B p=C3=ADsemn=C3=A9ho pov=C4=9B=C5=99en=C3=AD= . Smlouvy o smlouv=C4=9B budouc=C3=AD jsou uzav=C3=ADr=C3=A1ny = v=C3=BDhradn=C4=9B v p=C3=ADsemn=C3=A9 form=C4=9B, vlastnoru=C4=8Dn=C4=9B = podepsan=C3=A9 nebo s uzn=C3=A1van=C3=BDm elektronick=C3=BDm podpisem. = Podm=C3=ADnky, za nich=C5=BE CETIN a.s. p=C5=99istupuje k jedn=C3=A1n=C3=AD= o smlouv=C4=9B a jak=C3=BDmi se =C5=99=C3=ADd=C3=AD, jsou dostupn=C3=A9 = zde. >=20 > The content of this message is intended for communication purposes = only. It does neither represent any contract proposal, nor its amendment = or acceptance of any potential contract proposal. CETIN a.s. concludes = contracts or amendments thereto in a written form or in the form and the = procedure in accordance with relevant general terms and conditions of = CETIN a.s., if all requirements are agreed. Contracts are concluded by = an authorized person entitled on the basis of a written authorization. = Contracts on a future contract are concluded solely in a written form, = self-signed or signed by means of an advanced electronic signature. The = conditions under which CETIN a.s. negotiates contracts and under which = it proceeds are available here.