There may come a time when you have to move your website on your server, or you might need to move it to a completely different server. The good news is that, thanks to WordPress’ complete flexibility, you won’t need to do a new install. In most cases it is a fairly straightforward process, provided you follow the instructions.
The First Golden Rule – Don’t Move Anything Until It Has Been Backed Up
Before changing anything, make back ups for of all your theme files, uploads, the plug ins you have downloaded for your site and your database. If you need to edit your database (which you need to do when uploading a website or moving it between servers and hosts) duplicate the database and include the word “old” in its file name.
This is important, especially if you are doing this for the first time. If something goes wrong, or you are unable to transfer the site successfully, you need your back up to be quickly available. Otherwise, you might find yourself rebuilding the site on the new server instead of just moving it.
So why would you want to move your website? Well, if you are not happy with the speed, performance or security or your current hosting package, you might want to try something else. As server and storage technology is improving all the time, you will be faced with new options and different ways of dealing with your hosting needs. When something new comes along it is useful to be able to handle the transfer yourself.
Moving Your Website To A Subroot Directory
This is the easiest move to make, as you are hardly moving anything. It also works with standard WordPress installations and the majority of frameworks, as well as if you are making use of a parent-child structure. However, it is important to note that this will not work if you want to do a multi-site installation, it only works for simple, single installations. And, even better is the fact that it should only take between 3 and 10 minutes to complete. Here’s how to do it:
If you have a website in a root directory, it must be removed. Make a back up and delete al the WordPress files still in the root directory. Use Softaculous or another installation service to uninstall WordPress. Remove all the WordPress files and folders (any files or folders that start with the prefix wp-). Turn off the permalinks structure and set it to default. You can do this in the permalinks section of the settings of your theme.
If The URLs And Domain Names Are Not Changing
If your domain name and URLs are not changing, it is quite easy and in most instances you can simply move the files. For people who are moving to a new server but are keeping the same domain they can edit the wp-config.php file with the new database information and update the new info to the new server.
When The URLs And Domain Names Are Changing
When the domain names or URLs change there are some factors that need to be taken heed of. And while you can still move the files, as you would if the URLs were staying the same, the old domain names will stay on the database and this can cause complications with your links and display.
You can make use of the search and replace for databases script. This allows you to replace the old domain with a new one.
Moving Your Website To A New Server Location
Before you can move to a new location you need to create the new directory. Access the general panel of the settings on your administration panel. Change the address of your WordPress core files in the WordPress address box. Also, update the new location in the site address box area. Save the changes then move the WordPress core files to the new folder.
If you are making use of permalinks you will need to update the structure to.htaccess file, which you should move to the same directory as the index.php file. You may need to restart your server after this. Remember also that you must create the new url locations before you start moving files.
Once you are done, you can turn your permalinks structure back to its custom look. Visit your new domain and check that the site downloads. Then you should go to yourdomain.com/wp-login.php and check that the transfer has worked correctly on the back end. It is advisable to check all the pages and links throughout the site to make sure no errors have occurred.