Teguh Arief

Move WordPress from Local Server to Live Site Manually

Move WordPress from local server to live site manually.

Teguh Arief

Published on: September 24, 2020

Categories: WordPress
Share:

There are many different ways to migrate a WordPress site. In this article, I will show you how to move WordPress from local server to live site manually. This precise process allows you to safely move all of your site’s content (images, posts, and pages) as well as themes and plugins from a directory on your computer to your host’s production server.

Step 1: Export Your Local WordPress Database

The very first crucial step in migrating your WordPress site is to export the database from your local development environment. This database contains all of your site’s content, settings, and user information, making its accurate transfer absolutely essential for a successful migration. For example, if you're using phpMyAdmin, you'd navigate to your WordPress database, select the 'Export' tab, and then choose the 'Quick' export method with SQL format.

Step 2: Upload WordPress Files to Your Live Site

Now, open an FTP client and connect to your live site. Next, select your local WordPress files and upload them to your live server. This is a crucial step when you move WordPress from local server to live site manually. For example, you'd connect to your host's server using FileZilla, navigate to your public_html directory (or a specific subdirectory if you're installing WordPress there), and then drag and drop all your WordPress files from your local machine to this remote folder.

Step 3: Create a MySQL Database on Your Live Site

With your files uploaded, the next logical step is to set up a new, empty MySQL database on your live hosting server. This database will serve as the new home for the WordPress content you exported from your local environment. For example, most hosting providers offer a database wizard or a dedicated section in their control panel (like cPanel) where you can easily create a new database and a new user, and then grant all privileges to that user for the new database.

Step 4: Import Your WordPress Database on the Live

Once the new database is ready, you'll need to import the SQL file you exported from your local WordPress installation into this newly created database on your live server. This action populates the live database with all your site's content and configurations. For example, you would typically access phpMyAdmin through your hosting control panel, select the newly created database, go to the 'Import' tab, and then upload the .sql file you exported in Step 1.

Step 5: Change the Site URL

After the database is imported, it's critical to update your WordPress site's URL settings to reflect the live domain. This ensures that your site correctly references its new location and prevents any broken links or display issues. For example, you can do this by editing the `wp-config.php` file and adding `define('WP_HOME','http://www.yourlivesite.com');` and `define('WP_SITEURL','http://www.yourlivesite.com');` right below the database credentials, replacing 'www.yourlivesite.com' with your actual domain name.

Step 6: Fix Images and Broken Links by Updating Paths

Even after updating the site URL, you might find that some images or internal links still point to your local development environment. This step addresses that by correcting any lingering old paths to ensure all content displays correctly and functions as intended on your live site. For example, if your local site was `localhost/test/`, and your live site is `www.yourlivesite.com/`, you'll need to update all instances of `localhost/test/` in your database to `www.yourlivesite.com/`.

For those who want to do it via SQL, here is a simple SQL query that should solve this problem and ensure a smooth transition when you move WordPress from local server to live site manually:

UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost/test/', 'www.yourlivesite.com/');

If you have followed all of the above steps, then you have successfully moved your WordPress website from localhost to the live server. Congratulations on successfully completing the process to move WordPress from local server to live site manually!

Related Posts

Google Analytics dashboard showing e-commerce sales data

Boost E-commerce Sales: Master GA4 for Success!

Master Google Analytics for e-commerce. Learn setup, data interpretation, and leverage insights to significantly boost your product sales.

Read More
Installing and configuring Firebase, Node.js, npm, and React on macOS.

Firebase, Node.js and React on MacOS

Learn how to install and set up Firebase, Node.js, npm, and React on macOS to build and deploy full-stack applications.

Read More
CI/CD pipeline for React.js deployment using Visual Studio Code, GitHub Actions, and cPanel FTP.

Streamline React.js Deployment: CI/CD with VS Code Integration

Learn to set up robust CI/CD for React.js with VS Code, GitHub Actions, and FTP on cPanel. This guide covers everything.

Read More