WPLake > Learning Hub > Migrate WordPress Site to a Live Server : Step-by-Step Guide

Migrate WordPress Site to a Live Server : Step-by-Step Guide

Smoothly migrate your website: Choose reliable hosting, export/import database, transfer files, update WordPress config, and finally test functionality.
To Migrate Wordpress is like transporting passengers on a train.

Key Points at a Glance

  1. Choosing a Reliable Hosting Provider: Selecting a hosting provider with good performance, uptime guarantees, and easy WordPress installation options is crucial for a smooth migration process.
  2. Setting Up the Live Server Environment: Registering a domain or subdomain, provisioning server space, and configuring server settings are essential steps in preparing the live server environment.
  3. Exporting the Database: Using tools like phpMyAdmin to export the development site's database ensures a smooth transition to the live server.
  4. Transferring Files to the Live Server: Utilizing FTP clients like FileZilla simplifies the process of transferring site files securely to the live server.
  5. Importing the Database: Creating a new database on the live server and importing the exported database file ensures data integrity during the migration process.
  6. Updating WordPress Configuration: Updating the wp-config.php file with the live server's database details is crucial for proper functionality post-migration.
  7. Updating Permalinks and Testing: Ensuring that permalinks are configured correctly and testing the site's functionality on the live server is essential for identifying and resolving any issues.

Table of Contents

To Migrate WordPress as a development site to the live server is an important step in making your website accessible to the world. While the process may seem daunting, with proper planning and execution, you can seamlessly transition your site to the live server.

Step 1: Choose a Reliable Hosting Provider

Before you begin the migration process, it's essential to select a reliable hosting provider that meets your website's requirements. Look for a hosting company that offers good server performance, uptime guarantees, excellent customer support, and easy WordPress installation options. Make sure the chosen hosting package matches your site's needs in terms of storage, bandwidth, and scalability.

Step 2: Set Up the Live Server Environment

Once you have a hosting provider in mind, do some research because it's important for the security of your WordPress website. Now it's time to set up your live server environment. This typically involves registering a new domain or subdomain, provisioning server space, and configuring server settings. If your hosting provider offers a one-click WordPress installation option (like Softaculous). Then take advantage of it to simplify the process of having to migrate WordPress.

Step 3: Export the Database

Next, you need to export your WordPress development site's database. Log in to the development server's MySQL (or other database type). I prefer using the popular phpMyAdmin tool, as it offers a great Graphical User Interface (GUI). First, select your database from the list, choose 'Export' from the top tabs. Scroll down and check your tables "customize" option, choose the 'gzipped' compression, then click on the "Go" button. This action will save the 'x.tar.gz' file containing your site's database to your local machine.

Note: We recommend keeping the database tar file for a few days after launch. You may need it for some odd reason, so it's best to have it as backup.

Step 4: Transfer Files to the Live Server

To transfer your site's files to the live server, you have a few options. One of the simplest methods is to use an FTP (File Transfer Protocol) client like FileZilla. Connect to your development site's server using the FTP credentials. You can ask you hosting company or set it up yourself via the interface. Once connected, navigate to the WordPress installation directory. Select all the files and folders, then upload them to the appropriate directory on the live server.

Migrate wordpress using Filezilla
Use FileZilla to connect to your Host via FTP

Pro Tip: Enable "View hidden files and folders" option to see all the files, including the .htaccess file.

Step 5: Import the Database

Access the live server's database management tool, usually phpMyAdmin is provided by your hosting company. Create a new database and assign a user with all privileges to it. At this stage you may need to first setup the database with you cPanel or DirectAdmin MySQL database management tool. Continue, by selecting the newly created database and choose the "Import" option. Now 'browse' and select the .tar.gz file from your desktop. When you're ready, click "Go" to import the data into the live server's database.

Note: If you have an error while importing, carefully read what it says, usually there is a piece of the import file text that tells it to create a new database. You could remove the lines that mention "Create database" to prevent issues.

Step 6: Update WordPress Configuration

After importing the database, it's crucial to update the WordPress configuration to reflect the live server environment. In the WordPress installation directory on the live server, locate the "wp-config.php" file. Open it in a text editor and update the database name, username, password, and host details with the ones specific to the live server.

Pro tip: Not all MySQL servers use 'localhost' companies like Hetzner use 'sql14.cpt4.host-h.net' to connect directly to MySQL.

Windows terminal used to ping domain
Use CMD prompt in Windows to ping a domain.

Step 7: Update Permalinks and Test

Log in to the WordPress admin panel on the live server using the credentials you used on the development site. Navigate to the "Settings" menu and choose "Permalinks." Ensure the same permalink structure is selected as on the development site. Save the changes to update the permalink structure on the live server.

Finally, go ahead and explore your website on the live server to assess its functionality and confirm whether images and icons are loading properly. If nothing is visible on the frontend, you may have what is known as a White screen of death, time for some troubleshooting.

If you find that you are redirected to your development or staging site instead of the live site, you will have to manually update the 'siteurl' and 'home' entries in the 'wp_options' table in the database.

To update all your links, permalinks and similar we recommend using Better Search and Replace.

Conclusion

As you can see, to Migrate WordPress websites to a live server doesn't have to be a complicated process. Follow these step-by-step instructions, to smoothly transition your site to the live server and make it accessible to the world. Remember to choose a reliable hosting provider, export and import the database correctly (if you see errors, read them carefully), transfer the files securely, and update the necessary configurations. With proper planning and execution, your website will be up and running on the live server in no time.

Don't forget to uncheck the "Discourage search engines from indexing this site" in your WordPress 'Reading' settings, and to go through your list for optimizing your WordPress installation. As no one enjoys using a slow website.

Frequently Asked Questions

  1. What steps are involved in setting up the live server environment?

    Setting up the live server environment typically involves registering a domain or subdomain, provisioning server space, and configuring server settings.

  2. How do I export the database from my WordPress development site?

    You can export your WordPress development site's database using tools like phpMyAdmin, which provide a graphical user interface for exporting databases.

  3. What is the best way to transfer files to the live server?

    Utilizing FTP clients like FileZilla simplifies the process of securely transferring site files to the live server.

  4. How do I import the database into the live server?

    After creating a new database on the live server, you can import the exported database file using tools like phpMyAdmin.

  5. What configurations do I need to update in WordPress after migration?

    Updating the wp-config.php file with the live server's database details is essential for ensuring proper functionality post-migration.

Content links (9)

Related articles

About the Author

Baxter Jones

Working in the web industry for over 15 years gaining experience in design,user experience and web best practices. Has a keen eye for detail and enjoys having a process when working and creating. He thinks WordPress is the best thing since sliced bread and when he’s not behind his computer he’ll be in the garden.

0 Comments

    Leave a comment

    Reply to 

    Please be considerate when leaving a comment.

    Not shown publicly

    Got it