This post discuss on the complete procedure of transferring full website from one domain to another, tested with WordPress site.
How to Transfer Website from One Domain to Another without loosing Traffic
For any reason if you have to change your domain from olddomain.com to newdomain.com without loosing any traffic or Google Ranking then you are at right place. I will be discussing the complete procedure from the beginning so it might help you guys to transfer your website easily. Well there are other ways too but i find this way far easy for me for transferring websites while changing domain name.
Step 1 (Old Domain Cpanel)
Login to your FTP via Cpanel: public_html folder > Select all files and Compress to a New archive (say Old.zip) and Download

Step 2 (Old Domain Cpanel)
Login to phpMyAdmin via Cpanel
Now select your Database [from left side] and Check all> Export> Go and Download

Step 3 (New Domain Cpanel)
Please make sure you already configured Name Servers and your domain Server is accessible. So Now
- Login to Cpanel>FTP>public_html of your New domain.
- Upload the ZIP (Old.zip) folder and extract.
Step 4 (New Domain Cpanel)
- Create a New MySQL database
- MySQL database User (Save it on Notepad we gonna need it: Username and Password)
- Add User To Database (Give all Privileges in next page)
Step 5 (New Domain FTP)
Go to public_html and edit config.php with the MySQL username, user and password.
Step 6 (New Domain phpMyAdmin)
- Select the MySQL database you just created on the Left sidebar
- Click on Import (Right Top)
- Browse File and Upload [Note: If the Upload limit provided by your server is less then your SQL file then you have to contact your Webhosting support to increase the limit]
- Click Go
Step 7 (New Domain FTP)
- Download Search and Replace for WordPress Databases script
- Upload it to your public_html and Extract it
- Now open newdomain.com/searchreplacedb2.php : Click Submit : Submit DB Details : Continue
Now enter your Olddomain.com and Newdomain.com url respectively on the next page. After completion don’t forget to remove the searchreplacedb2.php script.
That’s it ! Now your WordPress website is successfully transferred from your old domain to new domain.
So what about the Traffic and Google indexed pages ? You might be asking about this, isn’t it ? No worries do as stated :-
- Verify your both domains with Google Webmaster Tools
- Open .htaccess file available on public_html of olddomain.com server
- Post this below code and Save
<IfModule mod_rewrite.c> # For security reasons, Option followsymlinks cannot be overridden. # Options +FollowSymLinks Options +SymLinksIfOwnerMatch RewriteEngine on RewriteCond %{HTTP_HOST} ^olddomain.com [OR] RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC] RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301] </IfModule>
- In Google Webmaster Tools Click on your Old domain and at the top right click on Change of Address
and do as instructed. This will notify Google about the change of your Website address and will take few days or weeks to show up new domain in Google search results.