Migrate WordPress – short & easy how-to move your site to new host & domain

By December 18, 2017Wordpress
How to WordPress website to new host and domain | Urban Based

The first time I tried to migrate WordPress to new site I was so afraid I will do something wrong, I spent weeks researching and making sure I know what I’m doing. Though I was determined to do everything by myself so I overcame my anxiety and gave it a go. You know what? It all went really well and now I know – there was nothing to be afraid of.
When my friend yesterday asked me to help her with her WordPress migration I came up with an idea of actually writing a guide about it. To make her and you feel confident about the whole transfer and make it hassle-free.
So here’s my short & easy guide on how to migrate your WordPress site to another host & change the domain to a new one. If you only need to change your hosting provider, just skip the part describing the walkthrough of changing the domain addresses.

How to migrate WordPress website to a new host & domain

1. Log in to you old website’s admin dashboard (cPanel or any other one). Find there phpMyAdmin, select your website’s database, press export & save it.
2. Go back to your admin dashboard and find File manager. Go to Public_html folder, select all files and compress them to .zip. Once it’s done, press on the zipped file and download it.
3. Go to your new hosting provider’s admin dashboard. Setup the domain. Go to your domain provider’s dashboard (if you use a different provider) and update the Name Servers (ask your hosting provider to provide you with these).
4. In your new hosting provider’s admin dashboard find MySQL management & create a new database there for your “new” website. Write down your database’s name, user name and password – you’ll need them in next step.
5. Once you’ve downloaded your files, extract them and open the wp-config.php file with notepad. Find where it says define(‘DB_NAME’, ‘yourolddbname’); define(‘DB_USER’, ‘yourolddbusername’); define(‘DB_PASSWORD’, ‘yourolddbpassword’); change all old information with the new one. Save it. Zip all files again (just files, do not move them into folder).
6. Upload newly zipped file to into public_html folder on your new hosting. Extract the file and delete the zipped file from public_html folder.
7. Go to your new admin dashboard and find phpMyAdmin. Select your newly created database, press import and import the database you’ve downloaded before.
8. Afterwards you’ve done that you’ll see your database files on your left sidebar. Go through wp_options, wp_postmeta, wp_users and change the old urls you find to new ones.
9. Enter your new domain to your browser with /wp-admin/ at the end. Login to WordPress and go to Settings -> General and then permalinks & media. Check if the urls have changed there. Anywhere you find the old address update it to new one.
10. Install Velvet Blues Update URLs plugin, activate & run it. Follow the steps to change the old domain addresses to new ones.
11. Now you have to redirect your old domain to new one so you don’t lose your “SEO juice”. Go to your old website, login to admin dashboard, open FileManager (tick Show Hidden Files before), go to public_html, press edit on .htaccess file, add this code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^youroldwebsite.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.youroldwebsite.com [NC]
RewriteRule ^(.*)$ http://yournewwebsite.com/$1 [L,R=301,NC]
Change youroldwebsite to your new domain address. Save it.
If there’s no .htaccess file in your public_html folder, create one by pressing “Create new”, call it .htaccess, add the code, save it.
12. Last touch – tell Google you moved. Login to your Google Search Console dashboard, select your old property, press settings icon (top right) then Change of address and follow the steps.
13. Enjoy your new host & domain name.

I hope this was helpful & easy to understand. Though if you lost me somewhere and you’re having some issues or have some questions– just leave your comment below and I will try my best to help you out.

Leave a Reply