Upgrading

How to safely move to new versions of Black Candy Store.

⚠️ Always read the release notes before upgrading. New versions may include breaking changes or required migration steps.

Standard Upgrade (Docker)

Pull the new image, remove the old container, and start fresh:

# Pull latest
docker pull ghcr.io/ajeskey/blackcandystore:latest

# Stop and remove old container
docker stop blackcandystore
docker rm blackcandystore

# Start with the new image (use your existing options)
docker run -d --name blackcandystore \
  -v ./storage_data:/rails/storage \
  -v /path/to/music:/media_data \
  -e MEDIA_PATH=/media_data \
  -e SECRET_KEY_BASE=your_secret \
  -p 80:80 \
  ghcr.io/ajeskey/blackcandystore:latest

Upgrade with Docker Compose

docker pull ghcr.io/ajeskey/blackcandystore:latest
docker-compose down
docker-compose up -d

Backup First

Before any upgrade, back up your data:

# SQLite backup
cp -r ./storage_data ./storage_data_backup_$(date +%Y%m%d)

Pinning Versions

Instead of :latest, you can pin to a specific version tag for more control over when you upgrade:

docker run -p 80:80 ghcr.io/ajeskey/blackcandystore:v1.2.0

Database Migrations

Database migrations run automatically on container startup. If a migration fails, the container will exit with an error. Check the logs:

docker logs blackcandystore

Rolling Back

If something goes wrong:

  1. Stop the new container
  2. Restore your backup
  3. Start the container with the previous image version
# Restore backup
rm -rf ./storage_data
cp -r ./storage_data_backup_20250101 ./storage_data

# Run previous version
docker run -p 80:80 ghcr.io/ajeskey/blackcandystore:v1.1.0

Downgrades are not always safe — newer migrations may not be reversible. Always test upgrades in a staging environment first if possible.