If you want to develop a website, the best way to do it is offline using the localhost. It protects your site from corruption as you make extreme changes to it. You can use a program such as XAMPP to set up a local environment for your website. Such a situation creates an offline interface that is almost identical to your live one. When you’re satisfied with the offline site, you can upload it to update the live one. You can move your local website to a live server in two main ways. However, a third option is available, albeit it doesn’t involve the migration of the entire site.
The first method, which is most comfortable and therefore most recommended for beginners, is by use of a plugin. The second one entails moving the files of the local site to the live site manually. It would be best to use this method when one has some background knowledge in web coding. If you only have comments, menus, custom fields, terms, posts, and pages that you want to upload to your live site, there is a secure bonus method for you too. Assuming that you already have a local website, we will enlighten you on how to move a WordPress website from localhost to server.
1. How to move a WordPress website from localhost to server using a plugin
The most comfortable and most convenient method of transferring a website is the use of a plugin. WordPress will suggest several options, but the best is Duplicator. It is the most reliable option with its speed and user-friendly interface. It has over 1 million active installations to show for it and an average rating of 4.9 stars. The following is a procedure for moving a website using a plugin.
i) To install Duplicator plugin, visit the dashboard of your local website and click on the plugin option. Click on the “add new” option.
ii) Type the word “duplicator” into the search box on the right top side of your window and search. The plugin will be the first in the list to appear in a window like the one shown below. Click on the “install now” button. The installation process will be a quick one.
iii) Click on the “activate” button to activate the plugin.
iv) The left navigation pane of your interface will now display the option for Duplicator. Click on the “package” option.
v) You will receive a notification that no Duplicator packages are available, as shown in the screenshot below. It is because you’ve just installed the plugin, and you haven’t created any packages yet. Select the “create new” option.
vi) You will go to a window like the one below, where you should click on the “next” option. Here you will also notice the request to name the package. However, it’s not imperative to rename the package. But if you do, make it something straightforward so you won’t forget it.
vii) Your site will be scanned automatically.
If you encounter any problems, solve them before moving on to the next step.
viii) If everything is fine, you will have a window resembling the one below, where everything reads “good” in green buttons. Click on the “build” option.
This process may take a while, depending on the size of your website.
When the package completes the building, you will receive a notification in a window similar to the one below. You will then have an installer and an archive file in the package. The installer is responsible for transferring your site from the localhost to the server. On the other hand, the archive holds your entire site – plugins, themes, and other content.
ix) You will have a link to download both files labeled “one-click download” that you should click.
x) The next step is to upload both files through your FTP client. You install and unpack the package that contains your site. You can then login and copy the installer and archive files from your computer. Depending on the size of the data, it may take a while.
You can then install the copied site by adding the link for the installer (/installer.php) to the address bar.
The Duplicator plugin will now handle the files and set up your site in a few steps. It’ll ask you to key in your MySQL details. You will use the same information as those for the existing website if you want to replace it entirely. Usually, the URL of the live site will appear automatically. If not, you should enter the necessary details yourself. If you mean to create a new website, you’ll need to enter wholly new information.
Next, the plugin will prompt you to test the site, after which your website will be ready.
2. How to move a WordPress website from localhost to server manually
In this method, you’ll use manual means to upload your website to the live server – without the help of a plugin such as Duplicator. Instead, you only have to access the location of your files for the local site. If you are using the XAMPP for a development environment, you can retrieve it from the program folder.
Rather than dragging and dropping everything one item after another onto your live site, you can create a zip file that contains all the data and upload it directly.
i) After zipping all the files and folders in the WordPress folder (that contains the site files), upload the zip file onto the live server. To do this, you will have to use your FTP authorization details. IF you don’t have your FTP login credentials, you can contact your hosting company and get them.
ii) At this point, the files to your website are on your live site. The next step is to migrate the database from the localhost to the live server. Assuming you are using XAMPP, go to your localhost phpMyAdmin page by clicking on the “admin” button beside the apache module.
iii) To gain access, you should use the word “root” for your username and the password that you set up when you were creating the local environment. Depending on what you preferred, there might be no password, or you allowed your browser to save and retrieve it automatically.
iv) On your phpMyAdmin, locate and select the database on your far left named WordPress. After that, click on the “export” option.
v) You will then receive two options – quick (and display only the minimal options) and custom (and show all possible options). Select the latter (custom) option.
vi) Scrolling down, you will see a “compression” option, under which you will choose the “gzipped” option. Also, click to check all boxes under “add statements” except the “add create database/ use statement” box. Click on “go” at the bottom right corner to transfer the database to your desktop.
vii) The next step is to create a new database on your live site and upload the database you just downloaded here. You do this by accessing your MySQL database via the cPanel dashboard of the host of your website.
viii) On the same page, create a new user and add it to the database. Doing this takes to another page that asks you to allow “all privileges”. Check this box so that the user will have unlimited access to the database.
ix) Go back to the phpMyAdmin via your cPanel and select the “import”option. Click on the “choose file” option and choose the database from the files.
x) Click on the “go” button on the bottom of the page.
xi) Under the new database on phpMyAdmin, choose the wp_options table and look for the site URL and home options on the actual table. Click on edit buttons for the two and edit them to assume the identity of the live site.
xii) Now go back to the public_html folder of the local site files and trace the wp_config.php file. Right-click on it and edit the name and password of the database to match the name and password that you gave to the new user you created previously.
xiii) Back in the settings of your live site dashboard, select “general” save the changes.
xiv) Right there, click on “permalinks” and again save the changes.
xv) Now you can attempt accessing your website.
3. How to move a WordPress website from localhost to server using the inbuilt WordPress export tool
This method doesn’t touch the local files and folders. Instead, it only uploads custom posts, fields, navigation menus, posts, pages, terms, navigation menus, and comments. These light items are the reason why it is quicker and much more comfortable than the first two methods.
i) On your local site, click on the “export” option under “tools” on the navigation panel.
ii) The next screen asks you to select the items you want to export. You can choose among all content, pages, posts, and media. After making a choice, click on “download export file” to extract the files from your local site.
iii) Go to your live site and click on “tools” and then “import” options. Among many options, choose “install now” on the WordPress option. This action will direct you to upload the XML file to your live site, after which you can allocate authors and attachments to the data.
Parting shot
Following the instructions here, it is easy to take your local site live. Depending on your knowledge in coding as well as intentions, you can choose the method that you prefer. The third method is quickest, but it doesn’t involve the movement of all site files. The first – using a plugin – is the second fastest and most comfortable. We recommend it most since it requires little to no knowledge in handling websites and codes. Manual handling of the process takes time, but lets you get more hands-on and make more changes to the files you’re uploading.
All the information on how to move a WordPress website from localhost to server is here so that you can choose the method that fits you best. Have fun doing it yourself.