{"id":113,"date":"2019-12-12T19:44:17","date_gmt":"2019-12-12T19:44:17","guid":{"rendered":"http:\/\/localbyflywheel.com\/?post_type=help&#038;p=113"},"modified":"2023-09-29T16:49:40","modified_gmt":"2023-09-29T16:49:40","slug":"how-to-import-a-wordpress-site-into-local","status":"publish","type":"help","link":"https:\/\/localwp.com\/help-docs\/getting-started\/how-to-import-a-wordpress-site-into-local\/","title":{"rendered":"Import\/Export a WordPress Site"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This help document will walk you through how to import and export a site to and from Local. It will also go over how to<strong> <\/strong>restore from only Local site files.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group help-doc-toc\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"wp-block-paragraph\">Table of Contents:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/localwp.com\/help-docs\/getting-started\/how-to-import-a-wordpress-site-into-local\/#import-a-site\">Import a site using a zip<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/localwp.com\/help-docs\/getting-started\/how-to-import-a-wordpress-site-into-local\/#Manually-Import-a-Local-site\">Manually Import a Site<\/a><\/li>\n\n\n\n<li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/localwp.com\/help-docs\/getting-started\/how-to-import-a-wordpress-site-into-local\/#restore-local-site-from-site-files\">Restore a site from Local site files<\/a><\/li>\n\n\n\n<li><a class=\"wp-block-table-of-contents__entry\" href=\"https:\/\/localwp.com\/help-docs\/getting-started\/how-to-import-a-wordpress-site-into-local\/#export-a-site\">Export a site<\/a><\/li>\n<\/ol>\n<\/div><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading has-text-color\" id=\"import-a-site\" style=\"color:#000000\"><strong>Import a site using a zip<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Local is pretty flexible about being able to import a WordPress site from a&nbsp;<code>zip<\/code>&nbsp;archive.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are two required things that Local needs for the import to be successful:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The&nbsp;<code>wp-content<\/code>&nbsp;folder (containing plugins, themes, and uploads)<\/li>\n\n\n\n<li>A database dump as a&nbsp;<code>sql<\/code>&nbsp;file<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">There are a few ways to get a zip backup of your site:&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><span style=\"text-decoration: underline;\"><a rel=\"noreferrer noopener\" href=\"https:\/\/getflywheel.com\/wordpress-support\/backups-on-flywheel\/?__hstc=125759381.7ab6e440ff1cda41d105d751d274cee8.1663356669224.1667315914461.1667320936223.45&amp;__hssc=125759381.2.1667320936223&amp;__hsfp=585944452#download-a-backup\" target=\"_blank\">Flywheel: Download a Backup<\/a>&nbsp;<\/span><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/wpengine.com\/support\/restore\/#Download_a_Backup\"><strong><span style=\"text-decoration: underline;\">WP Engine: <\/span><\/strong><\/a><a rel=\"noreferrer noopener\" href=\"https:\/\/wpengine.com\/support\/restore\/#Download_a_Backup\" target=\"_blank\"><strong><span style=\"text-decoration: underline;\">Download<\/span><\/strong><\/a><a href=\"https:\/\/wpengine.com\/support\/restore\/#Download_a_Backup\"><strong><span style=\"text-decoration: underline;\"> a Backup<\/span><\/strong><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Or backup from a different host using a tool like <strong><span style=\"text-decoration: underline;\"><a rel=\"noreferrer noopener\" href=\"https:\/\/deliciousbrains.com\/wp-migrate-db-pro\/\" target=\"_blank\">WP Migrate<\/a><\/span><\/strong>. Here is a <a rel=\"noreferrer noopener\" href=\"https:\/\/deliciousbrains.com\/wp-migrate-db-pro\/doc\/importing-wordpress-local-development-environment\/\" data-type=\"URL\" data-id=\"https:\/\/deliciousbrains.com\/wp-migrate-db-pro\/doc\/importing-wordpress-local-development-environment\/\" target=\"_blank\"><strong><span style=\"text-decoration: underline;\">help doc<\/span><\/strong><\/a> to walk you through the steps of using the free version of<a rel=\"noreferrer noopener\" href=\"https:\/\/wordpress.org\/plugins\/wp-migrate-db\/\" data-type=\"URL\" data-id=\"https:\/\/wordpress.org\/plugins\/wp-migrate-db\/\" target=\"_blank\"> <strong><span style=\"text-decoration: underline;\">WP Migrate Lite<\/span><\/strong><\/a>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have your backup, your zip archive will probably look something like this:&nbsp;&nbsp;<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/getflywheel.com\/wp-content\/uploads\/2018\/08\/local-site-import-minimal-zip-file-1024x452.png\" alt=\"\" class=\"wp-image-28815\"\/><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div id=\"help-step-block_5997d15fdea7f58d8621ce2d14490943\" class=\"help-note-container help-type-note\">\n\t<div class=\"help-icon\">\n\t\t<svg viewBox=\"0 0 512 512\" fill=\"currentColor\"><path fill=\"currentColor\" d=\"M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-464a208 208 0 1 0 0 416 208 208 0 1 0 0-416zm70.7 121.9c7.8-10.7 22.8-13.1 33.5-5.3 10.7 7.8 13.1 22.8 5.3 33.5L243.4 366.1c-4.1 5.7-10.5 9.3-17.5 9.8-7 .5-13.9-2-18.8-6.9l-55.9-55.9c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l36 36 105.6-145.2z\"><\/path><\/svg>\t<\/div>\n    <div class=\"help-text\">\n\t\t<p>Note that in this case, the database dump is next to a files folder, which contains the <code>wp-content<\/code> folder.<\/p>\n\t<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">All you need to do is import this&nbsp;<code>zip<\/code>&nbsp;file by dragging and dropping it over Local or selecting \u201cImport\u201d from Local\u2019s menu.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Local will ask you a few questions about the site, such as the Site Domain as well as the folder you want to use to hold the site. Depending on the size of the archive, the import can take a few seconds for smaller sites, or much longer if the&nbsp;<code>zip<\/code>&nbsp;file is quite large.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/getflywheel.com\/wp-content\/uploads\/2018\/08\/local-site-import-local-options-1024x702.png\" alt=\"Options screen when importing a site into Local.\" class=\"wp-image-28816\"\/><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading has-text-color\" id=\"Manually-Import-a-Local-site\" style=\"color:#000000\"><strong>Manually Import a Local site<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re getting errors when importing a zip file, you could attempt a manual import using these steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Unzip the file in a common location, like the desktop.<\/li>\n\n\n\n<li>Create a new, blank site in Local. Use whatever username\/password you like since you\u2019ll be overwriting the Database.<\/li>\n\n\n\n<li>The <code>wp-content<\/code> folder that is created with the new blank site you can rename <code>wp-content-old<\/code> or just delete it. Copy the <code>wp-content<\/code> folder from your backup to the newly created site\u2019s location to take its place.<\/li>\n\n\n\n<li>Copy the correct SQL file to the site root (App&gt;Public).<\/li>\n\n\n\n<li>Within Local, click <code>Open Site Shell<\/code><\/li>\n\n\n\n<li>Import your Database with <code>wp db import your-database-filename.sql<\/code><\/li>\n\n\n\n<li>If that works, now Search and replace the domains. This might require more than one S\/R, for example: \n<ul class=\"wp-block-list\">\n<li><code>wp search-replace production.com mysite.local<\/code><\/li>\n\n\n\n<li><code>wp search-replace https:\/\/mysite.local http:\/\/mysite.local<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<div style=\"color:#ddd\" class=\"wp-block-genesis-blocks-gb-spacer gb-block-spacer gb-divider-solid gb-divider-size-1\"><hr style=\"height:30px\"\/><\/div>\n\n\n\n<h2 class=\"wp-block-heading has-text-color\" id=\"restore-local-site-from-site-files\" style=\"color:#000000\"><strong>Restore from only Local site files<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are some cases where you might need to re-import a site into Local using only the files contained within the site folder. Power failure or breaking changes caused by a system update can force you to restore a backup of your Local WordPress sites.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you can get the Local site folder from a system restore point or a time-machine backup and it has both the WordPress files as well as the&nbsp;<code>sql<\/code>&nbsp;files, then you have everything you need to re-import the site!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To give some context, you would want to&nbsp;<code>zip<\/code>&nbsp;the whole site folder, including the&nbsp;<code>app<\/code>&nbsp;and&nbsp;<code>logs<\/code>&nbsp;folders. Using the following screenshots as an example, you would zip up the&nbsp;<code>wordpress-import<\/code>&nbsp;folder, and then use the&nbsp;<code>wordpress-import.zip<\/code>&nbsp;file to import into Local by dragging and dropping the archive over Local.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/getflywheel.com\/wp-content\/uploads\/2018\/08\/local-site-import-app-folder-1024x454.png\" alt=\"Local site App folder\" class=\"wp-image-28817\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/getflywheel.com\/wp-content\/uploads\/2018\/08\/local-site-import-sql-folder-1024x454.png\" alt=\"Local site sql folder\" class=\"wp-image-28818\"\/><\/figure>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading has-text-color\" id=\"export-a-site\" style=\"color:#000000\"><strong>Export a site<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start by opening \u201cLocal\u201d and ensure that the site you want to export is running. Next, right-click on the site and select \u201cExport.\u201d Follow the prompts to save the website in a place that you can find it like the Desktop!<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<div class=\"wp-block-image is-style-drop-shadow\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/localwp.com\/wp-content\/uploads\/2020\/07\/migrating-local-by-flywheel-to-local-export-from-lbf.gif\" alt=\"\"\/><\/figure>\n<\/div>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>zip<\/code>&nbsp;file that is created contains everything you need for the site, including Media, Plugins, Themes, and an export of the database! The export is the entire \/wp-content folder and the database.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-fe48e5de wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/community.localwp.com\/c\/support\/5\" target=\"_blank\" rel=\"noreferrer noopener\">Get Community Support<\/a><\/div>\n<\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This help document will walk you through how to import and export a site to and from Local. It will also go over how to restore from only Local site files. Table of Contents: Import a site using a zip Local is pretty flexible about being able to import a WordPress site from a&nbsp;zip&nbsp;archive. There&#8230;<\/p>\n","protected":false},"author":49,"parent":346,"menu_order":4,"template":"","tags":[40],"helpcategories":[2],"class_list":["post-113","help","type-help","status-publish","hentry","tag-getting-started","helpcategories-general"],"acf":{"help_keywords":""},"_links":{"self":[{"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/help-doc\/113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/help-doc"}],"about":[{"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/types\/help"}],"author":[{"embeddable":true,"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/users\/49"}],"version-history":[{"count":0,"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/help-doc\/113\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/help-doc\/346"}],"wp:attachment":[{"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/media?parent=113"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/tags?post=113"},{"taxonomy":"helpcategories","embeddable":true,"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/helpcategories?post=113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}