# Can't "import" site after deleting it (BUT leaving the files there)

**URL:** <https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841>\
**Category:** Support\
**Created:** [August 12, 2022, 12:54pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841 "2022-08-12T12:54:08Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![rangerdth](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rangerdth](https://community.localwp.com/u/rangerdth)\
**Post date:** [August 12, 2022, 12:54pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/1 "2022-08-12T12:54:08Z")

</div>

### Issue Summary

Can’t ‘import’ (revive, restore, whatever word you want) a Local Site, even though all the files exist.

#### Troubleshooting Questions

I have tried creating a zip file of the entire directory, and the usual steps, however each time I drag the file onto the Local window, I get a popup that says Local doesn’t know what to do with the file.

- Does this happen for all sites in Local, or just one in particular?  
ALL SITES

- Are you able to create a new, plain WordPress site in Local and access it in a Browser?  
Yes

#### Replication

Open Local (ver 6.4.2+6012).  
Select a Local site.  
Right Click Site Name, select Delete, Uncheck “Move site files to Trash”, Click Delete Site.  
Even though all the files were left in place, there is seemingly no way to ‘restore’ the site.

#### System Details

- Which version of Local is being used?  
ver 6.4.2+6012

- What Operating System (OS) and OS version is being used?  
Mac Monterey v 12.5

\*\* If you try to create a ‘new’ site with the same name, Local gives an error that there’s already a local site there. You’d think the software could just re-import it.

---

<div class="post-metadata">

**Author:** ![sambrockway](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/sambrockway/32/18726_2.png) [@sambrockway](https://community.localwp.com/u/sambrockway)\
**Post date:** [August 15, 2022, 11:00am UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/2 "2022-08-15T11:00:03Z")

</div>

Hi @rangerdth - welcome to the Local community! 👋

Thank you for your question.

Can you explain a little more about how you’re _creating a zip file of the entire directory_?

I’m not quite sure I understand why you are deleting and keeping the files there.

Also, can you explain the context of what you are trying to do just a little more so I can help provide some guidance and steps?

Thank you!

Sam

---

<div class="post-metadata">

**Author:** ![rangerdth](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rangerdth](https://community.localwp.com/u/rangerdth)\
**Post date:** [August 15, 2022, 12:42pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/3 "2022-08-15T12:42:04Z")

</div>

I followed some of the posts on the site about importing a zip file.

The real problem is this: I had some clients who wanted development done, so I started building a site. Then they decided not to move forward. So, I deleted the site from Local, but left the files on my hard drive (as they existed). Now the clients are back, and I would like to import the site that I had been building.

I figured this should be easy since all the data is still there (and hasn’t changed), but apparently it’s not.

I can’t create a new site with the same name, as Local says the file exists already. However, I can’t even “import” the old site as Local apparently doesn’t recognize it.

---

<div class="post-metadata">

**Author:** ![sambrockway](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/sambrockway/32/18726_2.png) [@sambrockway](https://community.localwp.com/u/sambrockway)\
**Post date:** [August 15, 2022, 2:39pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/4 "2022-08-15T14:39:57Z")

</div>

Hi @rangerdth - thanks for explaining that.

If you look inside of the following places, does the site show up?

`Local sites`

![Shared with CloudApp](https://p-DgFRdw9.t2.n0.cdn.getcloudapp.com/items/X6uRXjW9/e8075d90-1c17-4392-8c6c-67a204798ae9.jpg?source=social&v=7b4f97199c56e4a88462728a3dac14a3)

`sites.json`

**location:** /Library/Application Support/Local/sites.json

Let me know, and let’s see if we can find it!

Sam

---

<div class="post-metadata">

**Author:** ![rangerdth](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rangerdth](https://community.localwp.com/u/rangerdth)\
**Post date:** [August 15, 2022, 2:53pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/5 "2022-08-15T14:53:25Z")

</div>

Yes, they are all there. That’s why I’m confused by not just being able to import/reactivate, etc.

---

<div class="post-metadata">

**Author:** ![sambrockway](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/sambrockway/32/18726_2.png) [@sambrockway](https://community.localwp.com/u/sambrockway)\
**Post date:** [August 15, 2022, 3:15pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/6 "2022-08-15T15:15:20Z")

</div>

Hi @rangerdth -

Okay, good to know, thank you.

If you open up the file for the site you’re looking to work on, what is inside of the `app > sql` file?

It should look like this - I wonder if for some reason the `sql` file is missing.

![Shared with CloudApp](https://p-DgFRdw9.t2.n0.cdn.getcloudapp.com/items/qGuO904b/b8d87b53-301d-488a-92b6-8001335eb40f.jpg?source=social&v=29a450cc1ecac23fed096ebeffa9feac)

Let me know if that’s there!

Sam 👩🏼‍💻

---

<div class="post-metadata">

**Author:** ![rangerdth](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rangerdth](https://community.localwp.com/u/rangerdth)\
**Post date:** [August 15, 2022, 4:04pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/7 "2022-08-15T16:04:12Z")

</div>

This is what I have. It’s quite different.

 ![Screen Shot 2022-08-15 at 12.01.53 PM.jpg](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/3/4/34670bd8ab53a9510e0240add4a2893ece572188.jpeg)

---

<div class="post-metadata">

**Author:** ![rangerdth](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rangerdth](https://community.localwp.com/u/rangerdth)\
**Post date:** [August 22, 2022, 4:03pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/8 "2022-08-22T16:03:13Z")

</div>

Do you have any input?

---

<div class="post-metadata">

**Author:** ![sambrockway](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/sambrockway/32/18726_2.png) [@sambrockway](https://community.localwp.com/u/sambrockway)\
**Post date:** [August 22, 2022, 4:52pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/9 "2022-08-22T16:52:53Z")

</div>

Hi @rangerdth - hmm, that’s interesting. Thank you for sharing that context.

Have you tried this method?

> [@How can I restore a site from a Local site folder?](http://community.localwp.com/t/how-can-i-restore-a-site-from-a-local-site-folder/1791):
>
> Note: Local has come a long way since this was first posted and mostly just works for importing sites. Have a look at our help doc for more current information: [https://getflywheel.com/wordpress-support/how-to-import-a-wordpress-site-into-local/](https://getflywheel.com/wordpress-support/how-to-import-a-wordpress-site-into-local/) You probably want the above link, but the below information is being kept for history: In case you are seeing a “Container Missing” error or are just needing to restore a Local site from an existing Local site folder, here’s how: Note: There must be …

I would recommend making a backup of the folder just in case before trying this,

Sam

---

<div class="post-metadata">

**Author:** ![rangerdth](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rangerdth](https://community.localwp.com/u/rangerdth)\
**Post date:** [August 22, 2022, 5:09pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/10 "2022-08-22T17:09:12Z")

</div>

Yes, that is the first method I tried.  
I get this error:  
 ![Screen Shot 2022-08-22 at 1.07.14 PM](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/3X/f/5/f50f325956b2171d96a5eee7ee803477c634c0c7.png)

---

<div class="post-metadata">

**Author:** ![rangerdth](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rangerdth](https://community.localwp.com/u/rangerdth)\
**Post date:** [August 22, 2022, 5:21pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/11 "2022-08-22T17:21:47Z")

</div>

- FIXED -

The issue is a database change in the older sites that I have been trying to import.

1. Create a new site in Local - called whatever you’d like.
2. Once the site is created, “Stop” it.
3. Navigate to the new site folder and delete the “app” folder.
4. Navigate to the old site folder and COPY the app folder to the new site folder (and make sure you keep the “app” folder name).
5. Start the site.
6. Click the “WP Admin” button, which opens the admin page, which will require a ‘database upgrade’.
7. Do the upgrade and you’ll get the site back.
8. Check to make sure your previous ‘theme’ is active and not a generic theme.

---

<div class="post-metadata">

**Author:** ![rangerdth](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rangerdth](https://community.localwp.com/u/rangerdth)\
**Post date:** [August 22, 2022, 5:23pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/12 "2022-08-22T17:23:49Z")

</div>

\*\*\* NOTE \*\*\*

I seem to be missing the database content (posts, comments, etc) as of now.  
But at least I can see the site and theme, etc.

---

<div class="post-metadata">

**Author:** ![sambrockway](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/sambrockway/32/18726_2.png) [@sambrockway](https://community.localwp.com/u/sambrockway)\
**Post date:** [August 23, 2022, 10:33am UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/13 "2022-08-23T10:33:32Z")

</div>

Hi @rangerdth 👋 -

So glad you were able to solve this (although a bummer about the posts, comments, etc) - I presume that is living in a `sql` file somewhere - do you want to keep looking for that together?

Thank you for sharing what worked for you!

Sam

---

<div class="post-metadata">

**Author:** ![rangerdth](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rangerdth](https://community.localwp.com/u/rangerdth)\
**Post date:** [August 24, 2022, 12:49pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/14 "2022-08-24T12:49:36Z")

</div>

I have finally restored the whole site.

The sql directory holds a “pair” of each file:

- local.wp\_comments-schema.sql
- local.wp\_comments.sql  
The “schema” file is the actual table schema. The non-schema file is the data.  
One issue that you have to correct by hand is that the default datetime that’s used in the files (0000-00-00 00:00:00) is not allowed by mysql. The minimum datetime is ‘1000-01-01 00:00:00’ - so you have to find/replace that in each file before you can continue.

You can then remove all the tables from the “new site” database file, but keep the database.

You can then restore all the ‘shcema’ files, which will create the tables.

You can then import all the non-schema sql files which contains the data.

When you log in to the admin panel, you’ll likely get a notice about upgrading the database (as I did, because of the changes from WP5 to WP6). The upgrade ran without issue and the site is back.

---

<div class="post-metadata">

**Author:** ![rangerdth](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rangerdth](https://community.localwp.com/u/rangerdth)\
**Post date:** [August 24, 2022, 12:52pm UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/15 "2022-08-24T12:52:16Z")

</div>

One thing to note: there may be schema/data for plugins. So be sure to address those as needed.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/system/32/1_2.png) [@system](https://community.localwp.com/u/system)\
**Post date:** [August 26, 2022, 12:52am UTC](https://community.localwp.com/t/cant-import-site-after-deleting-it-but-leaving-the-files-there/32841/16 "2022-08-26T00:52:38Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
