This guide walks you through the process of downgrading Portainer from Enterprise Edition to Community Edition in a Docker Swarm environment.


Prerequisites

  • Docker Swarm cluster with Portainer EE installed
  • Access to the manager node
  • Administrative privileges

Step-by-Step Downgrade Process

βš™οΈ Step 1: Take a Backup

πŸ“¦ Backup your Portainer data and store it in a safe location before making any changes.

This ensures you can restore your instance if anything goes wrong.
Example:

docker run --rm -v portainer_data:/data -v $(pwd):/backup busybox tar czf /backup/portainer_backup.tar.gz /data



🧱 Step 2: Stop Existing Portainer Business Instance (Standalone Mode)

πŸ›‘ Shut down the existing Portainer Business (EE) container.

docker stop <portainer_id>



🐳 Step 3: Scale Down the Portainer Service (Swarm Mode)

If you are running Portainer in Docker Swarm, scale down the service to 0 replicas.

docker service scale portainer=0



πŸ”„ Step 4: Downgrade the Portainer Database

Use the following command to downgrade the Portainer database to be compatible with the Community Edition (CE).

Replace portainer_data with your actual Portainer data volume or bind mount.

docker run -it --name portainer-database-rollback \

-v portainer_data:/data \

portainer/portainer-ee:latest \

–rollback-to-ce


πŸš€ Step 5: Redeploy Portainer CE (Swarm Mode)

After downgrading the database, redeploy Portainer Community Edition and reuse the existing Portainer Business data.


docker service create \
--name portainer \
--publish 9000:9000 \
--publish 9443:9443 \
--constraint 'node.role == manager' \
--mount type=bind,source=/dockerswarm/data/portainer_ee,target=/data \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
portainer/portainer-ce:latest

πŸ›°οΈ Step 6: Deploy the Portainer Agent

Deploy the Portainer Agent service across all nodes in the Swarm.
This allows Portainer CE to communicate with and manage Docker nodes.


docker service create \
--name portainer_agent \
--network portainer_agent_network \
--mode global \
--publish 9001:9001 \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
portainer/agent:latest


The --mode global flag ensures the agent runs on every node in the Swarm cluster.

If you are still facing an issue, feel free to Ask Doubts in the Comment Section Below and Don’t Forget to Follow us on πŸ‘Β Social Networks.

| Happy Splunking πŸ˜‰