Description
- A database backup using mysqldump or PHPMyAdmin
- A zip or tar of the DocumentRoot
Use *one* of the following methods to create a full backup. It does not matter which, the end result is identical.
- Plugin Method: Get a plugin like Simple Backup
- Manual Method: Manually dump the database and tar or zip the DocumentRoot
Doing The Work
Plugin Method
- Download Simple Backup
- In your WordPress Admin Panel go to: Plugins –> Add New –> Upload plugin –> Choose file –> choose ‘simple-backup.zip’
- Install and activate the plugin
- In your WordPress Admin Panel go to: Tools –> Backup Manager
- See screenshots for plugin settings, only the first settings tab is required to successfully create a backup.
- Click the blue “Create WordPress Backup” button at the top of the screen
- Download the 2 backup files produced, one is the database dump, the other is the DocumentRoot zipped or tarred up.
backup-2015-10-23-201051.tar.gz - 37.40 MB - 2015-10-23 8:08:53 PM AZOST
db_backup_2015-10-23_201050.sql - 534.67 kB - 2015-10-23 8:08:20 PM AZOST
Manual Method
Notice: This method may require administrative “root” or sudo privileges and/or a database administrator account (DBA) to successfully complete.
(Part 1 – Database dump)
This method only works with SSH or command line access to the Linux system hosting your site and a valid DBA account on your MySQL or MariaDB.
- Login to your SOURCE (existing) hosting via SSH
- Create a directory called “site_move”
mkdir site_move
- Move into this newly created directly
cd site_move
- Create a database dump
mysqldump -u username -ppassword database_name > database_name.sql
There is no space between the p’s above in -ppassword, this is intended and is not a typo
(Part 2 – Backup DocumentRoot)
On most Unix-like operating systems the DocumentRoots for most sites will be under /var/www, your particular situation may vary but this is a good starting point
- Find your sites DocumentRoot, for our example we’re using /var/www/example.org/ as the DocumentRoot of our WordPress site
- After login
cd site_move; sudo tar -cvzf /var/www/example.org example.org.tar.gz
- After this command successfully completes, you should have 2 files in your “site_move” folder:
a. database_name.sql
b. example.org.tar.gz