So you want to move your WordPress site to a new web hosting provider?
Great! Change is always a good thing.

Before you take any action, take some time to do some proper planning.

Planning helps things go smoother and you will see problems before they show up which is always a good thing.

The first questions to ask yourself is what are you moving/migrating exactly?

  • Is it the WordPress (files + database) website only?
  • What about your emails accounts? Are they (currently/going to be) handled by your current web hosting provider or an external one such as gmail, rackspace?
  • What about domain registration? Is the current provider your domain registrar as well?
  • What about DNS? Are you relying on the current webhosting provider for DNS as well?
  • What about SSL certificates (if any)?
  • What other services are you using with the current provider – SVN, git, FTP storage?

 

The next thing is to be clear why you are migrating the site.

  • You're not happy with the current hosting provider
  • The current web hosting bill keeps increasing
  • Your site needs more resources
  • You want to move your site out of /blog to the root location / or vice versa
  • Your site needs to be moved to a better dedicated server (with VPS you can increase the resources from the control panel)
  • You're changing your business name and domain and need to change from CoolCompany.com to AwesomeCompany.com
  • Setting up your site on a staging environment
  • You want to hire a developer / designer to work on your site but you want to clean up some customer data before that.

It’s import to think about everything now because nothing will get set up on the new server automagically.

Your business will be impacted so the planning is not a waste of time.

Can you do it yourself?

Well, that depends. There are lots to plan for but there’s also free and paid tools available.

If you have time you can read and watch videos and learn how to do it.

Depending how computer savvy you are it will take you between 1 - 20 hours to finish the migration process. I highly recommend that you keep the old hosting account active for some time just in case if things don’t work out with the new one.

I have used Duplicator plugin in the past and it does a great job for 90% of the sites. I’ve had issues with files that contained non-english characters and large sites due to hosting limitations.

Each hosting provider makes sure that their clients get enough resources. So the hosting company monitors the resource usage and may/will block the a long running programs such as your backups. If that happens and you will see one of the following error messages.

  • 500 Internal Server Error
  • 403 Forbidden
  • 404 Page not Found
  • 503 Service Unavailable
  • 504 Gateway Timeout

Medium and large WordPress sites have more files, larger databases and require much more resources in order to get packaged. For smaller sites (20-200MB) it’s less likely that you will see those error messages but you may be lucky ;).

 

Packaging the site

It’s better to try with a good tool such as Duplicator or any other backup plugin first.

You need to download the files & upload them to the new server.

If you’re using duplicator: after you upload the files to the new hosting provider you MUST set up a new database (by logging into your control panel) otherwise if you’re specify an existing database any existing information (database tables) will be removed!

Because your site still points to the old hosting company you have 2 choices.

1) Switch the DNS records (A record) to point to the new server’s IP address and wait

OR

2) You can update your hosts file and use the new server’s IP address for your site. You will be the only one you will see that change and that’s a good thing because you will have the opportunity to see the site and make sure it has been transferred correctly before everybody does.

 

How to edit hosts file?

The file’s location is different depending on your operating system.

Windows: C:\Windows\System32\drivers\etc\hosts

Linux: /etc/hosts

 

You need to add one line. IP and domain. 11.22.33.44 is the new server’s IP.

11.22.33.44 example.com

Note: You will need administrative access to edit that file. Your antivirus program may complain and report changes to the hosts file. By modifying that file, hackers can easily point google, facebook or any other site to another server that could capture your credentials.

 

If you’re on Windows and you have Notepad++ installed you can start it by doing this

Windows Key + R and then paste this.

"C:\Program Files (x86)\Notepad++\notepad++.exe" C:\Windows\System32\drivers\etc\hosts

 

If it shows an error try this

"C:\Program Files\Notepad++\notepad++.exe" C:\Windows\System32\drivers\etc\hosts

 

If you’re still seeing an error start Notepad++ and do File > Open

C:\Windows\System32\drivers\etc\hosts.

 

Another note: after you’re done testing and if all is good then you can switch the DNS records at your registrar. Make sure you either remove the line that you’ve added to the hosts file or put a pound sign in front of it to turn it into a comment so it’s ignored.

#11.22.33.44 example.com

 

We didn’t cover the DNS and email migration because they deserve to be covered separately.

 

P.S. If you need hep with your WordPress Migration we can help.

Related

https://wpengine.com/support/emulate-dns-change-with-the-hosts-file-trick/

https://themeisle.com/blog/moving-your-wordpress-blog-to-new-host/