Skip to main content

Backup & Upgrade

Maintain your BillManager instance with regular backups and updates.

Backing Up

Database Backup

Create a SQL backup of your PostgreSQL database:

docker exec -t billmanager-db-1 pg_dump -U billsuser billmanager > backup_$(date +%Y%m%d).sql

Automated Backups

Set up a cron job for daily backups:

# Edit crontab
crontab -e

# Add daily backup at 2 AM
0 2 * * * docker exec -t billmanager-db-1 pg_dump -U billsuser billmanager > /path/to/backups/billmanager_$(date +\%Y\%m\%d).sql

Backup Retention

Keep multiple backups and clean old ones:

# Keep last 30 days of backups
find /path/to/backups -name "billmanager_*.sql" -mtime +30 -delete

Restoring from Backup

Full Restore

# Stop the application
docker-compose stop billmanager

# Restore the database
cat backup_20240101.sql | docker exec -i billmanager-db-1 psql -U billsuser billmanager

# Start the application
docker-compose start billmanager

Partial Restore

For specific tables or data, edit the SQL backup to include only what you need.

Upgrading BillManager

Standard Upgrade

# Pull the latest image
docker-compose pull

# Restart with the new image
docker-compose up -d

# Check logs for any migration messages
docker-compose logs -f billmanager

Upgrade to Specific Version

services:
billmanager:
image: ghcr.io/brdweb/billmanager:v3.4.0

Then:

docker-compose up -d

Before Upgrading

  1. Read the release notes on GitHub Releases
  2. Create a backup of your database
  3. Test in staging if you have a staging environment

After Upgrading

  1. Check the application logs for errors
  2. Verify key functionality works
  3. Database migrations run automatically on startup

Rollback

If an upgrade causes issues:

# Stop the application
docker-compose down

# Restore database from backup
cat backup_before_upgrade.sql | docker exec -i billmanager-db-1 psql -U billsuser billmanager

# Edit docker-compose.yml to use previous version
# image: ghcr.io/brdweb/billmanager:v3.3.0

# Start the previous version
docker-compose up -d

Data Migration

Exporting Data

Users can export their bills and payments from the web interface:

  1. Go to the Bills page
  2. Click Export → CSV or PDF

Importing from v2.x

If upgrading from SQLite-based v2.x:

  1. Contact the maintainer for migration assistance
  2. The migration script can import data from SQLite databases
  3. See GitHub Issues for help