#1 India's Top IT Training Institute
×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
Mentors

Mentors

Meet the industry experts who train and guide you through your course.

Read More →
Free Resources

Free Resources

Free tutorials, interview questions, tools and calculators to help you learn.

Explore →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Moving from Localhost to Live Server

Making Your Site Public

Moving a WordPress site from localhost to a live server is the final step before real visitors can see and interact with it.

Preparing for the Move

Export your local database using phpMyAdmin, and gather all your WordPress files from the local server folder.

Set up your hosting account, domain, and database beforehand so everything is ready to receive the site.

Performing the Move

Upload your files to the live server via FTP, then import your exported database into the new hosting database.

Update the site URL and database connection details in wp-config.php to match the new live environment.

Search and replace any remaining localhost URLs in the database using a plugin or database tool.

StepAction
ExportDatabase via phpMyAdmin
UploadFiles via FTP to live server
ImportDatabase into live hosting
Update configwp-config.php with new DB details
Fix URLsSearch-replace old localhost URLs

This manual process can be simplified significantly by using a dedicated migration plugin instead.

Export and Import From the Command Line

phpMyAdmin works for small sites, but large databases can time out in the browser. If you have terminal access, the MySQL tools are faster and more reliable:

# On your computer: export the local database
mysqldump -u root -p mysite_local > mysite.sql

# On the server: import into the empty live database
mysql -u live_user -p live_db < mysite.sql

Upload the whole WordPress folder, including wp-content with its themes, plugins and uploads. Missing the uploads folder is the most common reason images break after a move.

Configuring wp-config.php for the Server

Open wp-config.php on the server and change the database details to the values from your hosting panel:

define( 'DB_NAME', 'live_db' );
define( 'DB_USER', 'live_user' );
define( 'DB_PASSWORD', 'use-a-long-unique-password' );
define( 'DB_HOST', 'localhost' );   // some hosts give a different host name

$table_prefix = 'wp_';              // must match the prefix in the imported tables

define( 'WP_DEBUG', false );        // never show errors to visitors

If the prefix in this file does not match the tables you imported, WordPress thinks the site is not installed and shows the setup screen. It is also a good moment to replace the security keys and salts with fresh values from the official WordPress salt generator, which logs out any sessions copied from your local machine.

Replacing URLs Without Breaking Data

WordPress stores some settings as serialized PHP data, where the length of each string is saved next to it. A plain SQL find-and-replace changes the text but not the length, which corrupts widgets and theme options. Use a tool that understands serialization, such as a search-replace plugin or WP-CLI:

wp search-replace 'http://localhost/mysite' 'https://example.com' --skip-columns=guid --dry-run
wp search-replace 'http://localhost/mysite' 'https://example.com' --skip-columns=guid

The first command only reports what would change. Run the second when the numbers look right. Skipping the guid column follows the usual advice not to rewrite post identifiers used by feed readers.

Checks to Run After Going Live

  1. Save permalinks once under Settings > Permalinks to regenerate rewrite rules; if inner pages show 404 errors, the .htaccess file or server rewrite rules need attention.
  2. Turn on HTTPS with an SSL certificate from your host and make sure both site address fields use https://.
  3. Allow search engines. Under Settings > Reading, untick "Discourage search engines from indexing this site" if it was ticked during development.
  4. Test forms and email, because many hosts need an SMTP plugin before contact forms can send mail.
  5. Click through key pages on desktop and mobile, checking images, menus and any mixed-content warnings in the browser.
  6. Set up backups before you start making changes on the live site.

Common mistakes: uploading over a slow connection and missing files without noticing, leaving WP_DEBUG on, editing URLs directly in the database, and forgetting to remove test users or sample content created while building locally.

Ready to master WordPress Training Course?

Join Uncodemy's hands-on, mentor-led WordPress training and build real, live websites.

Explore Course