Webinoly provides robust backup capabilities for databases, sites, and entire server configurations. This guide covers all backup options from local backups to automated S3 synchronization.
Database Backups
Local Database Backup
Backup a WordPress site database:
sudo webinoly -backup=local -wp=example.com
Backup a specific database:
sudo webinoly -backup=local -dbname=my_database
Backup Multiple Databases
# Backup multiple databases
sudo webinoly -backup=local -dbname=[db1,db2,db3]
# Backup all databases
sudo webinoly -backup=local -dbname=all
Custom Backup Location
# Specify destination folder
sudo webinoly -backup=local -wp=example.com -destination=/backups
# Custom filename
sudo webinoly -backup=local -wp=example.com -filename=my-backup.sql
Default backup location: ~/webinoly-backups/[site-name]/
Automatic Rotation
Keep only the last N backups:
# Keep only last 5 backups
sudo webinoly -backup=local -wp=example.com -max=5
Site Backups
Export complete site configurations including files and databases.
Export a Site
# Export single site
sudo webinoly -backup=export -site=example.com
This creates a tar archive containing:
- Nginx configuration files
- Site files and directories
- Database backup (if WordPress)
- SSL certificates
- Custom cache configurations
Export Multiple Sites
sudo webinoly -backup=export -site=[example.com,demo.com,test.com]
Export with Subfolder
sudo webinoly -backup=export -site=example.com -subfolder=/blog
Skip Database in Export
sudo webinoly -backup=export -site=example.com -skip-db
Full Server Backup
Export your entire Webinoly server configuration.
Export Server
sudo webinoly -backup=export -server
This exports:
- Webinoly configuration file
- All Nginx configurations
- All sites and databases
- SSL certificates (Let’s Encrypt)
- HTTP authentication files
- Custom headers
- AWS credentials
Server Export with S3 Upload
sudo webinoly -backup=export -server -bucket=my-bucket -max=7
Full server backups can be large. Ensure adequate disk space before running.
AWS S3 Backups
Automate backups to AWS S3 for off-site storage and disaster recovery.
Setup S3 Credentials
sudo webinoly -aws-s3-credentials=[access_key,secret_key]
Or use interactive mode:
sudo webinoly -aws-s3-credentials
# Enter Access Key ID and Secret Access Key when prompted
Using IAM Roles
For EC2 instances with IAM roles:
sudo webinoly -aws-s3-credentials=awsiamrole
Create S3 Backup Profile
sudo webinoly -backup=s3 -profile=myprofile
You’ll be prompted for:
- S3 Bucket name: Your S3 bucket (e.g.,
my-backups or my-backups/folder)
- Source path: Local directory to backup (e.g.,
/var/www/example.com)
- Max age: How long to keep backups (default: 1M for 1 month)
S3 Profile Management
# List all backup profiles
sudo webinoly -backup=s3 -list
# View profile information
sudo webinoly -backup=s3 -profile=myprofile -info
# Delete a profile
sudo webinoly -backup=s3 -profile=myprofile -delete
Run S3 Backup
sudo webinoly -backup=s3 -profile=myprofile -run
This performs:
- Incremental backup to S3
- Verification of uploaded files
- Automatic cleanup based on max age
Automated Database Backups to S3
Configure pre-backup database dumps:
# Add database backup before S3 sync
sudo webinoly -backup=s3 -profile=myprofile -add-db-pre=example.com
# With custom retention
sudo webinoly -backup=s3 -profile=myprofile -add-db-pre=example.com -max=10
# Upload to S3 bucket
sudo webinoly -backup=s3 -profile=myprofile -add-db-pre=example.com -bucket=db-backups
List and Remove Pre-Backups
# List configured pre-backups
sudo webinoly -backup=s3 -profile=myprofile -add-db-pre -list
# Remove pre-backup configuration
sudo webinoly -backup=s3 -profile=myprofile -add-db-pre -delete
S3-Compatible Services
Use S3-compatible services like DigitalOcean Spaces, Wasabi, or MinIO:
# Create profile with custom endpoint
sudo webinoly -backup=s3 -profile=spaces -s3-compatible-endpoint=https://nyc3.digitaloceanspaces.com
# Send file to S3-compatible service
sudo webinoly -backup=s3 -send-to-s3=/path/to/file -bucket=my-bucket -s3-compatible-endpoint=https://s3.wasabisys.com
Restore from Backup
Restore from S3
# Restore entire backup
sudo webinoly -backup=s3 -profile=myprofile -restore -destination=/var/www/restore
# Restore specific file or folder
sudo webinoly -backup=s3 -profile=myprofile -restore=htdocs/wp-content -destination=/tmp/restore
# Restore from specific date
sudo webinoly -backup=s3 -profile=myprofile -restore -destination=/restore -date=7D
Date format options:
3D - 3 days ago
2W - 2 weeks ago
1M - 1 month ago
2023-12-25 - Specific date
Import Database
# Import SQL file
sudo webinoly -db-import -file=/path/to/backup.sql
# Import to specific database
sudo webinoly -db-import -file=/path/to/backup.sql -dbname=my_database
Import Site Backup
sudo webinoly -backup=import -file=/path/to/site-backup.tar
This restores:
- Nginx site configuration
- Site files and directories
- Database (if included)
- SSL certificates
- HTTP authentication
Import Full Server
# Import full server configuration
sudo webinoly -backup=import -file=/path/to/server-backup.tar -import=full
# Import only stack configuration
sudo webinoly -backup=import -file=/path/to/server-backup.tar -import=stack
# Import only sites (no stack)
sudo webinoly -backup=import -file=/path/to/server-backup.tar -import=sites
Importing a full server backup on an existing installation may overwrite current configurations. Use -import=sites for safer restoration.
Send Files to S3
Manually upload files to S3:
sudo webinoly -backup=s3 -send-to-s3=/path/to/file.tar -bucket=my-bucket
Backup Best Practices
-
Regular Schedule: Set up cron jobs for automated backups
# Daily database backup at 2 AM
0 2 * * * sudo webinoly -backup=local -dbname=all -max=7
# Weekly full S3 backup
0 3 * * 0 sudo webinoly -backup=s3 -profile=weekly -run
-
3-2-1 Rule: Keep 3 copies on 2 different media with 1 offsite
-
Test Restores: Regularly test backup restoration procedures
-
Monitor Backup Size: Track backup growth over time
du -sh ~/webinoly-backups/*
-
Exclude Temporary Files: Configure backup profiles to skip cache and temp directories
Backup Wizard
Use the interactive backup wizard:
This provides a menu-driven interface for:
- Adding AWS S3 credentials
- Creating S3 backup profiles
- Running backups
- Managing configurations
- Exporting sites and servers
Troubleshooting
S3 Connection Issues
# Verify credentials
cat ~/.aws/credentials
# Test connection with AWS CLI
aws s3 ls s3://my-bucket
Large Backup Failures
For very large backups, consider:
- Excluding cache directories
- Using incremental backups
- Increasing timeout values
- Splitting into multiple profiles
Backup Not Running
Check duply logs:
sudo cat ~/.duply/[profile]/backup.log