subscriptions on <literal>node3</literal> that are
subscribing the changes from <literal>node2</literal> by using
<link linkend="sql-altersubscription-params-disable"><command>ALTER SUBSCRIPTION ... DISABLE</command></link>,
e.g.:
<programlisting>
/* node3 # */ ALTER SUBSCRIPTION sub1_node2_node3 DISABLE;
</programlisting>
</para>
</step>
<step>
<para>
Stop the server in <literal>node2</literal>, e.g.:
<programlisting>
pg_ctl -D /opt/PostgreSQL/data2 stop
</programlisting>
</para>
</step>
<step>
<para>
Initialize <literal>data2_upgraded</literal> instance by using the
required newer version.
</para>
</step>
<step>
<para>
Upgrade the <literal>node2</literal>'s server to the required
new version, e.g.:
<programlisting>
pg_upgrade
--old-datadir "/opt/PostgreSQL/postgres/17/data2"
--new-datadir "/opt/PostgreSQL/postgres/18/data2_upgraded"
--old-bindir "/opt/PostgreSQL/postgres/17/bin"
--new-bindir "/opt/PostgreSQL/postgres/18/bin"
</programlisting>
</para>
</step>
<step>
<para>
Start the upgraded server in <literal>node2</literal>, e.g.:
<programlisting>
pg_ctl -D /opt/PostgreSQL/data2_upgraded start -l logfile
</programlisting>
</para>
</step>
<step>
<para>
On <literal>node2</literal>, create any tables that were created in
the upgraded publisher <literal>node1</literal> server between
<xref linkend="cascaded-cluster-disable-sub-node1-node2"/>
and now, e.g.:
<programlisting>
/* node2 # */ CREATE TABLE distributors (did integer PRIMARY KEY, name varchar(40));
</programlisting>
</para>
</step>
<step>
<para>
Enable all the subscriptions on <literal>node2</literal> that are
subscribing the changes from <literal>node1</literal> by using
<link linkend="sql-altersubscription-params-enable"><command>ALTER SUBSCRIPTION ... ENABLE</command></link>,
e.g.:
<programlisting>
/* node2 # */ ALTER SUBSCRIPTION sub1_node1_node2 ENABLE;
</programlisting>
</para>
</step>
<step>
<para>
Refresh the <literal>node2</literal> subscription's publications using
<link linkend="sql-altersubscription-params-refresh-publication"><command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command></link>,
e.g.:
<programlisting>
/* node2 # */ ALTER SUBSCRIPTION sub1_node1_node2 REFRESH PUBLICATION;
</programlisting>
</para>
</step>
<step>
<para>
Stop the server in <literal>node3</literal>, e.g.:
<programlisting>
pg_ctl -D /opt/PostgreSQL/data3 stop
</programlisting>
</para>
</step>
<step>
<para>
Initialize <literal>data3_upgraded</literal> instance by using the
required newer version.
</para>
</step>
<step>
<para>
Upgrade the <literal>node3</literal>'s server to the required
new version, e.g.:
<programlisting>
pg_upgrade
--old-datadir "/opt/PostgreSQL/postgres/17/data3"
--new-datadir "/opt/PostgreSQL/postgres/18/data3_upgraded"
--old-bindir "/opt/PostgreSQL/postgres/17/bin"
--new-bindir "/opt/PostgreSQL/postgres/18/bin"
</programlisting>
</para>
</step>
<step>
<para>
Start the upgraded server in <literal>node3</literal>, e.g.:
<programlisting>
pg_ctl -D /opt/PostgreSQL/data3_upgraded start -l logfile
</programlisting>
</para>
</step>
<step>
<para>
On <literal>node3</literal>, create any tables that were created in
the upgraded <literal>node2</literal> between
<xref linkend="cascaded-cluster-disable-sub-node2-node3"/> and now,
e.g.:
<programlisting>
/* node3 # */ CREATE TABLE distributors (did integer PRIMARY KEY, name varchar(40));
</programlisting>