Contents
Most WordPress disasters (an update that breaks the site, a plugin that wipes data, a hack) can be fixed in minutes if a good backup exists. What matters is knowing what to back up, where to keep it, and having tried a restore at least once before you actually need one.
What a backup includes
| Part | Where it lives | What it holds |
|---|---|---|
| Files | public_html or the site’s folder |
Themes, plugins and images in wp-content; settings in wp-config.php and .htaccess |
| Database | MySQL or MariaDB | Posts, pages, orders, users and settings |
WordPress core files can be downloaded again at any time, so the files that really matter are wp-content and wp-config.php.
Before you start
- Access to cPanel (File Manager, phpMyAdmin and JetBackup).
- The database name and user from
wp-config.php(DB_NAMEandDB_USER). - Enough space on your computer or in cloud storage to keep the backup.
Method 1: your host’s automatic backups (JetBackup)
1. Restore specific files or a folder
- Open cPanel, then JetBackup.
- Choose file backups (Home Directory or File Backups, depending on the version).
- Pick the date, then select only the files or folder you need, such as
public_html/wp-content/plugins/plugin-name. - Click Restore and follow progress under Queue.
2. Restore the database
In JetBackup choose Databases, select the site’s database and the same date you restored files from, and click Restore. Choose Download instead if you want a copy on your computer.
Careful: a restore replaces what’s there now. If your store received orders after the backup date, those orders disappear from the database, so export them first. See JetBackup for the backup types.
Method 2: a backup plugin
Plugins such as UpdraftPlus, Duplicator and All-in-One WP Migration package files and database together and can run on a schedule:
- Install the plugin from Plugins > Add New Plugin.
- Connect it to external storage (Google Drive, Dropbox or similar) instead of keeping backups inside the site.
- Set the schedule and how many copies to keep, then run the first backup manually and check it completed.
Backups stored inside wp-content use your account’s disk space and file count, and they’re useless if the server fails or the account is removed, so prune old ones regularly.
Method 3: manual backup
3. Copy the files with File Manager
- Open File Manager and go to
public_html. - Select everything (or at least
wp-contentandwp-config.php), click Compress and choose Zip Archive. - Download the archive to your computer, then delete it from the server.
4. Export the database with phpMyAdmin
- Open phpMyAdmin from cPanel and select the database in the left sidebar.
- Open the Export tab, choose Quick and the SQL format, then click Export.
- For a large database choose Custom and gzipped compression to shrink the file.
5. Or use SSH (on plans that include it)
cd ~
tar -czf wp-files-$(date +%F).tar.gz public_html
mysqldump --no-tablespaces -u DBUSER -p DBNAME > wp-db-$(date +%F).sql
Download both files over SFTP, then delete them from the server.
Manual restore
6. Restore the files
First back up the current state, even if it’s broken. Then in File Manager upload the archive to public_html with Upload, right-click it, choose Extract and confirm overwriting.
7. Restore the database
- In phpMyAdmin, select the database, tick Check all and choose Drop from With selected to empty it.
- Open Import, choose the
.sqlor.sql.gzfile and click Import. - Over SSH you can run this instead:
mysql -u DBUSER -p DBNAME < wp-db-backup.sql
8. Check the site
Confirm the database details in wp-config.php are right, purge the cache under LiteSpeed Cache > Purge All, and save permalinks once under Settings > Permalinks. Then open the home page, a post, and the login page.
The 3-2-1 rule
Keep three copies of your data, on two different types of storage, with at least one off the server. Every so often, test a restore on a subdomain or a staging site; a backup you’ve never restored may turn out to be incomplete.
Troubleshooting
- phpMyAdmin rejects the file as too large: gzip or split it, or import over SSH. See phpMyAdmin import too large.
- “Error establishing a database connection” after restoring: the details in
wp-config.phpdon’t match the database, or the user lacks privileges on it. See error establishing a database connection. - The site still shows old content: purge LiteSpeed Cache and your browser cache.
- Images are missing: the backup didn’t include
wp-content/uploads. Restore that folder from the same backup. - Compressing or uploading fails for lack of space: delete old backups and log files, and see disk quota exceeded.
On ArabyHost
ArabyHost takes daily JetBackup backups of every account, and you can restore a file or a database yourself from cPanel, which opens in one click from the Araby Panel. That applies to WordPress hosting and the other plans. SSH, and with it tar and mysqldump, is available on AI/Developer plans only; other plans use File Manager and phpMyAdmin. Moving a site to ArabyHost from another host? See move a WordPress site.
FAQ
Are my host's backups enough?
They're your first line of defence and cover most cases, but also keep an off-server copy before major updates. A copy on your computer or in cloud storage protects you if you need an older date or want to move the site.
How often should I back up WordPress?
It depends on how fast the site changes: a store taking daily orders needs at least a daily backup, while a blog updated weekly can live with a weekly one. Always take a manual backup before updating the theme or a major plugin.
Do I restore just the files, or the database too?
If the site broke after a plugin update, restoring that plugin's folder may be enough. After a hack or lost content, restore files and database from the same date, because mixing dates can cause errors.