Let’s discover how to backup wordpress without a plugin. This method will actually work for all sites, not just WordPress websites. (You can also backup WordPress using a plugin, if you’d prefer.)
There are two aspects to backing up your WordPress website – your files and your database. Having both of these will constitute a complete and full backup of your website that can be restored from scratch.
Backup WordPress Without Plugin – Files
The first thing we’ll want to do is to get a copy of all of your files. We’re going to zip up your entire WordPress installation so that you can download just one file that contains all of your sites files.
To do this, we will SSH into the server. If you’re on windows, you can use PuTTY (see how to SSH on windows). If you’re on linux or Windows Subsystem for Linux, you can just use a terminal.
You can find the SSH details in your site’s hosting control panel.
Once you’re logged into your website server via SSH, navigate to your websites top level directory. This is the folder that contains the sub-folders wp-admin, wp-includes, and wp-content. For this command to work you need to be in the top level directory. If you’re not in the top level directory, replace “.” with the relative path to your website.
Run the zip command:
zip -r mysite.zip . -x mysite.zip
Press enter. This command zips up all the files in the current directory, recursively, and excludes the zip file so it’s not recursively zipping into itself.
That’s it! Now that you have the file mysite.zip in your public folder, you can download the file by logging into FTP (see how to use ftp) (I like using FileZilla) and downloading the file to your computer.
Name the file with the date in the filename so you know when the backup was made.
Backup WordPress Without Plugin – Database
Next, we’ll want to back up the database.
Log into your hosting control panel and find PHPMyAdmin. Once there, click on the name of your database. If you’re unsure of the name of your database, you can open up your sites wp-config.php and find the DB_NAME config option.
Once you’ve clicked on the name of your database, click the export tab at the top and hit go. Your database will download to your computer as a .sql file.
Rename this file with the date like you did with the files zip so that you know the date of the backup.
If you don’t have access to PHPMyAdmin, or you prefer to do the database backup via SSH, you can run the following command:
mysqldump -u yourdatabaseusername -p yourdatabasename > mysite.sql
Your database username and password can also be found in your wp-config file. You would then download this file via FTP as well (how to use ftp).
Make Sure You Download The Backups
Your backups are useful if they’re on the same server as your website. However, what if something happens to the server? What if the hard drive fails? You really need to have a copy of your website that isn’t on your site’s server. So, at least download them to your computer. And upload them to the cloud.
For super security, create a flash drive or hard drive just for backups and have a physical copy as well.
Like this article? Subscribe to scottsweb.dev on YouTube!