Failed to restore from backup: All subscriptions and replication slots must be dropped before a backup can be restored.

Last edited: 1/18/2025

As the error suggests, you must first drop any current subscriptions or replication slots to restore backups.

You can check those with:


_10
SELECT * FROM pg_replication_slots;
_10
_10
SELECT * FROM pg_subscription;

You can drop them with:


_10
DROP SUBSCRIPTION <subscription>;
_10
_10
SELECT pg_drop_replication_slot(slot_name);

NOTE: These are destructive actions. This is fine since you will overwrite your database with a backup.