How can you move your Wordpress site to a new domain?
Whatever the reason is, you decided to move your beloved Wordpress site from www.youroldsite.com to a new domain which is www.yournewsite.com. Of course you are not going to do that from all over again, you’ll just need to backup your Wordpress DB and files on www.youroldsite.com and restore them back in www.yournewsite.com. In the blink of an eye your site will be moved! That’s what Databases are for
However even this simple action, it may turn to a disaster, especially if you are new to databases…
Step by step guide on moving your Wordpress site to a new domain:
1. Download Wordpress files and folders: First and easisest, login with your ftp user to www.youroldsite.com and download everything you see there to your computer, in a safe place. Actually copying the wp-content folder is enough but let’s stay on the safe side.
2. Backup your Wordpress database: Now that you copied your Wordpress files, now you have to copy your Wordpress database as well. If you are not into databases this may be tricky for you, however actually it’s easy and no need to worry at all. There are two options you can choose for backing up a MySQL database:
2a) Login to your database server with your DB account. It’s the user and password that you can find on your wp-config.php file that you have just downloaded (in case you have forgotten your login info).
On the database admin panel (dashboard) you will see the following options:
Choose EXPORT. This will take you to the DB Backup screen:
As you can see there are a lot of fancy options here like saving the database to pdf, microsoft word, excel etc etc. You can also have a database backup to a flat file in txt or csv forms. However the best option here is to not to touch anything and to have the backup in SQL script format.
After you download the backup in a SQL sentence to a txt file on your local machine, you can logout on the DB server admin panel.
If you are new to databases I would suggest you the next option for getting a database backup which is easier to manage:
2b) Login to your hosting service with your hosting account. For instance if you are hosting with GoDaddy, login with your account information. After login, click on the Hosting and select “My Hosting Account”. Click “Manage Account” next to youroldsite hosting account and get on the hosting control panel for your youroldsite.com. Now choose “Manage Databases”: You will see the Wordpress database of youroldsite.com listed there:
Click on the “edit” button next to youroldsite.com WP database. This will take you to the screen where the backup options are on:
Click on the “BACKUP”. This will take some time, but with this method you dont have to login to the database server. You just had an easy backup of your DB by just logging into your hosting account. Of course, every hosting provider has a different control panel interface. But just try to find the database management screen and get a backup from there.
3. Download your Wordpress database backup: If you have chosen 2a, you already downloaded the DB to your local harddrive, so skip this step if you have chosen 2a. However if you have chosen 2b, login once again with your ftp user to youroldsite.com ftp site and find the backup of your DB. It should be a “youroldsite.sql” file. Again with GoDaddy, it’s located in a seperate folder on the root directory: “db_backups”. Copy the file to your harddrive.
4. Create a new hosting account and an empty database for yournewsite.com: Login to the hosting server of yournewsite.com and first create an hosting account (if you did not already) and an empty MySQL attached to it. Care attention to choose the same MySQL version of youroldsite.com database.
5. Upload your database backup: Once the MySQL database of yournewsite.com is ready, login with your ftp account to the ftp site of yournewsite.com. Upload the previously downloaded youroldsite.sql backup file to the “db_backup” directory on yournewsite.com.
6. Restore your database backup: Again you have two options:
6a) You can either do it by logging to DB server, on the admin panel of yournewsite.com database. (Using the IMPORT option this time),
6b) Or you can restore it by logging to your hosting account of yournewsite.com, but this time choosing the RESTORE option, very similar to backing up, like you did in 2b.
7. Upload your old Wordpress files and folders: Upload the files and folders you have previously downloaded (on step 1) from youroldsite.com ftp site to yournewsite.com ftp site.
8. Check it out: Type www.yournewsite.com to your browser and see what’s going to happen. Most probably you will be taken to www.youroldsite.com web site. If you have deleted the youroldsite.com hosting account already (not a good idea though), you can even have a 404 error page. Don’t panic. We still have a step to go:
9. Login to yournewsite database server and run the following SQLs: Login to the DB server of yournewsite.com. You will see that it’s not empty anymore! The data on youroldsite.com are there and they are actually in the wp_posts, wp_taxonomy, wp_options etc etc tables that can be seen on the left sidebar. Just click on any table there you would like (wp_posts for instance) and select the “SQL” on the top menu to reach SQL command screen.
Copy and paste the following SQL sentences to the panel, change “youroldsite.com” and “yournewsite.com” phrases and run the sentences:
UPDATE wp_options SET option_value = replace(option_value, ‘http://www.youroldsite.com’, ‘http://www.yournewsite.com’) WHERE option_name = ‘home’ OR option_name = ’siteurl’;
UPDATE wp_posts SET guid = replace(guid, ‘http://www.youroldsite.com’,'http://www.yournewsite.com’);
UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.youroldsite.com’, ‘http://www.yournewsite.com’);
10. Check it out: Type www.yournewsite.com to your browser. Now it should be OK!
11. Redirect youroldsite.com to yournewsite.com: You have already copied your Wordpress site, and it’s up and running. However now you have duplicate content. You can cancel your youroldsite.com hosting of course, but since the pages on youroldsite.com are already indexed by search engines and since they have backlinks all over the web, if you just cancel this account and do not do anything else there you will loose visitors. Instead, click on your hosting account and on the domain management page redirect your youroldsite.com domain to yournewsite.com domain. Choose 301 Permanent Redirection since most search engines do not take into consideration 302 Temporary Redirection. Since you have restored the same structure of youroldsite.com to yournewsite.com, the link structure and post titles are the same, and for instance a request on:
will be redirected to:







