Effortlessly Transitioning Your WordPress Website from LocalHost to an Online Domain

Last Updated: February 2, 2024


WordPress Migration Guide

Steps for Migrating from LocalHost/XAMPP/WAMP to Live Domain

  • 1. Compress your local WordPress files from your XAMPP/WAMP environment.
  • 2. Log in to your hosting control panel and navigate to the domain section.
  • 3. Create a new subdomain for your site.
  • 4. Upload your compressed WordPress files to the server's subdomain folder.
  • 5. Export your WordPress database from your local phpMyAdmin.
  • 6. In your hosting control panel, create a new database in the databases section.
  • 7. Create a new user for your database and assign full privileges.
  • 8. Import your exported database to the server using phpMyAdmin.
  • 9. Update the WordPress Configuration File and Database Table
  • 10. Your WordPress site is ready. Visit https://wordpressapp.letsmakeitonline.com/ and log in

Compressing WordPress Files in XAMPP

Follow these steps to compress your WordPress project in the XAMPP's htdocs directory:

  1. Locate Your WordPress Project: Find your WordPress site folder within XAMPP's htdocs directory.
  2. Prepare for Compression: Remove unnecessary files from your WordPress folder to reduce the zip file size.
  3. Compress the Folder: Right-click on the folder and choose to compress it into a .zip file.
  4. Verify the Compressed File: Ensure that the .zip file includes all necessary WordPress files.


By following these steps, you'll create a .zip file of your WordPress site, ready for upload to your live server.


Go to the cPanel Domain Section and Create a Subdomain on the Server

After preparing your local WordPress site by zipping the files, the next steps involve working with your web hosting's cPanel. This web-based interface is provided by many hosting services to manage websites easily.

Steps Covered:

  1. Accessing cPanel:

    Log in to your web hosting account and access the cPanel dashboard. This is usually achieved by adding "/cpanel" at the end of your website URL or via a direct link provided by the hosting service.

  2. Navigating to the Domain Section:

    In cPanel, locate the "Domains" section to manage domain-related settings.

  3. Creating a Subdomain:

    Click on the “Subdomains” option to open the subdomain creation interface. Enter the desired subdomain name and verify the automatically filled document root, then click on “Create” or “Add”.

  4. Verification and Folder Creation:

    After creating the subdomain, a new folder with the subdomain's name will be automatically created in your hosting file structure. Verify this in the “File Manager” in cPanel.



Step 4: Upload Your Compressed WordPress Files to the Server's Subdomain Folder

After creating your subdomain, the next step is to transfer your WordPress site's files to the server. This involves uploading the zipped WordPress directory to your subdomain's folder.

Steps Covered:

  1. Locating the Subdomain Folder:

    Use the 'File Manager' in your hosting control panel to find the folder named after your subdomain, typically inside the root directory.

  2. Preparing to Upload:

    Navigate to your subdomain's folder within the File Manager, readying it for the file upload.

  3. Uploading the Files:

    Click on the 'Upload' option in File Manager and select the zipped WordPress file from your computer to start the upload process.

  4. Extracting the Files:

    After uploading, extract the zipped file directly in the File Manager, ensuring the files are placed in the correct directory.

  5. Verification:

    Verify that all WordPress files, including directories like 'wp-admin', 'wp-content', and 'wp-includes', are properly placed in the subdomain's root folder.

Step 5: Export Your WordPress Database from Your Local phpMyAdmin

Exporting your WordPress database from the local server is a critical step in migrating your site to a live server. This involves using phpMyAdmin to create a backup of your WordPress database.

Steps Covered:

  1. Accessing phpMyAdmin:

    Start the MySQL service in your XAMPP/WAMP control panel and navigate to "http://localhost/phpmyadmin" in your web browser.

  2. Selecting Your WordPress Database:

    In phpMyAdmin, select the database associated with your WordPress site. Check the 'wp-config.php' file if you are unsure of the database name.

  3. Exporting the Database:

    Click on the 'Export' tab in phpMyAdmin. Choose the 'Quick' method for most sites, and ensure the format is set to 'SQL'.

  4. Performing the Export:

    Click 'Go' to begin the export. The database will be downloaded as a .sql file to your computer.



Steps 6 & 7: Create a New Database and User in Your Hosting Control Panel

Setting up a new database on your live server and creating a user for it are essential steps in migrating your WordPress site from localhost. This involves creating a database and assigning a user with full privileges to it.

Steps Covered:

  1. Accessing the Database Section:

    Log into your hosting control panel and navigate to the 'Databases' section.

  2. Creating a New Database:

    Find the 'MySQL Databases' or 'Database Wizard' option. Create a new database and note down its name.

  3. Creating a New Database User:

    Create a new user in the 'Databases' section, choosing a secure username and password. Remember these credentials.

  4. Assigning Privileges to the User:

    Add the new user to the database and grant them full privileges. Ensure all privileges are selected and save the changes.


Steps 8 & 9: Import the Exported Database and Update WordPress Configuration

For a successful migration of your WordPress site to a live server, it is crucial to import the exported database using phpMyAdmin and then update the WordPress configuration settings.

Steps Covered:

  1. Importing the Exported Database:

    Access phpMyAdmin in your hosting control panel, select your new database, and use the 'Import' tab to upload the '.sql' file exported from your local environment.

  2. Updating the 'wp-config.php' File:

    Edit the 'wp-config.php' file in your WordPress directory to reflect the new database name, user, and password. Verify the 'DB_HOST' setting.

  3. Modifying the 'wp_options' Table:

    In phpMyAdmin, navigate to the 'wp_options' table of your WordPress database and update the 'siteurl' and 'home' entries to your live site's URL.


Congratulations! Your WordPress Site is successfully migrated to your New Domain.

Here's how to access and manage it:

  1. Open your web browser.
  2. Go to https://wordpressapp.letsmakeitonline.com/.
  3. Log in to the WordPress dashboard using your username and password.

Watch the Complete Tutorial Here