Upgrading LeadCMS

This guide covers how to safely upgrade your LeadCMS Docker Compose installation to the latest version, including backup procedures, database migrations, and rollback strategies.

Docker Compose Focus

This guide is specifically for Docker Compose deployments as covered in our deployment guide. For production environments with managed services, adapt these procedures to your infrastructure.

Before You Upgrade

Check Current Version

# Or check via API
curl http://localhost:8080/api/version

Review Release Notes

Always review the release notes before upgrading:

  • Check Core Releases for application changes
  • Check for breaking changes
  • Note any new configuration requirements
  • Review plugin compatibility

Backup Your System

Critical: Create Backups

Always create complete backups before upgrading. Use the provided backup scripts for reliable backup and restore procedures.

We recommend using the automated backup scripts covered in detail in our Backups and Recovery guide.

Quick Backup with Scripts

# Full backup using the pg-backup.sh script
./pg-backup.sh leadcms

# This creates: leadcms-backup-YYYY-MM-DD-HH-MM.sql
# Verify backup was created successfully
ls -lh leadcms-backup-*.sql

Configuration Backup

# Backup essential configuration files
cp .env .env.backup
cp docker-compose.yml docker-compose.yml.backup

# If you have custom plugins mounted via volumes
cp -r plugins/ plugins_backup/ 2>/dev/null || echo "No custom plugins directory found"

Upgrade Process

This is the simplest method for upgrading when using the standard LeadCMS Docker images:

Stop Current Services

# Navigate to your docker-compose directory
cd /path/to/your/leadcms/docker-compose

# Stop all services
docker compose down

Update Image Version

Edit your docker-compose.yml to use the new version:

services:
  leadcms:
    image: leadcms/core:v2.1.0  # Update to desired version
    # ... rest of your configuration

Pull New Image

# Pull the new image
docker compose pull leadcms

Start Services

# Start services with new image
docker compose up -d

Database Migrations

LeadCMS automatically runs database migrations when the container starts. You can monitor this process:

Best Practices

Upgrade Strategy

  1. Test in staging before production
  2. Schedule maintenance windows for upgrades
  3. Monitor closely after upgrades
  4. Have rollback plan ready
  5. Document changes for your team

Getting Help

If you encounter issues during upgrade:

  1. Review GitHub issues
  2. Join our community discussions
  3. Contact professional support