{"id":189,"date":"2019-04-05T15:30:34","date_gmt":"2019-04-05T15:30:34","guid":{"rendered":"https:\/\/mumbaiwebhosting.co.in\/portal\/?p=189"},"modified":"2019-04-12T15:32:34","modified_gmt":"2019-04-12T15:32:34","slug":"migrate-wordpress-from-local-host-to-online","status":"publish","type":"post","link":"https:\/\/mumbaiwebhosting.co.in\/portal\/migrate-wordpress-from-local-host-to-online\/","title":{"rendered":"Migrate WordPress from Local host to online"},"content":{"rendered":"<p>Hi folks in our previous post we have learned about\u00a0 migrating your WordPress blog from WordPress.com to WordPress.org\u00a0 and now we are going to look about how to Migrate WordPress from Local host to online.<\/p>\n<h4>Now let&#8217;s look into the steps which we have to follow to\u00a0Migrate WordPress from Local host to online:<\/h4>\n<p>Step 1:<\/p>\n<p>First you have to export your local WordPress database by using phpMyAdmin .<\/p>\n<p>Go to\u00a0<code>http:\/\/localhost\/phpmyadmin\/<\/code>\u00a0and click on your WordPress database. Then, click &gt;&gt;\u00a0Export\u00a0button from the top menu bar.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1580\" src=\"http:\/\/javawebhosting.co.in\/blog\/wp-content\/uploads\/2018\/03\/wpLTL1.png\" alt=\"\" width=\"539\" height=\"52\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>In the\u00a0Export Method\u00a0option, you can choose \u201cQuick\u201d or \u201cCustom\u201d. Custom will provide you with more options to export your database. We recommend choosing Quick, and then click the\u00a0Go\u00a0button to download your database.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1571\" src=\"http:\/\/javawebhosting.co.in\/blog\/wp-content\/uploads\/2018\/03\/wpLTL2.png\" alt=\"\" width=\"554\" height=\"337\" \/><\/p>\n<p>Step 2:<\/p>\n<p>Connect to your web hosting account using FTP client and upload all files in your public_html directory<\/p>\n<p>After that upload your local WordPress files to your live server.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>step 3:<\/p>\n<p>Meanwhile import your database to the live server.<\/p>\n<p>once you logged into your cPanel dashboard and click on the\u00a0MySQL Databases\u00a0icon which can be found in the databases section.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1583\" src=\"http:\/\/javawebhosting.co.in\/blog\/wp-content\/uploads\/2018\/03\/wpLTL3.png\" alt=\"\" width=\"992\" height=\"193\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Then it will get you to next screen .Here, create a database by entering a name for your database and clicking the\u00a0Create Database\u00a0button.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1573\" src=\"http:\/\/javawebhosting.co.in\/blog\/wp-content\/uploads\/2018\/03\/WPTLT4.png\" alt=\"\" width=\"520\" height=\"127\" \/><\/p>\n<p>After creating your\u00a0database, scroll down to the\u00a0MySQL Users\u00a0section and create or add an existing user to the database.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1574\" src=\"http:\/\/javawebhosting.co.in\/blog\/wp-content\/uploads\/2018\/03\/WPTLT5.png\" alt=\"\" width=\"550\" height=\"574\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>After adding the user, you will get this screen to set MySQL privileges for that user. Provide all privileges to the user by making sure every box is checked, and then click the\u00a0Make Changes\u00a0button.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1575\" src=\"http:\/\/javawebhosting.co.in\/blog\/wp-content\/uploads\/2018\/03\/WPTLT6.png\" alt=\"\" width=\"523\" height=\"361\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p class=\"lang:default decode:true \">Step 4:<\/p>\n<p>Now Import your database<\/p>\n<p>Go to your cPanel dashboard and click &gt;&gt;phpMyAdmin. This will take you to phpMyAdmin where you have to click on the database you created in Step 3. PhpMyAdmin will show your new database with no tables.<\/p>\n<p>Click &gt;&gt; Import\u00a0tab in the top menu. On the import page, click &gt;&gt; Choose File\u00a0button and then select the database file you saved in Step 1.<\/p>\n<p>Finally, press the\u00a0Go\u00a0button at the bottom of the page. PhpMyadmin will now import your WordPress database.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1576\" src=\"http:\/\/javawebhosting.co.in\/blog\/wp-content\/uploads\/2018\/03\/WPTLT7.png\" alt=\"\" width=\"545\" height=\"305\" \/><\/p>\n<p>Step 5:<\/p>\n<p>change the site URL in your database, so that it will connect with your live WordPress site.<\/p>\n<p>In phpMyAdmin, look for the wp_options table in your database that we just imported in step 4. If you\u00a0changed your database prefix, then instead of wp_options it might be {prefix}_options.<\/p>\n<p>Click on the\u00a0Browse\u00a0button next to wp_options or the link that you see in the sidebar to open the page with a list of fields within the wp_options table.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1577\" src=\"http:\/\/javawebhosting.co.in\/blog\/wp-content\/uploads\/2018\/03\/WPTLT8.png\" alt=\"\" width=\"617\" height=\"349\" \/><\/p>\n<p>Under the field\u00a0options_name, you need to look for\u00a0siteurl. Click the Edit Field icon which can be found at the far left at the beginning of the row.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-1578\" src=\"http:\/\/javawebhosting.co.in\/blog\/wp-content\/uploads\/2018\/03\/WPTLT9.png\" alt=\"\" width=\"550\" height=\"123\" \/><\/p>\n<p>When you click the edit field, 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:\u00a0<code>http:\/\/localhost\/test<\/code>. Carefully insert your new site url in this field.<\/p>\n<p>&nbsp;<\/p>\n<p>Next, you need to replicate this step for the option name:\u00a0home. The wp_options page can be a few pages long, so simply find the home tab. Usually it is on the second page which you can navigate to by clicking on the pagination arrows in phpMyAdmin.<\/p>\n<p>Update the\u00a0home\u00a0url to be the same as your\u00a0siteurl.<\/p>\n<p>&nbsp;<\/p>\n<p>Now that we have imported the database, and all of our content should be uploaded, it\u2019s time to configure WordPress. At this time, your site should be showing an\u00a0Error Establishing Database Connection\u00a0error. To fix this, connect to your website using an FTP client and edit\u00a0<code>wp-config.php<\/code>\u00a0file. Provide the database name, user and password you created earlier in Step 3. Save the wp-config.php file and upload it back to your server. Visit your website, and it should be live now.<\/p>\n<p>Next, you need to login to your WordPress admin panel and go to\u00a0Settings &gt;&gt; General. Without changing anything, scroll to the bottom and click the\u00a0Save Changes\u00a0button. This will ensure that the site URL is corrected anywhere else that it needs to be.<\/p>\n<p>After that go to\u00a0Settings&gt;&gt; Permalink\u00a0and click\u00a0Save Changes\u00a0to ensure that all post links are working fine.<\/p>\n<p>&nbsp;<\/p>\n<p>Whenever you are moving a WordPress site from one domain to another, or from local server to a live site, you\u2019ll face broken links and missing images.<\/p>\n<p>You can do it via SQL, here is a simple SQL query that should solve this problem:<\/p>\n<div>\n<pre id=\"highlighter_926201\" class=\"syntaxhighlighter sql\">UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost\/test\/', 'www.example.com\/');<\/pre>\n<\/div>\n<p>Simply go to phpMyAdmin, click on your database and then click on SQL from top menu. Write this query, with your own local site and live site URLs.<\/p>\n<p>Now your site will be live ,hope this helps you all in\u00a0Migrate WordPress from Local host to online .<\/p>\n<p>see you all with another interesting Post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi folks in our previous post we have learned about\u00a0 migrating your WordPress blog from WordPress.com to WordPress.org\u00a0 and now we are going to look about how to Migrate WordPress&#8230; <a class=\"read-more-link\" href=\"https:\/\/mumbaiwebhosting.co.in\/portal\/migrate-wordpress-from-local-host-to-online\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/posts\/189"}],"collection":[{"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/comments?post=189"}],"version-history":[{"count":1,"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/posts\/189\/revisions"}],"predecessor-version":[{"id":190,"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/posts\/189\/revisions\/190"}],"wp:attachment":[{"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/media?parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/categories?post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mumbaiwebhosting.co.in\/portal\/wp-json\/wp\/v2\/tags?post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}