Introduction
You must be ready with your website design and development, right? But wait, your website must be built on the local host. Most developers find it more suitable to design a website on a local host. This stage is done on the personal computer or device developers have. Web design becomes fast and easy to manage on a local server. But that is okay when you are just designing it. We are going to help you move WordPress localhost to live server using different methods.
To make it accessible for end users, you need to switch WordPress from the local host to the live server. Shifting your website to the live server helps users access the website. And moving your website on WordPress from a local host to a live server is what this blog shows.
Why move your website from a WordPress localhost to a live server?
- As you know, the web design and development are done on a local host server. And when it is completely ready, you need to switch to the live server.
- Most developers find it secure and fast to get their web design ready on the local host. Creating changes on the website is easier on the local server than on the live server.
- When the design is completed, it becomes easier to upload it to the live server. And here, we bring you the most effective two methods to apply.
Things to do before moving your website from a WordPress localhost to a live server
- Before getting into the process of moving your WordPress localhost to live server, you must keep some things in mind.
- First of all, you must keep your website up with a good hosting service. This is required as your website will be protected from security breaches.
- Then there is a need to connect your domain name to the web host. This may happen when you have different platforms for web hosting and domain names.
- Keep your control panel login details safe with you.
- Also, you need to have the Secure File Transfer Protocol details that are present on the hosting control panel.
Methods to Move Your Website on WordPress from Localhost to Live Server
A. Move the WordPress localhost to the live server using a plugin.
B. Move the WordPress localhost to the live server manually.
A. Move the WordPress localhost to the live server using a plugin.
The first method is quite easy, as we are using the Duplicator plugin for this. It is as easy as beginners can even use.
1. Get the Duplicator Plugin installed and activated.
- And for this, we need to first install and activate the Duplicator plugin on the website.
- Once the activation is done, simply visit the Duplicator option under the dashboard. Then click on the Packages page and tap the “Create New” button.
- You will reach the next page, where you need to give a name to your backup, and then click the Next button.
- This will start running some tests to see whether everything is working well. Once everything is well, all the tests will be marked "good," and you need to tap the Build button.
- The process will begin, and it depends on the size of your website. Once it's finished, the next page will display download options for the Installer and Archive pages.
- Do not get confused, as you need to tap the “Download Both Files” link just below it. Downloading both files helps with the easy migration process.
- The archive file is a set of all the core files of the website, including images, themes, plugins, and backups. The Installer link will ease the migration by unpacking the archive files from your website.
2. Generate a new database for the new live website.
- Wait, before getting your website migrate Wordpress local live server, you need to create a MySQL database for the new website.
- For this, simply visit the cpanel of your hosting account and tap the database section. Then tap “MySQL Database Wizard”.
- The next page will take you to the set name of your database. Tap the “Create Database” button. The next step is to provide a username and password for the new user and tap the “Create User” button.
- Now, you need to add your database by simply tapping the “My Privileges” checkbox. To store all the changes, simply tap the "Make Changes" button. Your database is now ready.
Remember there may be chances of SQL injection in WordPress so kindly take preventive measures for that.
3. Transfer files from the WordPress localhost to live server.
- The next step is to transfer all the installer and archive files from the WordPress local site to the hosting account.
- You need to connect your website using the FTP client and make sure the root directory has no data. If any WordPress files are located, simply delete them and paste the archive and installer files.
4. Running the Migration Script
- The final step will run the migration script, and for this, you need to visit:
- “http://websitename.com/installer.php”
- This will directly help you launch the duplicator migration wizard. The installer will start running a few tests to initialize the script.
- The next page will ask you to enter database details like username, password, and database name. Once done, simply tap the Validate button to ensure the details are correct.
- Click the “Next” button, and the Duplicator will start importing the database backup from the archive to the new database. Even the URLs pointing to your website will get updated with this.
- Once done with this, tap the Admin Login button to get into the WordPress admin area of the live site.
- After the successful login, the duplicator will clean the installation files. Finally, you have moved the WordPress localhost to live server.
B. Move the WordPress localhost to the live server manually.
This one’s a manual process to move the WordPress localhost to live server. The method applies to those who have good coding and learning skills.
1. Exporting the Local Server Database
- The first step requires exporting the local server database using phpMyAdmin.
- For this, simply visit “http://localhost/phpmyadmin/” and then tap your WordPress database.
- The next step is to tap the Export button from the menu bar situated at the top of the page. The Export method will let you choose from two options: Quick and Custom.
- The Custom option will let you customize the database uploading options. Whereas the Quick option will simply export your database, this is the preferred one. Once you choose the Quick method, tap the Go button to jump to the next step.
2. Uploading the file from the WordPress localhost to live site
- The next step is to upload all the local host files to the live site. You need to first connect the FTP client to your web hosting account.
- Once you have successfully connected, simply upload all the files to the right directory and move on to the next step.
3. Creation of the MySQL Database on the Live Site
- Meanwhile, your files are being uploaded, and you can start creating the database on your live server.
- For this, you must log in to the cPanel of your hosting account and tap "MySQL Database Wizard” from the Database section.
- On the next page, you will need to give a name to your database and tap the Create Database button.
- The next step is to enter the username and password as a new user and tap “Create User”.
- The next step is to add the new user created by checking the “All Privileges” box. And then simply tap the Make Changes button to store the new changes. You have created a new database successfully.
4. Import the newly created database to the live site.
- The next step is importing the newly created database. For this, visit the cPanel and reach the Databases section, then the phpMyAdmin option.
- In the phpMyAdmin area, you need to tap the newly created database. Then it will display without any tables.
- Next, tap the Import button from the top menu list, and then choose the database files from the local site.
- Tap the Go button, and your database will be immediately imported to phpMyAdmin.
5. Changing the URL of your website
- The next step is to change the URL of your website to connect safely with the live website.
- For this, visit phpMyAdmin and find the wp_options table in the newly created database. Tap the “Browse” button in front of "wp_options,” and this will open the list of fields.
- In the “options_name” column, find the site URL option and tap the Edit link in front of it, and the edit window will appear.
- You will then find the URL of your localhost in the “option_value” field, which will be replaced by the new live site URL. Simply enter your live website’s URL and tap the Go button.
6. Create your live site.
- After importing the database and importing the content, it's time to set the final stage for your live site. It is related to the configuration of WordPress.
- Then an error named “Error Establishing a Database Connection” will occur, which is to be fixed.
- You need to connect the website using the FTP client and open the wp-config.php file.
You will see the following code:
** MySQL settings: You can get this information from your web host. ****
The name of the database for WordPress
define( 'DB_NAME', 'database_name_here' );
/** MySQL database username */
define( 'DB_USER', 'username_here' );
/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
The code provides the database name, username, and password that were created earlier. Then you need to save the wp-config.php file and upload it back to the hosting service. Finally, you will get to see your website live.
Next, visit the Settings section of the admin dashboard. Then select General Settings, and then tap the Save Changes button at the bottom. This ensures that your website URL is the same everywhere.
Also, you must save the permalink settings under the Settings section.
Conclusion
So, you must have now understood how vital it is to move the WordPress localhost to live server. This is the stage when you make your website live in front of end users. And we have made this process easier for you in the above blog. We have depicted the best and easiest two methods to move WordPress from the local host to the live server. The first method is the Duplicator plugin, and the second method is the manual process. After you have moved your website to a live server, you can give your website a fresh look by choosing a premium WordPress theme.
To get your perfect theme, there are number of websites and market places to purchase from, I would suggest VW Themes. They have the best variety of WordPress themes and that too at a pocket-friendly price. As of now, their Wordpress Halloween deals are live, where you can purchase premium themes at a 25% discount. Grab your deals now and visit the site before the deal goes offline.