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.
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
- Open the folder of your website
- Select all files inside it
- 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.
- Open phpMyAdmin in your local XAMPP panel
- Select the database on the left
- Click Export tab
- Select “Quick” + “SQL”
- Download the .sql file
You will later import this file into your Nairahost MySQL database.
Step 3: Upload Files to Nairahost
- Login to Nairahost cPanel from your client area
- Go to File Manager
- Enter
public_html - Delete any default files if necessary
- Click Upload and upload your ZIP file
- 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
- Go to MySQL Databases in cPanel
- Create a new database (example:
mysite_db) - Create a database user and password
- Assign user to database with ALL PRIVILEGES
- 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