How to Move Your WordPress Site to a New Server
Looking to transfer your entire site to a new server or backup your current site? This tutorial will show you how to migrate or backup your site easily with Duplicator plugin.
Migrating to a New Server
First login to your WordPress admin and install the Duplicator plugin, a free plugin that can transfer and backup your site. The plugin creates a “package” that can be used to re-create your current website in a new environment. Now go to Duplicator from the admin menu and hit the “Create New” button:
In the next screen you can select files and or database tables to be excluded from the final package. Although this feature can come handy sometimes, you can safely ignore it and hit the “Next” button at the bottom of screen. In the next window, the plugin checks for requirements and errors:
The most common errors you might see are:
- Max Execution Time: adjusting “max_execution_time” setting in php.ini file will fix that; you can contact the web hosting provider, they’ll adjust this for you.
- File size warning: the error occurs if the package size becomes larger than 150MB in size, for example in website that use lots of images this could occur, however you’ll likely be fine during the migration. If the migration does not work out (following the tutorial to the end) you can ask the web hosting provider to disable the server limitations momentarily.
Now hit the “Build” button. Depending on the size of your website this will take several minutes (not hours, if it takes hours something has gone wrong, you can re-try creating the package).
After the package is complete, download both the archive file and the installer by clicking on the blue buttons. We’ll need both files to migrate the website to a new server later.
Now that you have the archive file and installer.php file, copy both files to the root directory of your new server (you can use FTP to upload both files), and make sure both files are in the same directory:
Navigate to the URL of the new domain and launch the installer.php file, in this tutorial, we are moving the site to a localhost in the “new_website” directory, so the address is: “http://localhost/new_website/installer.php”:
Enter the database details (if you are not sure about the database info, contact your web hosting provider), check the “I have read all warnings and notices” checkbox and hit “Run Deployment”, and we’re off to the next screen:
Now here’s the most important bit: click the Advanced Options and then enable the “Enable Full Search” checkbox. This is required so that the URLs in Builder (links you might add, images that are uploaded to the site, etc.) are all updated to the new website. Now hit the Run Update button. That’s it.
Using Duplicator as a Backup Tool
Although Duplicator is a migrator tool, but you can use it to backup your site as well.
To backup your site with Duplicator:
- First create a package with Duplicator (follow “Step 1” in this tutorial)
- Download the installer.php and the archive zip to your computer for backup
- If you ever need to restore your site, follow “Step 2” in this tutorial to upload the installer.php and archive zip to your server. Since you are restoring the site on the same URL, you can skip the step to update the site URL.