If you are a WordPress web designer in Vancouver, or anywhere else in the world, you may find this article informative. We wrote this tutorial article because we were tired of all of the convoluted, unnecessarily complicated instructions people give you out there on the ‘interweb’ regarding making an exact copy of a WordPress website and database to another web hosting server and domain name (www.old-website.com to www.new-website.com). In this tutorial it is assumed that you have access to your cPanel(s), FTP access and your WordPress username and login information. We hope this tutorial helps you clone your WordPress websites in the future, and after doing it a few times it will become more and more routine… but you still have to be careful about not missing any steps and staying organized during the process.
Download the entire WordPress website you want to copy with the FTP software of your choice. You can compress the files into one directory on your server to download as one zip file to make the downloading process easier.
Login to the cPanel where the new website and domain is hosted and create a new MySQL database.
Create a new user and password for the MySQL database you just created.
Add this new user to be associated with the new database and have admin access to the new database with all permissions allowed (check all).
Login to the cPanel of the old website and launch phpMyAdmin, select the old database and export it to your hard drive for editing.
Open the old database with a text editor and ‘find & replace’ all instances of the old domain name with the new domain name (example: “old-domain.com” – REPLACED WITH – “new-domain.com”).
Login to the cPanel for the new website, launch phpMyAdmin and select the new database you created in step #3. Import the old database that you edited in step #6 into that new, empty database.
Go back to the downloaded files from step #1 and change the ‘wp-config.php’ file in these 3 areas with your new database information:
Also change the ‘wp-login.php’ file by finding this line in the code:
require( dirname(__FILE__) . ‘/wp-load.php’ );
Add this code underneath the line above (change to your domain name of course):
update_option(‘siteurl’, ‘http://new-domain.com’ );
update_option(‘home’, ‘http://new-domain.com’ );
Upload ALL of the website files to your new server or domain name directory with the changes made in step #8 to the files ‘wp-config.php’ and ‘wp-login.php.’
Test the URL for the new domain. You will have to change the title of the WordPress site in the general settings, and update your permalinks to avoid any conflicts.