
Your WordPress database holds every post, comment, user account, and setting on your site. If it breaks or gets lost, your whole site goes down. That is why an automatic WordPress database backup to object storage is one of the smartest things you can do for your website. Object storage is cheap, safe, and easy to use. In this guide, you will learn how to back up your WordPress database step by step — even if you are new to this.
Quick Picks – Best Object Storage for Automatic WordPress Database Backups
Not all object storage services are the same. Here are the top three choices for your automatic WordPress database backup to object storage in 2026.
Best for Zero Egress Fees: Cloudflare R2
Cloudflare R2 costs $0.015 per GB per month. The best part? There are zero egress fees. You never pay to download your backup files. R2 also gives you 10 GB of free storage forever. This makes it a great pick for small and medium WordPress sites.
Best for Lowest Cost: Backblaze B2
Backblaze B2 charges about $0.005 per GB per month. That is three times cheaper than R2 for storage. Egress fees are around $0.01 per GB, with the first 10 GB free each month. B2 also offers a 10 GB free tier. If you want the lowest price and do not restore often, B2 is a solid pick for automatic WordPress database backup to object storage.
Best for Enterprise: Amazon S3
Amazon S3 is the most well-known option. It costs $0.023 per GB per month, and egress is $0.09 per GB for the first 10 TB. The 5 GB free tier only lasts 12 months. S3 is great for large businesses that need deep integration with other AWS tools. For most WordPress sites, R2 or B2 will save you more money on your automatic WordPress database backup to object storage.
| Provider | Storage Cost (/GB/month) | Egress Fee (/GB) | Free Tier |
|---|---|---|---|
| Cloudflare R2 | $0.015 | $0 (Free) | 10 GB forever |
| Backblaze B2 | $0.005 | ~$0.01 | 10 GB forever |
| Amazon S3 | $0.023 | $0.09 | 5 GB (12 months) |
Why You Should Back Up Your WordPress Database to Object Storage
Some people ask: “Why not just use my hosting provider’s backup?” The answer is simple. If your host goes down, their backups may go down too. Here is why an automatic WordPress database backup to object storage is the better choice.
Database-Only Backups Save 90%+ Storage Space
A full WordPress backup includes themes, plugins, images, and the database. But the database is what really matters. A database-only backup file is often just a few megabytes. That is 90% smaller than a full site backup. When you set up automatic WordPress database backup to object storage, you use far less space and pay less money.
Disaster Recovery Beyond Hosting Failures
What if your host deletes your account by mistake? What if a bad plugin update wipes your database? Object storage sits outside your hosting environment. Your backups stay safe even if your host has problems. This is the main power of automatic WordPress database backup to object storage — your data lives in a separate, safe place.
Cost Comparison: Object Storage vs. Traditional Backup Solutions
Many backup plugins charge $5–$15 per month for cloud backup. With object storage, you pay only for what you use. A 50 MB database backup stored daily costs less than $0.05 per month on R2. That is hundreds of times cheaper. For any site owner, automatic WordPress database backup to object storage is the budget-friendly path.
Method 1: Automatic WordPress Database Backup Using UpdraftPlus
UpdraftPlus is the most popular WordPress backup plugin. The free version already supports S3-compatible storage, which means you can use it with Cloudflare R2, Backblaze B2, or Amazon S3. No premium plan is needed. This method is the easiest way to set up automatic WordPress database backup to object storage.
Step 1 – Install UpdraftPlus and Configure Database-Only Backups
- Log in to your WordPress dashboard.
- Go to Plugins → Add New.
- Search for “UpdraftPlus” and click Install Now, then Activate.
- Navigate to Settings → UpdraftPlus Backups.
- Click the Settings tab.
- Under “Backup schedule for database,” choose your frequency (for example, every 12 hours or daily).
- Under “Retain this many scheduled backups,” type a number like 7 or 14.
- Set “Include files in backup” to None. This makes database-only backups, which saves a lot of space for your automatic WordPress database backup to object storage.
Step 2 – Connect Your Object Storage Bucket (S3, R2, or B2)
- First, create a bucket in your chosen object storage service (R2, B2, or S3). Make sure it is set to private.
- In your bucket settings, create an API key (access key and secret key). Keep these safe.
- Go back to UpdraftPlus settings in WordPress.
- Under “Choose your remote storage,” click S3 Compatible.
- Enter your endpoint URL:
- Cloudflare R2:
https://ACCOUNT_ID.r2.cloudflarestorage.com - Backblaze B2:
https://s3.us-west-004.backblazeb2.com(use your region) - Amazon S3:
https://s3.YOUR_REGION.amazonaws.com
- Cloudflare R2:
- Enter your S3 bucket name.
- Enter your access key and secret key.
- Click Save Changes at the bottom.
- Click Test Settings to make sure the connection works.
Your automatic WordPress database backup to object storage is now linked.
Step 3 – Set Backup Frequency and File Retention Policies
- In UpdraftPlus settings, set your database backup to run daily or every 12 hours. Daily is enough for most blogs.
- Set “retain this many scheduled backups” to 7 (for 7 days) or 14 (for 2 weeks).
- Keep the number low. Old backups take up space in your object storage bucket.
- Click Save Changes.
Step 4 – Enable Email Notifications and Test a Restore
- Install the free UpdraftPlus Email Notifications add-on (search in Plugins → Add New).
- Go to UpdraftPlus add-ons page and activate the email notification feature.
- Set it to send you an email after each WordPress database backup completes.
- Now, run a manual backup by clicking Backup Now.
- Wait for the backup to finish. Check your object storage bucket. You should see a new .gz file.
- To test a restore, click Restore next to the backup. Only choose “Database” — not files.
- Confirm the restore works. Your automatic WordPress database backup to object storage is now fully set up and tested.
Method 2: Lightweight Automatic Database Backup Using WP-CLI and Cron Jobs
This method is for users who want full control. It uses WP-CLI (a command-line tool for WordPress) and cron jobs (scheduled tasks on Linux servers). This approach is very light and fast. It is a great way to build an automatic WordPress database backup to object storage without any plugin.
Step 1 – Write a Shell Script to Dump the WordPress Database
- Connect to your server via SSH.
- Create a new file:
nano ~/wp-db-backup.sh - Paste the following script:
#!/bin/bash
DATE=$(date +%Y-%m-%d-%H%M)
DB_NAME="your_database_name"
DB_USER="your_db_user"
DB_PASS="your_db_password"
BACKUP_DIR="/tmp/wp-db-backups"
mkdir -p $BACKUP_DIR
mysqldump -u $DB_USER -p$DB_PASS $DB_NAME | gzip > $BACKUP_DIR/db-$DATE.sql.gz
echo "Backup created: db-$DATE.sql.gz"
- Save the file (Ctrl+O, Enter, Ctrl+X in nano).
- Make it executable:
chmod +x ~/wp-db-backup.sh - Test the script:
bash ~/wp-db-backup.sh - Check that a .sql.gz file was created in /tmp/wp-db-backups/.
Step 2 – Configure an S3-Compatible CLI Tool (AWS CLI / Rclone)
- Install rclone (works with all S3-compatible services):
curl https://rclone.org/install.sh | sudo bash - Run:
rclone config - Choose n for new remote. Give it a name like mybackup.
- Choose the correct type:
- R2 → select “Amazon S3 Compatible” → enter R2 endpoint, access key, secret key
- B2 → select “Backblaze B2” → enter your Account ID and Application Key
- S3 → select “Amazon S3” → enter your region and credentials
- Test the connection:
rclone lsd mybackup: - If you see your bucket name, it works. Now add this upload line to your backup script:
rclone copy $BACKUP_DIR/db-$DATE.sql.gz mybackup:your-bucket-name/wordpress-db/
Step 3 – Schedule the Backup Script with System Cron
- Open crontab:
crontab -e - Add a line to run the script every day at 3:00 AM:
0 3 * * * /bin/bash /root/wp-db-backup.sh >> /var/log/wp-backup.log 2>&1 - Save and exit.
- Your system will now run the script daily. This creates a fully automatic WordPress database backup to object storage at the server level.
- To check that it works, wait until 3 AM and then look in your bucket, or check the log:
cat /var/log/wp-backup.log
Step 4 – Set Up Automatic Cleanup of Old Database Backups
- Add this line at the end of your backup script, before the rclone upload:
find $BACKUP_DIR -name "db-*.sql.gz" -mtime +14 -delete
- This command deletes backup files older than 14 days from your local server.
- To also clean up your object storage bucket, add:
rclone delete mybackup:your-bucket-name/wordpress-db/ --min-age 14d
- Save the script. Now your backup folder and bucket stay clean.
- Your automatic WordPress database backup to object storage is complete with built-in cleanup.
How to Minimize Storage Costs for Automatic WordPress Database Backups
Keeping costs low is easy if you follow a few simple rules. These tips will help your automatic WordPress database backup to object storage stay cheap.
Use Incremental and Database-Only Backups
A database-only backup is already small. If your plugin supports incremental backups, turn them on. Incremental backups only save the changes since the last backup. This can cut your storage use by 50–80% more.
Enable Gzip Compression on Backup Files
Most backup tools, including UpdraftPlus and mysqldump scripts, compress files with gzip. Always make sure compression is on. A compressed database file is often 10 times smaller than the raw text file. This saves money on every automatic WordPress database backup to object storage.
Set Reasonable Retention Windows (7–14 Days)
There is no need to keep 90 days of backups. For most sites, 7 to 14 days is enough. If something goes wrong, you will find out fast. Set your retention to match. Short retention means fewer files and lower costs.
Choose a Provider with Zero Egress Fees (e.g., Cloudflare R2)
Egress fees can surprise you. If you ever need to restore a backup, S3 charges $0.09 per GB. Cloudflare R2 charges $0. For sites that test restores often, switching to R2 can save a lot. This is a key reason why R2 is popular for automatic WordPress database backup to object storage.
Troubleshooting Common Issues with Automatic WordPress Database Backups
Sometimes things do not go as planned. Here are the most common problems and how to fix them.
WordPress Cron Fails to Trigger Backups on Time
WordPress uses its own internal cron system. It only runs when someone visits your site. If your site has low traffic, backups may run late. The fix: set up a real system cron job. Add this line to your server crontab: */15 * * * * wget -q -O - https://yoursite.com/wp-cron.php?doing_wp_cron
This calls the WordPress cron every 15 minutes, no matter how many visitors you have.
“Connection Timed Out” or 403 Errors from Object Storage
A 403 error means your access keys are wrong or the bucket permissions are wrong. Check these:
- Your access key and secret key have no extra spaces.
- The endpoint URL matches your region exactly.
- Your bucket policy allows the key to write objects.
- For R2, make sure you used the R2 endpoint, not the CDN URL.
Double-check and re-save. Your automatic WordPress database backup to object storage should connect after this.
Backup Files Are Corrupted or Too Large
If a backup file is corrupt, the upload may have been cut off. Try these steps:
- Increase the PHP max execution time in your wp-config.php or .htaccess file.
- Check that your database user has full read permissions on all tables.
- For large databases, run mysqldump from the command line instead of a plugin. This avoids PHP memory limits.
Restored Database Has Broken Permalinks or Media Links
This happens when you restore a database to a new domain. The old URLs are stored inside the database. To fix this, run a search-and-replace tool. The plugin “Better Search Replace” is free and does this in minutes. After the restore, go to Settings → Permalinks and just click Save Changes. This flushes the rewrite rules. Your automatic WordPress database backup to object storage restore will then work correctly.
FAQ: Automatic WordPress Database Backup to Object Storage
How often should I back up my WordPress database?
For most blogs, a daily backup is enough. If you post often or run a store, back up every 12 hours or even every 6 hours. The key is to set it once and forget it. An automatic WordPress database backup to object storage runs without you thinking about it.
Can I use Cloudflare R2 for WordPress database backups?
Yes. Cloudflare R2 is fully S3-compatible. UpdraftPlus, rclone, and AWS CLI all work with R2. Just use the R2 S3-compatible endpoint and your R2 API keys. R2’s zero egress fees make it one of the best choices for automatic WordPress database backup to object storage.
Do I also need to back up my media files and themes?
Your media files and themes change less often. You can back those up weekly or monthly with a full-site backup. The database changes every time someone leaves a comment or you publish a post. That is why the database needs its own automatic WordPress database backup to object storage on a tighter schedule.
How do I restore my database from an S3-compatible bucket?
If you used UpdraftPlus, go to Settings → UpdraftPlus Backups, find your backup, and click Restore. Select “Database” only. If you used WP-CLI, download the .sql.gz file from your bucket and run: gunzip < backup.sql.gz | mysql -u user -p database_name
Is UpdraftPlus free version enough for database backups?
Yes. The free version of UpdraftPlus supports S3-compatible storage. You do not need the premium version for automatic WordPress database backup to object storage with R2, B2, or S3. The premium version adds features like incremental backups and multi-site support, but those are optional.
Conclusion and Next Steps
Setting up an automatic WordPress database backup to object storage is one of the best things you can do for your website. It is cheap, safe, and easy to maintain. Whether you choose UpdraftPlus for a simple plugin setup, or WP-CLI and cron for full control, you now have a clear path to protect your data.
Here is what to do next:
- Pick your object storage provider. Cloudflare R2 is the best all-around choice for most users. Backblaze B2 is the cheapest if you want to pay as little as possible.
- Choose your method. Method 1 (UpdraftPlus) is great for beginners. Method 2 (WP-CLI + Cron) is best for those who want speed and control.
- Set up your backup today. Run a test. Make sure you can restore.
- Check your backup logs once a week to make sure everything is running.
Your WordPress database is the heart of your site. With an automatic WordPress database backup to object storage in place, you can sleep well knowing your data is always safe.
