These are the procedures for a manual backup of the files and databases that make up a WordPress site. Backup, restore, and migration is done through the cPanel's File Manager. Login there and proceed with the steps below.
You may want to login to the WordPress admin page to check on whether there are any updates or not. If so decide whether to update before or after backup. The safest choice is to do so after the backup in case there is a compatibility issue.
- Create a folder on your local machine with the name format of: YYYYMMDD-HHMMSS_domain.
- If the wp-config.php is outside the public_html folder as is often the case as a security measure then move it back in Or download it and include it at the top level of the archive folder.
- Make a .zip of the public_html folder and download.
- Export the MySQL database using PHPMySQL. If asked for a username and password use the one's assigned to the database, not the cPanel or WordPress admin.
- Put the .zip and the MySQL export into the above folder.
- Add in the searchreplacedb.zip.
- Compress this folder for archival.
Restore and Migration Procedure
- Decompress the public_html.zip and move into place.
- Deactivate the .htaccess file by renaming it temporarily. This will disable any hard coded security related directives.
- Create the new database and import the data.
- If the URL/domain name does not change in the move then simply copy everthing into place.
- If the URL/domain name does change then must run the searchreplacedb.php script to update the database. Get the script here: http://www.interconnectit.com/products/search-and-replace-for-wordpress-databases/
- Run the script and it will ask for the DB name, User ID, and Password. You can enter new data or existing data. This will be written into the wp-config.php file.
- If there is a domain name change as when working on a local server vs. hosted server you will need to do a search and replace against the database. "http://www.olddomain.com" replaced with "http://www.newdomain.com".
- Check the wp-config.php file to make sure the new database settings for user and password are correct.
- Move the wp-config.php file back outside the public_htme folder if that is where it needs to go.