<listitem>
<para>
The old cluster has replicated all the transactions and logical decoding
messages to subscribers.
</para>
</listitem>
<listitem>
<para>
All slots on the old cluster must be usable, i.e., there are no slots
whose
<link linkend="view-pg-replication-slots">pg_replication_slots</link>.<structfield>conflicting</structfield>
is not <literal>true</literal>.
</para>
</listitem>
<listitem>
<para>
The new cluster must not have permanent logical slots, i.e.,
there must be no slots where
<link linkend="view-pg-replication-slots">pg_replication_slots</link>.<structfield>temporary</structfield>
is <literal>false</literal>.
</para>
</listitem>
</itemizedlist>
</sect2>
<sect2 id="prepare-subscriber-upgrades">
<title>Prepare for subscriber upgrades</title>
<para>
Setup the <link linkend="logical-replication-config-subscriber">
subscriber configurations</link> in the new subscriber.
<application>pg_upgrade</application> attempts to migrate subscription
dependencies which includes the subscription's table information present in
<link linkend="catalog-pg-subscription-rel">pg_subscription_rel</link>
system catalog and also the subscription's replication origin. This allows
logical replication on the new subscriber to continue from where the
old subscriber was up to. Migration of subscription dependencies is only
supported when the old cluster is version 17.0 or later. Subscription
dependencies on clusters before version 17.0 will silently be ignored.
</para>
<para>
There are some prerequisites for <application>pg_upgrade</application> to
be able to upgrade the subscriptions. If these are not met an error
will be reported.
</para>
<itemizedlist>
<listitem>
<para>
All the subscription tables in the old subscriber should be in state
<literal>i</literal> (initialize) or <literal>r</literal> (ready). This
can be verified by checking <link linkend="catalog-pg-subscription-rel">pg_subscription_rel</link>.<structfield>srsubstate</structfield>.
</para>
</listitem>
<listitem>
<para>
The replication origin entry corresponding to each of the subscriptions
should exist in the old cluster. This can be found by checking
<link linkend="catalog-pg-subscription">pg_subscription</link> and
<link linkend="catalog-pg-replication-origin">pg_replication_origin</link>
system tables.
</para>
</listitem>
<listitem>
<para>
The new cluster must have
<link linkend="guc-max-active-replication-origins"><varname>max_active_replication_origins</varname></link>
configured to a value greater than or equal to the number of
subscriptions present in the old cluster.
</para>
</listitem>
</itemizedlist>
</sect2>
<sect2 id="upgrading-logical-replication-clusters">
<title>Upgrading logical replication clusters</title>
<para>
While upgrading a subscriber, write operations can be performed in the
publisher. These changes will be replicated to the subscriber once the
subscriber upgrade is completed.
</para>
<note>
<para>
The logical replication restrictions apply to logical replication cluster
upgrades also. See <xref linkend="logical-replication-restrictions"/> for
details.
</para>
<para>
The prerequisites of publisher upgrade apply to logical replication
cluster upgrades also. See <xref linkend="prepare-publisher-upgrades"/>
for details.
</para>
<para>
The prerequisites of subscriber upgrade apply to logical replication
cluster upgrades also. See <xref linkend="prepare-subscriber-upgrades"/>
for details.
</para>
</note>
<warning>
<para>
Upgrading logical replication cluster requires multiple steps to be
performed on various nodes. Because