Updating BillaBear
This guide provides comprehensive instructions for updating your BillaBear installation to the latest version. Regular updates ensure you have access to the newest features, security patches, and bug fixes.
Update Detection
BillaBear includes a built-in update detection system that automatically checks for new versions. This system works as follows:
- The
billabear:update:check
command runs daily (typically via a scheduled task/cron job) - When a new version is detected, an alert appears in the BillaBear admin interface
- The alert includes a link to this documentation to guide you through the update process
Before Updating
Before updating your BillaBear installation, it's important to take these precautionary steps:
- Create a backup of your database and application files
- Review the changelog for any breaking changes or special update instructions
- Check compatibility with your current environment (PHP version, extensions, etc.)
- Plan for downtime if necessary, especially for major version updates
Update Process by Deployment Method
The update process varies depending on how you've deployed BillaBear. Follow the instructions for your specific deployment method.
Docker Compose Deployment
If you're using the recommended Docker Compose setup:
Navigate to your BillaBear directory:
cd /path/to/billabear
Pull the latest changes from the repository:
git pull
Rebuild and restart the containers:
docker compose down
docker compose up -dThe update process will automatically:
- Update application files
- Run database migrations
- Clear caches
- Rebuild assets
Verify the update was successful by checking the version number in the admin interface
DigitalOcean App Platform Deployment
If you've deployed BillaBear to DigitalOcean App Platform:
- Log in to your DigitalOcean account
- Navigate to the App Platform section
- Select your BillaBear application
- Click on the "Components" tab
- Find the BillaBear service and click the three-dot menu
- Select "Force Rebuild and Deploy"
- The platform will automatically pull the latest version and deploy it
Manual Deployment
If you've installed BillaBear manually:
Navigate to your BillaBear directory:
cd /path/to/billabear
Pull the latest changes from the repository:
git pull
Install or update dependencies:
composer install --no-dev --optimize-autoloader
npm installBuild frontend assets:
npm run build
Run database migrations:
php bin/console doctrine:migrations:migrate --no-interaction
Clear the cache:
php bin/console cache:clear
Ensure proper permissions:
chmod -R 777 var/cache var/log
Database Migrations
During the update process, BillaBear automatically runs database migrations to ensure your database schema is compatible with the new version. These migrations:
- Add new tables and columns required by new features
- Modify existing structures as needed
- Migrate data to new formats when necessary
If you need to run migrations manually, use the following command:
php bin/console doctrine:migrations:migrate --no-interaction
Post-Update Tasks
After updating BillaBear, it's recommended to:
- Test critical functionality to ensure everything works as expected
- Check for new configuration options that may have been added
- Review new features to take advantage of the latest capabilities
- Update any custom integrations that might be affected by the update
Troubleshooting
If you encounter issues during or after the update process:
Common Issues
Database migration errors
- Check the migration logs for specific errors
- Ensure your database user has sufficient privileges
- Verify database compatibility with the new version
Asset compilation failures
- Ensure Node.js and npm are installed and up to date
- Clear the node_modules directory and reinstall dependencies
- Check for JavaScript errors in the browser console
Permission issues
- Ensure the web server has write access to the var/cache and var/log directories
- Check file ownership and permissions
White screen or 500 errors
- Check the application logs in var/log
- Enable development mode temporarily to see detailed error messages
- Verify PHP extensions and version requirements
Getting Help
If you're unable to resolve update issues:
- Check the GitHub Issues for similar problems
- Post a question in GitHub Discussions
- Contact support at support@billabear.com
Rollback Procedure
If you need to revert to a previous version:
Restore your database from backup
For Docker deployments:
git checkout [previous-version-tag]
docker compose down
docker compose up -dFor manual deployments:
git checkout [previous-version-tag]
composer install --no-dev --optimize-autoloader
npm install
npm run build
php bin/console cache:clear
Best Practices
To ensure smooth updates in the future:
- Update regularly to avoid large, potentially problematic jumps between versions
- Subscribe to release notifications to stay informed about new versions
- Test updates in a staging environment before applying to production
- Maintain regular backups of your database and application files
- Document any customizations you've made to core files
- Run the update check command regularly to detect new versions:
php bin/console billabear:update:check
By following these guidelines, you can keep your BillaBear installation up to date while minimizing potential disruptions to your billing operations.