Performing cleanup
==================

In this final phase you decommission the legacy replication
infrastructure.

Decoupling the source replication
---------------------------------

After the application has been successfully switched to the PGD cluster,
remove the migration links to fully decouple the environments.

To confirm that data is no longer flowing through the source node, you
must disable the logical subscriptions on all PGD nodes that connect
back to the original PSR source. On all PGD nodes, run:

.. code:: sql

   DROP SUBSCRIPTION `subscription_name`;

Where ``subscription_name`` is the name of the subscription on each
node.

Cleaning up the seed node
-------------------------

After the migration is finalized and the cluster is stable, the seed
node no longer requires the legacy version of Postgres. You can now
remove the corresponding outdated packages from the node to free up
resources and simplify future maintenance.
