Manually Backing Up Your WordPress Website
This guide walks you through creating a complete manual backup of your WordPress files and database manually. While it involves the command line, the steps are broken down to be clear and manageable. By the end of this guide, you�ll be more confident in understanding what�s going on behind the scenes of backup solutions like Solid Backups.
Why this documentation? Doesn’t Solid Backups do this for me?
Great question. Short answer: yes. With Solid Backups installed, you will never need to know how backing up your site works, other than “it just is there when I need it!” But the SolidWP team is committed to having educated users so that you can know how these relatively complicated processes work. This guide is for users who want a peek under the hood.
What You’ll Need
Before you begin, make sure you have the following credentials from your hosting provider:
- SSH/SFTP Hostname: Your server’s address (e.g., yourdomain.com).
- SSH/SFTP Username and Password.
- SSH Port: Usually 22, but some hosts use a different one.
- An SFTP Client: FileZilla or Cyberduck are great free options.
- A Terminal Application:
- macOS/Linux: Use the built-in “Terminal” app.
- Windows: Use the built-in “PowerShell” or “Command Prompt”.
Part 1: Backing Up Your WordPress Files
First, you’ll connect to your server to compress all your WordPress files into a single ZIP archive, which is much faster than downloading thousands of individual files.
Step 1: Connect to Your Server via SSH
Open your terminal and use the ssh command.
The command format is: ssh username@hostname -p PORT
- Replace username and hostname with your credentials.
- If your host uses the default port 22, you can leave out the -p PORT part.
Example:
ssh cooluser@example.com -p 2222
Enter your password when prompted. (Note: Keystrokes for the password won’t appear on screen; this is a security feature). You’re now logged into your server!
Step 2: Navigate to Your WordPress Directory
Your WordPress files are usually in a folder named public_html or www. Use the cd (change directory) command to get there.
cd public_html
Sometimes it�s best to get your bearings by seeing what folder you are in and what�s in the folder. Use the ls command to list the contents of the current folder, or cd .. to move up a folder
Step 3: Create a ZIP Archive
Once you are in the correct folder/directory, use the zip command to compress everything in the current directory.
zip -r wordpress-files-backup.zip .
Here�s a breakdown of the command:
zip: The command to create a zip file.-r: This “recursive” flag includes all files and sub-folders.wordpress-files-backup.zip: The name for your backup file. Using a date is good practice (e.g., backup-2025-09-08.zip)..: A single dot that means “everything in the current directory.”
Step 4: Download the ZIP File via SFTP
- Open your SFTP client (like FileZilla).
- Connect using your SFTP Hostname, Username, Password, and Port.
- In the “Remote site” panel, navigate to the public_html directory.
- You should see the wordpress-files-backup.zip file.
- Drag this file from the remote panel to a folder on your computer.
Your file backup is now safely on your local machine!
Part 2: Backing Up Your WordPress Database
Your database contains all your posts, pages, and settings. Below are two command-line methods to back it up.
Method 1: Using WP-CLI (Recommended)
WP-CLI is the official command-line tool for WordPress. Many modern hosting environments have it pre-installed. It’s the easiest and safest way to export your database.
First, check if WP-CLI is installed by typing:
wp --info
If you get back version information, you’re good to go!
To export the database, run this command:
wp db export
If you are not in the correct directory (within the root WordPress directory) the wp command will tell you that with something like �this does not appear to be a WordPress installation� or similar. The fix is to make sure you are in the correct directory.
That’s it! WP-CLI automatically finds your database credentials and creates a .sql backup file in your current directory, usually named after your database (e.g., databasename.sql).
Method 2: Using mysqldump (If WP-CLI isn’t installed)
If the wp command returned an error and you don�t want to convince your web host to install the WP-CLI package on your host, you can use mysqldump, a standard database utility.
1. Find Your Database Credentials
You need your database name, user, and password from your wp-config.php file. Display the file’s contents with the cat command:
cat wp-config.phpLook for these lines. You’ll need to copy down the DB_NAME, DB_USER, and DB_PASSWORD.
2. Export the Database
Now, use the mysqldump command. This version will securely prompt for your password.
mysqldump -u DB_USER -p DB_NAME > db-backup.sql
Replace DB_USER and DB_NAME with the actual credentials from your wp-config.php file. Press Enter, then paste or type your DB_PASSWORD and press Enter again. This creates a file named db-backup.sql. ??
Step 3: Download the Database File
Go back to your SFTP client. You may need to refresh to see the new .sql file. Drag the database backup file (databasename.sql or db-backup.sql) from the server to your computer.
Part 3: Clean Up Your Server
You now have a complete backup. It’s very important to delete the backup archives from your server, as leaving them in a public directory is a security risk.
In your SSH terminal, use the rm (remove) command to delete the files you created.
rm wordpress-files-backup.zip
rm your-database-backup-filename.sql
Warning: Be very careful with the rm command. Double-check the filename you type, as this action cannot be undone.
Finally, type exit in your terminal to close the SSH connection. Your complete manual backup is now stored safely on your computer.
Why This Matters
Why spend time teaching you about manual backups? The SolidWP team is committed to educating our customers. Solid Backups uses similar functionality (though, notably, SolidWP technology uses object storage and rsync to dramatically speed up the process as well as create a method where you�re not storing unnecessary ZIPs).
The SolidWP team wants educated users, because the responsibility of owning a WordPress website ultimately falls to the site owner, which is the true power of Open Source technology. The more you know about the process going on, the more value you�ll see in the entire Solid Suite of products.
So you�re in control: you can manually back up your precious data, or you can purchase a Solid Suite today and rest easy knowing that your site is protected, backed up, and performant.