Although you got a full freedom to develop your WordPress website while on the move i.e. on the web itself but still preferably hundreds of thousands of developers around the world develop a WordPress website locally in lieu of speeding up the developing process.
While, once you are done with your website locally, the next step you would be looking onto move the site from local server to live site by migrating all of your posts, pages, images, themes and plugins. In this article, we are going to discuss all those steps require to complete the transfer.
#1 Local WordPress Database Export
To start the process, make sure you do have full access to your local server as well as you opted for the hosting service which supports WordPress very well. To export your local WordPress database, you will be required to use phpMyAdmin. Go to your localhost directory /phpmyadmin/ and click on your WordPress database and then click on the Export button from the top menu bar. Now choose custom, the option which will let you export your database. Simply select all your tablets now to export and gzipped all them together for compression. Once done, download it.
#2 Moving WordPress To Live Site
Open your FTP client now and connect it to your live site. On connection, start uploading the files but also make sure that you upload the files in the right directory as doing not as it have to be result in huge mess.
#3 Creating MySQL Database
Since the time the FTP client to take to upload all your WordPress files, its better you start working on importing your database. This can be done via cPanel. Log in to your cPanle dashboard and click on the MySQL database icon. Now create a database by entering a name for your database.
Once done, scroll down to MySQL users section and create or add an existing user to the database. As soon as you add the user, you will be asked by cPanel to set MySQL privileges for that user. Simply set all the privileges.
#4 Importing WordPress Database
Click on the phpMyAdmin section under your cPanel database section. On clicking, it will take you to the database which you created in step 3 above. You will notice that there will be no tables in your newly formed database. Not to worry, as if you remember you already downloaded all the tables in step 1 above.
Click on the Import tab in the top menu and click on choose file button followed by selecting the gzipped database file you saved in step 1. Press the Go button at the bottom of the page and phpMyadmin will now import your WordPress database.
#5 Updating Site URL
Since you done with all the basic but important parts, it’s time to set your site live with updating its URL. Look for the wp_options table in your phpMyAdmin. Click on the browse button next to wp_options and under the field options_name, you will find siteurl. Click the Edit Field icon and an edit field window will appear.
In the input box for option_value, you will see the URL of your local install probably something like: http://localhost/test. With proper care insert your new site url in this field, for example: http://www.example.com. Once done, make sure you save the field by clicking the Go button. Now, replicate the step for option name: home and update the home url to be the same as your siteurl.
#5 Final Step
Your site should be showing an Error Establishing Database Connection error. For this, you need to edit wp-config.php file and upload it back to your server. Now again checked you site and you will find, it should be live now. To ensure yourself completely, go to your WordPress admin panel, go to Settings > General and click save options. Go to Settings » Permalink and click Save.
Photo Credit: Flickr/Andrew