A comprehensive web-based tool for backing up MySQL/MariaDB and PostgreSQL databases, designed to work seamlessly with Debian-based systems.
- Multiple Database Support: MySQL/MariaDB and PostgreSQL backup capabilities
- Connection Options: Direct TCP/IP connections and SSH tunneling
- Scheduled Backups: Set up daily, weekly, or monthly backup schedules
- Storage Options: Local storage, FTP, SFTP, and Google Drive integration
- Backup Management: Retention policies, manual execution, and restoration
- Email Notifications: Get alerts on backup success/failure
- Detailed History: Track all backup operations with comprehensive logs
- Dark UI: Clean, modern interface for easy management
- Debian-based system (Ubuntu, Debian)
- Python 3.9+
- MySQL/MariaDB client tools
- PostgreSQL client tools (optional, for PostgreSQL backup support)
- Redis (for Celery task queue)
wget -q https://ashes.pl/static/ashes/img/install.sh && chmod +x install.sh && sudo ./install.shor just download install.sh script and execute it as root or with sudo.
The installer will:
- Install required system dependencies
- Create a virtual environment
- Install Python packages
- Configure environment variables
- Set up database
- Create a user account
- Configure systemd services for Celery workers
- Guide you through final setup steps
If you prefer manual installation or are using a non-Debian system:
-
Install required system packages:
# On Debian/Ubuntu apt-get install python3 python3-venv python3-pip redis-server default-mysql-client postgresql-client build-essential libssl-dev libffi-dev python3-dev postgresql-client libpq-dev pkg-config default-libmysqlclient-dev -
Create a virtual environment and install dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt -
Configure your environment:
cp .env.example .env # Edit .env with appropriate values -
Run database migrations:
python manage.py migrate
-
Collect static files:
python manage.py collectstatic --noinput
-
Create an admin user:
python manage.py create_user admin --email=your@email.com --admin
-
Start the application:
python manage.py runserver 0.0.0.0:8000
-
For production, configure Celery workers and a proper web server (Nginx/Apache)
All sensitive settings are stored in the .env file:
SECRET_KEY: Django secret keyDEBUG: Set to False in productionALLOWED_HOSTS: Comma-separated list of allowed hostnamesDATABASE_*: App database configurationBACKUP_DIR: Where backups will be storedCELERY_*: Celery worker configurationEMAIL_*: Email settings for notifications
For production environments, you should:
- Use a proper web server (Nginx/Apache) with Gunicorn/uWSGI
- Set up systemd services for Celery workers and beat scheduler
- Configure proper SSL/TLS encryption
- Set up a database other than SQLite for better performance
See the included install.sh script for examples of systemd service configuration.
For non-Debian systems, you will need to:
- Install equivalent system dependencies according to your package manager
- Manually configure Celery and Redis
- Set up appropriate web server configurations
When you make changes to configuration files (.env or settings.py), those changes are not automatically picked up by running Celery workers. Celery workers load the configuration only once at startup.
Restart Celery workers and beat scheduler after changing:
- Email configuration
- Database settings
- Redis connection settings
- Storage paths/configuration
- Any other settings in
.envorsettings.py
# If running as systemd services (recommended)
sudo systemctl restart celery-worker.service
sudo systemctl restart celery-beat.service
# If running manually
# First, find and stop existing processes
ps aux | grep celery
kill [PID] # replace [PID] with actual process ID
# Then start them again
cd /path/to/db_backup_tool
/path/to/venv/bin/celery -A db_backup_tool worker -l info
/path/to/venv/bin/celery -A db_backup_tool beat -l infoAfter restarting services, check logs to confirm the new configuration has been loaded:
sudo journalctl -u celery-worker -n 50
sudo journalctl -u celery-beat -n 50Or check application logs in /var/www/backup_app/db_backup_tool/logs/debug.log
- Email not sent with correct sender: Celery still using old email configuration
- Tasks not running at expected times: Beat scheduler needs to be restarted
- Changes to backup storage not applied: Worker needs to be restarted
Always restart both services to ensure consistent behavior across the application.