Instructions for backup and restore of WordPress site on Windows server.
- Install the plugin BackUpWordPress onto your site.
- Run a full backup including both files and database.
- Create a new site in IIS with a new physical path. Do not start the website.
- Create a new database and user in mySQL for the restored site:
- log in to mySQL shell.
CREATE DATABASE newsite;
CREATE USER 'newsite@localhost' IDENTIFIED BY 'password';
- Alternatively use an existing user account and give it permissions on the new database:
GRANT ALL PRIVILEGES ON newsite.* TO 'existing_user'@'localhost';
- Extract the files from the zip backup file to the physical path of the new site in IIS.
- Change the settings in the wp-config.php file for DB_NAME, DB_USER, DB_PASSWORD to the new settings created in mySQL.
- Open the .sql database file in a text editor and replace all instances of the original URL with the new one, for example replace http://www.mywebsite.com with dev.mywebsite.com.
- Import the .sql file into the new database using the mySQL shell.
Thanks for this post for tips on importing on Windows:
- Start the website in IIS and browse to the restored site.