Knowledgebase

How to Migrate a Website From Localhost to Nairahost Print

  • localhost migration, wordpress localhost, database import, xampp to hosting, beginner
  • 0

How to Migrate a Website From Localhost to Nairahost

A complete step-by-step guide for beginners using XAMPP, WAMP, LocalWP, or any local development software.

Tags: localhost migration, xampp, wordpress, php, beginner, staging, database import

Introduction

Many people build their first website on a local server using tools like XAMPP, WAMP, MAMP, Laragon, or LocalWP. This is a great way to develop and experiment offline. But when it’s time to go live, most beginners get stuck: How do I move my local website to a real hosting server like Nairahost?

This tutorial explains how to migrate any PHP/MySQL site from your computer to Nairahost hosting. This includes WordPress, PHP apps, custom websites, static websites and more.

This guide is written in beginner-friendly language so even young adults or non-technical users can follow it.

Understanding the Difference Between Localhost and Live Hosting

Localhost = your own computer. Nothing is online. Only you can see the site. Live Hosting = a real server connected to the internet. Everyone can see the site.

Localhost (XAMPP) Nairahost Hosting
Runs only on your PC Accessible worldwide
Database stored locally Database stored in MySQL server
Uses localhost URL Uses a domain like yourdomain.com

To migrate, you must move ALL required files and database, then connect them to your domain.

Step 1: Prepare Your Files for Upload

On your local machine, locate your website files. In XAMPP, they are usually found in:

C:\xampp\htdocs\yourproject
  1. Open the folder of your website
  2. Select all files inside it
  3. Right-click and choose Send to → Compressed ZIP

You should now have something like mysite.zip ready to upload.

⚠️ Do NOT upload individual files manually, always ZIP your project first.

Step 2: Export Your Database

If your website uses WordPress, Laravel, or any PHP app that requires MySQL, you must export the database manually.

  1. Open phpMyAdmin in your local XAMPP panel
  2. Select the database on the left
  3. Click Export tab
  4. Select “Quick” + “SQL”
  5. Download the .sql file

You will later import this file into your Nairahost MySQL database.

Step 3: Upload Files to Nairahost

  1. Login to Nairahost cPanel from your client area
  2. Go to File Manager
  3. Enter public_html
  4. Delete any default files if necessary
  5. Click Upload and upload your ZIP file
  6. After upload, click Extract
???? If your site belongs in a subfolder (like /blog), create that folder first before uploading.

Step 4: Create Database & Import SQL

  1. Go to MySQL Databases in cPanel
  2. Create a new database (example: mysite_db)
  3. Create a database user and password
  4. Assign user to database with ALL PRIVILEGES
  5. Open phpMyAdmin → Select database → Import → Choose SQL file

DB_NAME: mysite_db
DB_USER: mysite_user
DB_PASS: yourpassword
DB_HOST: localhost
    

Step 5: Update Configuration

For WordPress

Edit wp-config.php and update:


define('DB_NAME', 'mysite_db');
define('DB_USER', 'mysite_user');
define('DB_PASSWORD', 'yourpassword');
define('DB_HOST', 'localhost');
    

If URL is still showing http://localhost, fix it by editing these in phpMyAdmin:


wp_options → siteurl
wp_options → home
    

Step 6: Point Domain to Nairahost

Use correct nameservers:

cPanel hosting:


ns1.nairahost.cloud
ns2.nairahost.cloud
    

DirectAdmin hosting:


ns1.nairahost.com.ng
ns2.nairahost.com.ng
    

Step 7: Test and Fix Common Errors

  • White screen = plugin conflict or missing PHP extensions
  • Database error = wrong db name or password
  • CSS broken = update URL paths
  • 404 errors = refresh permalinks

Migrating from localhost may feel scary at first, but once you understand the steps (Move files → Move database → Update config → Point domain), it becomes easy. This is the same method professional developers use every day.


Was this answer helpful?
« Back
Loading indicator for Nairahost web hosting services
WhatsApp chat support for Nairahost web hosting Nigeria Chat with us