๐ The files
WordPress itself, your theme, plugins, and all uploaded images. These sit in a folder, and we'll pack them into one zip file.
The final chapter. Pack your site into a zip file and a database file, upload them to your server, connect them, and make everything work live.
Migration means moving your finished website from your own computer (Local) to a hosting server, so the whole world can see it.
Every WordPress site is made of exactly two things, and you have to move both:
WordPress itself, your theme, plugins, and all uploaded images. These sit in a folder, and we'll pack them into one zip file.
Your pages, posts, products, menus, settings and orders. We'll export it as a single .sql file.
Shifting to a new flat. The files are your furniture and boxes, packed into one truck. The database is your address book and documents, packed in a separate bag. You need both at the new place, and then you tell everyone your new address.
Why do it manually? Plugins can automate this, but understanding the manual way teaches you how WordPress really works. And when a plugin fails (it sometimes does), you'll know how to fix it yourself.
Most migration problems come from skipping preparation. Spend ten minutes here.
You need a hosting account (Phase One, Stop 4) and a domain pointed to it. Know how to log in to the hosting control panel. We'll use cPanel as the example, and other panels like hPanel are very similar.
Delete unused plugins, themes and sample pages. A lighter site means smaller files and a faster move.
Open your site in Local and note the exact URL, like http://mysite.local. You'll need it in Stop 9.
After the move, you'll log in to the live site with the same username and password you use locally.
Keep your original local site untouched. Everything in this chapter only copies, it never deletes, so you can always start again.
Keep your hosting login safe. Never share your hosting or database passwords in screenshots or chats. Treat them like your house keys.
Your whole website lives in one folder called public. We'll compress everything inside it.
In Local, click your site, then click "Go to site folder" (under the Overview tab). Open the app folder, then the public folder.
Inside public you should see wp-admin, wp-content, wp-includes, and files like wp-config.php and index.php. If you see these, you're in the right place.
Press Ctrl + A (Cmd + A on Mac) to select all the files and folders inside public. Don't zip the public folder itself.
On Windows, right-click โ "Compress to ZIP file" (or Send to โ Compressed folder). On Mac, right-click โ "Compress."
Rename it something like mysite-files.zip and move it to your Desktop, along with the database file you'll create next.
Why "inside" matters. If you zip the folder itself, the files extract into a folder inside a folder on the server, and your site won't load. Zip the contents so files land directly in the website's root.
Zip is huge? Large uploads may fail on some hosts. Check wp-content/uploads for oversized images and compress them, and delete any backup files lying around in wp-content.
The database is the brain of your site. Local includes a tool called Adminer for exporting it.
In Local, check the site shows "Running." If not, click "Start site."
In Local, click your site and open the "Database" tab. Click "Open Adminer." A new browser tab opens, already logged in.
In Adminer's left menu, click "Export."
Set Output to "save," Format to "SQL." Under Tables, select all tables, and under Data, choose "INSERT." Keep "DROP+CREATE" for tables if offered.
A .sql file downloads. Rename it mysite-database.sql and put it next to your zip file.
Quick sanity check. Right-click the .sql file and open it with Notepad. It should be full of lines starting with CREATE TABLE and INSERT INTO. If it's empty or tiny, the export didn't work. Try again.
Don't edit the SQL file by hand to change URLs. WordPress stores some data in a special format that counts characters, so editing it in Notepad can silently break your site. We'll change URLs the safe way in Stop 9.
Your hosting needs an empty database ready to receive your data, plus a username that's allowed to use it.
Open cPanel (or your host's control panel).
Search "MySQL" and open "MySQL Database Wizard." It does the three jobs in order.
Enter a short name, like shop, and click Next. cPanel adds a prefix, so the full name looks like cpuser_shop.
Enter a username and a strong password (use the password generator). Click "Create User."
Tick "ALL PRIVILEGES," then click Next.
Save the database name, username, password and host (usually localhost). You'll paste them into wp-config.php in Stop 8.
Copy the full names exactly, including the prefix. A tiny typo here is the number one reason for the "Error establishing a database connection" message.
Now we move the truck of furniture to the new house.
In your hosting panel, click "File Manager."
For your main domain this is usually public_html. For an add-on domain, it's the folder named after that domain.
If you see a default index.html or a "coming soon" page from your host, delete it. Leave any cgi-bin folder alone.
Click "Upload," then drag in mysite-files.zip and wait until it reaches 100%.
Go back to File Manager, right-click the zip, choose "Extract," and confirm the destination is the same root folder.
You should now see wp-admin, wp-content and wp-config.php directly inside public_html, not inside another folder.
Once extracted, delete mysite-files.zip from the server to save space and keep things tidy.
Ended up inside a sub-folder? If everything extracted into a folder called, say, public, open it, select all, and use "Move" to send the files up one level into public_html.
Time to pour your saved data into the empty database. We'll use phpMyAdmin on the server.
In your hosting panel, click "phpMyAdmin."
In the left list, click the database you created in Stop 5. It should be empty.
Find "Import" in the top menu.
Click "Choose file" and pick mysite-database.sql. Leave format as SQL and other options as default.
Wait for a green message saying the import finished successfully.
Click your database name again. You should see a list of tables starting with wp_, such as wp_posts and wp_options.
File too large? phpMyAdmin has an upload limit. Try compressing the .sql into a zip first (phpMyAdmin can import zipped files), or ask your host to raise the limit or import it for you.
Your files still think they live on your computer. wp-config.php tells them which database to use.
Inside it are four lines holding your local database details. We replace them with the server details you saved in Stop 5.
| Line in wp-config.php | Replace the value with |
|---|---|
DB_NAME | Your full server database name |
DB_USER | Your full database username |
DB_PASSWORD | The password you created |
DB_HOST | Usually localhost (use what your host says) |
Go to your root folder (public_html).
Right-click wp-config.php and choose "Edit." If a warning appears, click "Edit" to continue.
Change only what's between the quotes, for example define( 'DB_NAME', 'cpuser_shop' );. Don't delete the quotes, brackets or semicolons.
Click "Save Changes" in the top-right corner, then close the editor.
Don't touch the $table_prefix line. It must match the prefix of your imported tables (usually wp_). Since it was copied from Local, it already does.
Your database still contains your old address, http://mysite.local, in thousands of places. We need to swap it for your real domain.
Open https://yourdomain.com. It may look a bit broken, with missing styles or images. That's expected, we haven't fixed the URLs yet.
Go to yourdomain.com/wp-admin and log in with the same username and password you used on Local.
Go to Plugins โ Add New, search "Better Search Replace," then Install and Activate.
Open Tools โ Better Search Replace. In "Search for," type http://mysite.local. In "Replace with," type https://yourdomain.com. Use your own exact addresses, with no slash at the end.
Select every table. Keep "Run as dry run?" ticked, then click "Run Search/Replace." It shows how many changes it would make without saving anything.
If the dry run looks right, untick "Run as dry run?" and run it again. Done. This tool handles WordPress's special data format safely.
If you used Elementor, go to Elementor โ Tools. Use "Replace URL" if needed, then click "Regenerate Files & Data." This fixes styling and images built with Elementor.
Go to Settings โ Permalinks and click "Save Changes" without changing anything. This fixes pages that show a 404 error.
Confirm both "WordPress Address" and "Site Address" show your https:// domain.
No padlock yet? Most hosts offer free SSL (often called AutoSSL or Let's Encrypt) in the control panel. Switch it on, wait a few minutes, then reload. Then do the search-replace using https://, so the padlock shows on every page.
Let Google in. Go to Settings โ Reading and make sure "Discourage search engines from indexing this site" is unticked. Then connect Search Console and Analytics as you learned in Phase Five.
Treat your live site like a customer would. Click everything.
Open the site in a private window and visit each page from the menu, including dropdowns.
Look for missing images, broken layouts, or plain unstyled pages.
Submit your contact form and tap the WhatsApp button and chat bubble from Phase Three.
Place a test order and check that payment, shipping and notifications work. Remember to use test keys until you're ready to go live.
Open it on mobile data and look at the header, mobile menu and padlock.
Delete any leftover zip or .sql files from the server. Keep copies on your computer. Then set up regular backups, either through your host or a plugin.
| What you see | Most likely cause and fix |
|---|---|
| "Error establishing a database connection" | A wrong value in wp-config.php. Re-check database name, user, password and host (Stops 5 and 8). Make sure the user has all privileges. |
| Site opens but looks plain, or images are missing | URLs still point to the old address. Run Better Search Replace again, then regenerate Elementor files. |
| Home page works, other pages show 404 | Go to Settings โ Permalinks and click Save Changes. |
| "Index of /" list of files, or an old host page | Files are in the wrong folder. Make sure index.php sits directly in public_html, and delete any default index.html. |
| Blank white page | Often a plugin or PHP issue. In File Manager, rename the plugins folder inside wp-content to test, then rename it back and re-enable plugins one by one. |
| Padlock missing, or "Not secure" warning | SSL isn't active yet, or some URLs are still http://. Enable SSL, then re-run the search-replace for any leftover http:// addresses. |
| Can't log in at wp-admin | Clear your browser cookies, and double-check you're using your local username and password. |
Shortcut for next time. Local can also export a site as a ready-made zip, and migration plugins can automate everything above. Now that you know what's really happening, you can use them confidently, and fix things when they break.