Quick answer: A complete WordPress backup is the database plus wp-content. Dump the database with wp-cli or mysqldump, then push both to remote storage — a Cloud2Y Storage VPS over rsync is a simple, reliable target. Automate it nightly with cron.
Overview
Plugins can back up WordPress, but a few lines of shell do it with less overhead and no lock-in — and the copy lands off the web server, which is the whole point. Keep the site backup where a hacked site cannot delete it.
Before you start
- SSH access to the WordPress server and a remote target (Storage VPS) with key auth.
- wp-cli installed (optional but convenient):
wp --infoto verify. - Knowing your paths: WordPress root (e.g.
/var/www/example.com) and its database name.
Step-by-step guide
- Dump the database:
(orcd /var/www/example.com wp db export /var/backups/example-$(date +%F).sql --allow-root gzip /var/backups/example-$(date +%F).sqlmysqldump example_db | gzip > /var/backups/example-$(date +%F).sql.gz) - Sync files — themes, plugins, uploads:
rsync -az --exclude 'cache/' /var/www/example.com/wp-content/ \ [email protected]:/srv/backups/example/wp-content/ - Sync the database dumps:
rsync -az /var/backups/ [email protected]:/srv/backups/example/db/ - Wrap steps 1–3 in a script and schedule with cron, e.g. nightly at 02:45.
- Once a month, do a test restore on a scratch site — a backup you have never restored is a hope, not a plan (see testing integrity).
Common issues
- Files without the database (or vice versa): WordPress needs both halves from the same night to restore cleanly.
- Backups stored on the same server: a full disk, a hack or a botched update takes the site and its backups — keep copies remote.
- Huge uploads folder: exclude regenerable thumbnails or archive old years separately if transfers get slow.
When to contact support
WordPress-level work is in your hands on an unmanaged VPS; for platform problems during transfers or Storage VPS issues, open a ticket. Cloud2Y also offers a guide to WordPress backup plugins if you prefer that route.
Frequently asked questions
What exactly must be in a WordPress backup?
Two halves from the same moment: the database (posts, orders, settings) and the wp-content directory (themes, plugins, uploads). Restores only work cleanly with a matching pair.
Are backup plugins or shell scripts better?
Both work. Plugins are convenient inside wp-admin; a wp-cli plus rsync script is lighter, easier to automate with cron and keeps copies off the web server where a hack cannot reach them.
How often should a WooCommerce store be backed up?
Orders arrive continuously, so dump the database at least hourly and sync files nightly. Losing a day of orders usually costs far more than the extra storage ever will.
Related articles
- How to configure WordPress backups
- How to configure backups to a Storage VPS
- How to restore a website from backup
- How to test backup integrity
Need reliable space for your backups? Order a Storage VPS at Cloud2Y →
