How to Move WordPress Website from Localhost to Live Hosting

Installing a web server on your computer allows you to build a website and make custom development for your project. Building a web project on local server makes you to save bandwidth and development time. But these are run on private computer and your website is not on public. If you are finished development on local server, you need to publish your website to public or live environment. In this article, I will show you how to move WordPress website from localhost to live hosting. Look the following guides.

1.Export your database

Open up your browser and go to 127.0.0.1/phpmyadmin . Then, select your database file and click “Export”. Save your database format as “SQL” and click “Go” to save.

database-backup

Browser will ask you download the file. Save your database file.

database-save

2. Upload Your WordPress Folder

Login into your hosting and go to file manager. Upload your WordPress folder from localhost to “Public_html”. See the following picture.

cpanel-public

Upload your WordPress folder and wait a few moment. You can upload using any third-party FTP software like as FileZilla, CuteFTP, etc. In this example, I compressed my WordPress folder and upload via cPanel.

cpanel-upload

3. Creating MySQL database

After your WordPress file has been uploaded, you need to create database. Login into cPanel and click “MySQL Database Wizard”.

mysql-db
  • Create database name and click “Next Step”.
db-create
  • Create database username and password and click “Create User”.
db-usr
  • Add user to the database and check “All Privileges”. Then, click “Next Step”.
db-permission
  • Now, you have finished creating database with user and it will show database wizard is completed.
db-finished

4. Importing Database

Go to phpMyAdmin from cPanel and select the database that you created in step3. Then, click “Import” tab and upload your database file that is exported by local server. Click “Go” to database import process.

db-import

5. Change Website URL

You need to change URL of your WordPress website. Go to phpMyAdmin and find “wp-options”. Then, edit “site url”.

site-url

Replace your domain name in site URL. Then, click “Go” to save setting.

site-url-change

You also need to edit “home” option name. Find “home” option_value in table. It is same setting with “site url” option name. Fill your domain and click “Go”.

6. Editing wp-config.php file

You need to edit your wp-config.php file. Otherwise, you will get nightmare screen as below. :P

db-error

Go to file manager and find wp-config.php file in your root. Then, edit some configuration. You need to modify database name, user and password. See the following picture.

wp-config

After editing database settings, save you file.

7. Testing Your Live WordPress Website

Open your browser and test your website. You will see your WordPress live version.

wp-site-move

If you wouldn’t see your site completely or something wrong, you have wrong edit on wp_option. Double check your settings in “siteurl” and “home” option values. You need to fill full domain URL path. If you are running sub folder of your original domain, it looks like this : www.yourdomain.com/yoursite/ in “siteurl” and “home” option values.

Conclusion

Although there are other ways to move local WordPress site to live environment, the way I explained above is manual. If you don’t want to make manually, you have to use plugins. If you are facing with the problem in moving WordPress website, you can freely leave comments and I will solve for your problem as much as I can.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.