Most WordPress developers prefer to develop their websites in the localhost first and then upload the site to the live web server. And there are solid reasons behind that process. First of all, developing a website involves frequent update and unlimited refreshing of the site. If you do this on a live server, it will take more time and cost you money and bandwidth.
But if you develop the site in localhost, you won’t have to spend anything. And as the site refresh will be almost instant, your development process will be much faster. For these reasons, it is a common trend to build WordPress websites in the localhost first.
The only problem with developing the website locally is you have to upload the whole website to the live server. You have to upload the database, all the files and go through various settings to duplicate the website in the live server. Doing all of these on your own is a challenging task.
Luckily, there are some good WordPress plugins that let you move your WordPress website from localhost to live server in a simple and efficient way. In today’s post, I will show you how to move your WordPress website from localhost to live server by using a plugin. So, let’s get started.
Step 1: Selecting the Plugin
First of all, you have to decide which plugin you will use for the job. As I said, there are several plugins that can perform this job. For this tutorial, I will use Duplicator Plugin.
With more than four hundred thousand active installs, this is one of the most popular duplicator plugins for WordPress.
First of all, download and install Duplicator in your localhost. After activating the plugin, it will create a new menu titled ‘Duplicator’ in your website dashboard.
Step 2: Creating a New Package
Clicking on the new menu item will take you to the packages section. Since you haven’t created any package yet, you will get the ‘No Packages Found‘ notice. A package is a zipped archive of your website content along with an installer file. By using the package file, you will be able to replicate your copied site into a live server quickly.
Click ‘Create New‘ to create a new package. At this point, you will be taken to a page like the following –
From this page, you can name your package anything you like. My suggestion is to include the site name and the date in the package name. You can also add some notes to your package. There are two more settings sections – Archive and Installer. If you want to exclude any directory, specific types of files or specific database tables, you can specify them from the ‘Archive‘ section.
After making the necessary changes, click ‘Next‘. The plugin will start scanning your website, and when finished, it will provide you with a report like the following –
Make sure that every component is marked as good. Then, click ‘Build‘ to start the package creation process. Depending on your site, you may have to wait a few minutes before the process finishes. Once it is completed, you will get a package completed notice like this –
In the package completed page, you will be provided with two separate files – Installer and Archive.
Download them to your desktop; you will need both of them to restore your website to the live server. Clicking on the file name will start the download process automatically.
Step 3: Uploading the Archive and Installer Files
You have successfully created a copy of the website you developed in your localhost. Now, you need to upload the installer and the archive files to the live server.
You can do this by using the cPanel of your hosting provider or by using dedicated FTP software like FileZilla. I will use the FTP method here.
After opening FileZilla, log in to your website. Go to the ‘public_html’ folder and copy the installer and archive files to that folder. Dragging and dropping the files to the public_html folder will start the uploading process.
Depending on the file size, it could take a while to upload the files. Make sure that both of the files are uploaded correctly.
Step 4: Installing the Website in Live Server
At this point, you have uploaded the installer and the archive files to your live server. Now, you have to install them. To do that, you need to access the installer file. This could be done by adding ‘/installer.php‘ after your domain name.
For example, if your domain is ‘myawesomewebsite.com’, then you should go to: ‘myawesomewebsite.com/installer.php‘.
By default, ‘Create New Database’ will be selected as the Action method. If you want to overwrite an existing database, then select ‘Connect and Remove All Data‘.
While Duplicate can try to create a new database on its own, most hosting providers will not allow that. In that case, you have to create a database yourself. You can create a database by logging in to your cPanel and going to the ‘MySQL Databases’ section.
Step 5: Connecting the Database
Once you have created the database, get back to the Duplicator installation page. Provide the host name, database name, username, password and click ‘Test Connection‘.
At this point, Duplicator will check the database and return a success message like the following –
Make sure that you have got ‘Success’ status for both the ‘Server Connected’ and ‘Database Found’ fields. Any error in any of these fields will prevent you from moving forward. Now, check ‘I have read all warnings & notices’ from the bottom of the page and click the ‘Run Deployment‘ button.
Duplicator will automatically install the backup on your live server. If your file size is larger, it will take a while. Once the process is finished, you will be taken to the ‘Update’ step.
Step 6: New Website Settings
In the update step, you will be provided with an overview of the old and new settings of your website. Here, old means the settings of the site you developed in localhost and the new means the one you are creating in live server.
From this step, you can create a new admin account for your new website.
To do that, click ‘New Admin Account’, provide the username and password for the account.
The ‘Advanced Options‘ section lets you perform some advanced tasks. First of all, you can define the website URL from the ‘site URL’ field.
The ‘Scan Tables’ list will allow you to select specific tables to be updated only. ‘Activate Plugins’ will let you choose the plugins that should be activated in the new website.
Once you have made all the changes, click ‘Run Update’. This will complete the process and take you to the third and final step – Test.
Step 7: Testing the Live Site
In the test step, you will have four final steps.
The first one, ‘Install Report‘ will show a report of the total installation process. ‘Resave Permalinks‘ will re-configure the .htaccess file to match the server’s correct path. ‘Test Entire Site‘ will open the live site in a new tab. You can browse your website and make sure that everything is in place.
And lastly, ‘File Cleanup‘ lets you clean all the installation files and other files created by Duplicator during the process. Before cleaning up, make sure that your website is properly copied and is working accordingly.
The settings section of the plugin is located at Duplicator -> Settings.
On that page, you will find the plugin version information along with options to delete the plugin settings and the storage directory when the plugin is uninstalled. And if your database is large, you can use MySQL dump as the ‘Database Build’ choice.
If you have followed all of the above steps, then you have successfully moved your WordPress website from localhost to the live server. Let me know if you have any questions. And if you follow any other method to transfer your website(s), please share your method by leaving a comment.