{"id":8913,"date":"2020-01-17T10:17:42","date_gmt":"2020-01-17T10:17:42","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=8913"},"modified":"2020-01-17T10:17:45","modified_gmt":"2020-01-17T10:17:45","slug":"how-to-move-a-live-wordpress-site-to-local-server","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-to-move-a-live-wordpress-site-to-local-server\/","title":{"rendered":"How to Move a Live WordPress Site to Local Server"},"content":{"rendered":"\n<p>Why we are discussing on this topic because we are here to tell you when any developer of WordPress wants to test new themes, plugins, or another development testing.  then he creates a local setup of any WordPress site. so let&#8217;s look below how to do this?<\/p>\n\n\n\n<p>first of all, you have to take a backup of WordPress site and create a database for it in your localhost\/phpmyadmin. Click on New button for creating a new database ( eg. aiaviation ) and put a name for database and click on create button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"240\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/create-a-new-database-1024x240.jpg\" alt=\"\" class=\"wp-image-8914\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/create-a-new-database-1024x240.jpg 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/create-a-new-database-300x70.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/create-a-new-database-768x180.jpg 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/create-a-new-database.jpg 1047w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 2<\/strong>: then take database backup and import in the database and click on Go button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"415\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/import-view-database.jpg\" alt=\"\" class=\"wp-image-8915\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/import-view-database.jpg 709w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/import-view-database-300x176.jpg 300w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/figure>\n\n\n\n<p><strong>Step 3<\/strong>: put the backup file in your xampp location (eg.: <strong>C:\\xampp\\htdocs<\/strong>)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"174\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/xamp-htdocs-location-1024x174.jpg\" alt=\"\" class=\"wp-image-8916\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/xamp-htdocs-location-1024x174.jpg 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/xamp-htdocs-location-300x51.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/xamp-htdocs-location-768x131.jpg 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/xamp-htdocs-location.jpg 1359w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption><strong>file location in xampp<\/strong><\/figcaption><\/figure>\n\n\n\n<p>Step 4: Then go to your backup file location and open <strong>wp-config.php<\/strong> file in editor<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"330\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/wp-config-database-location-setup-1024x330.jpg\" alt=\"\" class=\"wp-image-8917\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/wp-config-database-location-setup-1024x330.jpg 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/wp-config-database-location-setup-300x97.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/wp-config-database-location-setup-768x248.jpg 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/wp-config-database-location-setup.jpg 1095w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption><strong>wp-config.php file<\/strong><\/figcaption><\/figure>\n\n\n\n<p><strong>Step 5<\/strong>: Then change to your <strong>wp-config<\/strong> file  like-  &#8216;DB_NAME&#8217;, &#8216;DB_USER&#8217;, &#8216;DB_PASSWORD&#8217;, &#8216;DB_HOST&#8217; and add below two lines to your <strong>wp-config<\/strong> file<br>define(&#8216;WP_HOME&#8217;,&#8217;http:\/\/aiacademy\/&#8217;);<br>define(&#8216;WP_SITEURL&#8217;,&#8217;http:\/\/aiacademy\/&#8217;);<\/p>\n\n\n\n<p><strong>Step 6<\/strong>: now go to your database and select your options table and change <strong>siteurl  <\/strong>&amp; <strong>home<\/strong> column url <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"245\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/mooju_options-table-changes-1024x245.jpg\" alt=\"\" class=\"wp-image-8924\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/mooju_options-table-changes-1024x245.jpg 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/mooju_options-table-changes-300x72.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/mooju_options-table-changes-768x183.jpg 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/mooju_options-table-changes.jpg 1185w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption><strong>mooju_options table column editing<\/strong><\/figcaption><\/figure>\n\n\n\n<p><strong>Step <\/strong>7: Now you have to edit your virtual host file httpd-vhosts.conf and hosts file. for this, you have to open notepad as administrator.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"370\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/apache-vhosts-file-changes-1024x370.jpg\" alt=\"\" class=\"wp-image-8921\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/apache-vhosts-file-changes-1024x370.jpg 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/apache-vhosts-file-changes-300x108.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/apache-vhosts-file-changes-768x277.jpg 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/apache-vhosts-file-changes.jpg 1083w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>apache vhosts file location<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"318\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/hosts-file-changes-in-c-drive-1024x318.jpg\" alt=\"\" class=\"wp-image-8922\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/hosts-file-changes-in-c-drive-1024x318.jpg 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/hosts-file-changes-in-c-drive-300x93.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/hosts-file-changes-in-c-drive-768x238.jpg 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2020\/01\/hosts-file-changes-in-c-drive.jpg 1131w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>hosts file location<\/figcaption><\/figure>\n\n\n\n<p><strong>Step <\/strong>8:  add this lines to hosts file<br>      127.0.0.1       aiacademy<br>       ::1             aiacademy<br><\/p>\n\n\n\n<p><strong>Step <\/strong>9: after that add below lines to  <strong>httpd-vhosts.conf<\/strong>  and change DocumentRoot, ErrorLog, CustomLog and Directory location with your site name and location.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/cmschandan\/821cc10f3764ddc6217d37ce5c1ab643.js\"><\/script>\n\n\n\n<p>after all above setup your site will be available in localhost and you can make changes. if you find any bug then you check out bugs on <a rel=\"noreferrer noopener\" aria-label=\"stackoverflow (opens in a new tab)\" href=\"https:\/\/stackoverflow.com\/\" target=\"_blank\">stackoverflow<\/a> and <a rel=\"noreferrer noopener\" aria-label=\"wordpress support page (opens in a new tab)\" href=\"https:\/\/en.support.wordpress.com\/\" target=\"_blank\">wordpress support page<\/a> .<\/p>\n\n\n\n<p>Thanks for supporting us and if you have any question then comment us we will give you the best solution to this topic.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why we are discussing on this topic because we are here to tell you when any developer of WordPress wants to test new themes, plugins, or another development testing. then he creates a local setup of any WordPress site. so let&#8217;s look below how to do this? first of all, you have to take a&#8230;<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[5150],"tags":[591,5355,4921,177,1076,399,4759],"class_list":["post-8913","post","type-post","status-publish","format-standard","hentry","category-php","tag-backup","tag-database","tag-localhost","tag-php","tag-plugins","tag-server","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=8913"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8913\/revisions"}],"predecessor-version":[{"id":8925,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8913\/revisions\/8925"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=8913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=8913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=8913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}