Phase Nine : Going Live โ† Back to WooCommerce Part 3

Move your site from Local to the real internet

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.

๐Ÿงณ Stop 1

What does "migrating a website" actually mean?

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:

๐Ÿ“ 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 database

Your pages, posts, products, menus, settings and orders. We'll export it as a single .sql file.

Zip the filesโ†’Export the databaseโ†’Upload bothโ†’Connect themโ†’Fix URLs & test
๐Ÿง  Think of it like...

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.

โœ… Stop 2

Before you start: the checklist

Most migration problems come from skipping preparation. Spend ten minutes here.

1

Have hosting and a domain ready

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.

2

Finish and tidy your local site

Delete unused plugins, themes and sample pages. A lighter site means smaller files and a faster move.

3

Write down your local address

Open your site in Local and note the exact URL, like http://mysite.local. You'll need it in Stop 9.

4

Note your local admin login

After the move, you'll log in to the live site with the same username and password you use locally.

5

Make a safety copy

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.

๐Ÿ“ฆ Stop 3

Creating the zip file of your site

Your whole website lives in one folder called public. We'll compress everything inside it.

1

Open the site folder

In Local, click your site, then click "Go to site folder" (under the Overview tab). Open the app folder, then the public folder.

2

Check what you see

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.

3

Select everything inside it

Press Ctrl + A (Cmd + A on Mac) to select all the files and folders inside public. Don't zip the public folder itself.

4

Compress them

On Windows, right-click โ†’ "Compress to ZIP file" (or Send to โ†’ Compressed folder). On Mac, right-click โ†’ "Compress."

5

Name and move it

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.

๐Ÿ—„๏ธ Stop 4

Exporting the database file

The database is the brain of your site. Local includes a tool called Adminer for exporting it.

1

Make sure your site is running

In Local, check the site shows "Running." If not, click "Start site."

2

Open the Database tab

In Local, click your site and open the "Database" tab. Click "Open Adminer." A new browser tab opens, already logged in.

3

Click Export

In Adminer's left menu, click "Export."

4

Choose the settings

Set Output to "save," Format to "SQL." Under Tables, select all tables, and under Data, choose "INSERT." Keep "DROP+CREATE" for tables if offered.

5

Click Export and save

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.

๐Ÿ—๏ธ Stop 5

Creating an empty database on your server

Your hosting needs an empty database ready to receive your data, plus a username that's allowed to use it.

1

Log in to your hosting panel

Open cPanel (or your host's control panel).

2

Open MySQL Database Wizard

Search "MySQL" and open "MySQL Database Wizard." It does the three jobs in order.

3

Create the database

Enter a short name, like shop, and click Next. cPanel adds a prefix, so the full name looks like cpuser_shop.

4

Create a database user

Enter a username and a strong password (use the password generator). Click "Create User."

5

Give the user full access

Tick "ALL PRIVILEGES," then click Next.

6

Write down the four details

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.

โฌ†๏ธ Stop 6

Uploading and extracting your files

Now we move the truck of furniture to the new house.

1

Open File Manager

In your hosting panel, click "File Manager."

2

Go to your website's root folder

For your main domain this is usually public_html. For an add-on domain, it's the folder named after that domain.

3

Clear out default files

If you see a default index.html or a "coming soon" page from your host, delete it. Leave any cgi-bin folder alone.

4

Upload your zip

Click "Upload," then drag in mysite-files.zip and wait until it reaches 100%.

5

Extract it

Go back to File Manager, right-click the zip, choose "Extract," and confirm the destination is the same root folder.

6

Check the structure

You should now see wp-admin, wp-content and wp-config.php directly inside public_html, not inside another folder.

7

Delete the zip

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.

๐Ÿ“ฅ Stop 7

Importing the database

Time to pour your saved data into the empty database. We'll use phpMyAdmin on the server.

1

Open phpMyAdmin

In your hosting panel, click "phpMyAdmin."

2

Select your new database

In the left list, click the database you created in Stop 5. It should be empty.

3

Click the Import tab

Find "Import" in the top menu.

4

Choose your file

Click "Choose file" and pick mysite-database.sql. Leave format as SQL and other options as default.

5

Click Import (or Go)

Wait for a green message saying the import finished successfully.

6

Check the tables

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.

๐Ÿ”— Stop 8

Connecting files to database: wp-config.php

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.phpReplace the value with
DB_NAMEYour full server database name
DB_USERYour full database username
DB_PASSWORDThe password you created
DB_HOSTUsually localhost (use what your host says)
1

Open File Manager

Go to your root folder (public_html).

2

Edit wp-config.php

Right-click wp-config.php and choose "Edit." If a warning appears, click "Edit" to continue.

3

Replace the four values

Change only what's between the quotes, for example define( 'DB_NAME', 'cpuser_shop' );. Don't delete the quotes, brackets or semicolons.

4

Save the file

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.

๐Ÿ”„ Stop 9

Fixing the URLs, and finishing touches

Your database still contains your old address, http://mysite.local, in thousands of places. We need to swap it for your real domain.

1

Visit your 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.

2

Log in to the live dashboard

Go to yourdomain.com/wp-admin and log in with the same username and password you used on Local.

3

Install Better Search Replace

Go to Plugins โ†’ Add New, search "Better Search Replace," then Install and Activate.

4

Enter the old and new address

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.

5

Select all tables and do a dry run

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.

6

Run it for real

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.

7

Refresh Elementor's data

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.

8

Re-save permalinks

Go to Settings โ†’ Permalinks and click "Save Changes" without changing anything. This fixes pages that show a 404 error.

9

Check Settings โ†’ General

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.

๐Ÿงช Stop 10

Test everything, fix problems, clean up

Treat your live site like a customer would. Click everything.

1

Check every page and menu link

Open the site in a private window and visit each page from the menu, including dropdowns.

2

Check images and design

Look for missing images, broken layouts, or plain unstyled pages.

3

Test forms and buttons

Submit your contact form and tap the WhatsApp button and chat bubble from Phase Three.

4

Test your shop, if you have one

Place a test order and check that payment, shipping and notifications work. Remember to use test keys until you're ready to go live.

5

Check on your phone

Open it on mobile data and look at the header, mobile menu and padlock.

6

Clean up the server

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.

When something goes wrong
What you seeMost 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 missingURLs still point to the old address. Run Better Search Replace again, then regenerate Elementor files.
Home page works, other pages show 404Go to Settings โ†’ Permalinks and click Save Changes.
"Index of /" list of files, or an old host pageFiles are in the wrong folder. Make sure index.php sits directly in public_html, and delete any default index.html.
Blank white pageOften 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" warningSSL 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-adminClear 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.