# Unable to restore sites from backups

**URL:** <https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180>\
**Category:** Support\
**Created:** [April 18, 2018, 9:35pm UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180 "2018-04-18T21:35:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![timbarber142](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/timbarber142/32/5151_2.png) [@timbarber142](https://community.localwp.com/u/timbarber142)\
**Post date:** [April 18, 2018, 9:35pm UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180/1 "2018-04-18T21:35:37Z")

</div>

I have been attempting to follow Clay’s advice from a different thread.  
I was having problems with Local, so I deleted it with AppCleaner and re-downloaded - but lost all my sites.  
I renamed every folder with a “-backup” extension, created new sites in Local, deleted those folders, and then removed the “-backup”. Then I went into a site I was trying to restore and did Right Click \> Open Site SSH

When that loads in the Terminal, I type

`myloader -p root -d /app/sql --overwrite-tables --database local`

But now that I’m in the process of trying to restore the SQL files through SSH, I keep getting things like this:

```
Last login: Tue Apr 17 17:02:02 on ttys000
/Users/admin/Library/Application\ Support/Local\ by\ Flywheel/ssh-entry/HkBv2gV2f.sh ; exit;
TimsMacBook:~ admin$ /Users/admin/Library/Application\ Support/Local\ by\ Flywheel/ssh-entry/HkBv2gV2f.sh ; exit;
root@590edc188e41:/# myloader -p root -d /app/sql --overwrite-tables --database local

**(myloader:488): CRITICAL**: the specified directory is not a mydumper backup

root@590edc188e41:/# 

```

And on other sites, it will run the command and give no other output at all.

Thoughts?

---

<div class="post-metadata">

**Author:** ![timbarber142](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/timbarber142/32/5151_2.png) [@timbarber142](https://community.localwp.com/u/timbarber142)\
**Post date:** [April 19, 2018, 4:27pm UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180/2 "2018-04-19T16:27:14Z")

</div>

@clay do you have any insights for me on this?  
I feel like I’m just one small insight away from being able to fix this.

---

<div class="post-metadata">

**Author:** ![clay](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/clay/32/8248_2.png) [@clay](https://community.localwp.com/u/clay)\
**Post date:** [April 19, 2018, 4:51pm UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180/3 "2018-04-19T16:51:41Z")

</div>

@timbarber142,

Can you provide screenshots of the contents of each site’s `app/sql` folder?

---

<div class="post-metadata">

**Author:** ![atempel](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/atempel/32/4826_2.png) [@atempel](https://community.localwp.com/u/atempel)\
**Post date:** [April 19, 2018, 5:13pm UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180/4 "2018-04-19T17:13:43Z")

</div>

Just to be sure, you are trying to apply on local, backups that you made from an old installation right?  
If thats the case, try one thing:

You seem to have the **SQL dumps** from the old sites and its **files** … I hope so haha

1. Create a new website in local from scratch, using the name of the backed up site.

2. Backup the files from `/app/public` into a new folder, let’s say `/app/public/old_backup`, you might need them later (maybe wp-config, to get database connection info, or .htaccess).

3. Place your files from the backup into the `/app/public` folder.

4. Log into Adminer from the “Database” tab on Local to access the database created for the new website  
 ![image](https://sea1.discourse-cdn.com/flex019/images/transparent.png)

5. Click the “Import” button on the Adminer interface to upload an SQL file  
 ![image](https://sea1.discourse-cdn.com/flex019/images/transparent.png)

6. From there you select the .sql file from your old dump, and ask it to execute.  

Checks to make:

- Make sure your **wp-config.php** file matches the database given by local to the new website you created and the `$table_prefix` you used.
- Your domain must match the domain you used to have on local, in the backed up site. If not, you can change the domain on local in the “Site Setup” tab or replace it from the own database.

The process you were using, didn’t work because local seems to have some files that connect with the application to make it work properly, and since you deleted the whole folder (including conf, and app folders) it won’t work because the VM won’t recognize the files.  
That process I gave to you is the process I use to install websites from outside Local into it to be able to work from Local’s environment. Think about Local as a normal hosting, that you must do those steps to set up a website.

Forgive me if I didn’t understand your question properly, but I hope to have shed some light into your problem haha

---

<div class="post-metadata">

**Author:** ![timbarber142](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/timbarber142/32/5151_2.png) [@timbarber142](https://community.localwp.com/u/timbarber142)\
**Post date:** [April 19, 2018, 7:59pm UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180/5 "2018-04-19T19:59:01Z")

</div>

atempel, thank you very much for the detailed response! It really shows you care.  
I wasn’t clear enough, it seems - these were Local sites that existed before. Then I was having technical issues with Local, so I uninstalled it completely and reinstalled.

 ![22](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/2X/c/c8357403d3250f56710287f7ef5953ef70672cd0.png)  
 ![04](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/2X/4/44f83432506fe3eb0b4bfe5f746eb543df7e73eb.png) ![57](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/2X/6/699a54cb9a02b4db8c2fd60b0e536344335070c8.png) ![07](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/2X/f/f4afa79696c1f2177d7cf31dfae6f26ee3c5eb2c.png)

There’s 4 screenshots of the complete contents of one of the folders.

---

<div class="post-metadata">

**Author:** ![clay](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/clay/32/8248_2.png) [@clay](https://community.localwp.com/u/clay)\
**Post date:** [April 19, 2018, 8:19pm UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180/6 "2018-04-19T20:19:06Z")

</div>

@timbarber142,

Great! The SQL files look good. I think `myloader` is getting hung up due to the backup being created with one version and trying to import with another.

Luckily, the solution should be fairly easy. Here’s what you can do:

1. Right-click on the site in the sidebar and go to “Open Site SSH”
2. Run `cat /app/sql/*.sql > /app/full.sql`
3. Run `mysql -u root -proot -e "DROP DATABASE local; CREATE DATABASE local;"` **(Warning to other readers, this is a destructive query and will remove the entire database for the selected site.)**
4. Run `mysql -u root -proot local < /app/full.sql`
5. Check the site

---

<div class="post-metadata">

**Author:** ![timbarber142](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/timbarber142/32/5151_2.png) [@timbarber142](https://community.localwp.com/u/timbarber142)\
**Post date:** [April 19, 2018, 8:39pm UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180/7 "2018-04-19T20:39:51Z")

</div>

Now I’m getting this:

```
Last login: Thu Apr 19 14:32:25 on ttys001
TimsMacBook:~ admin$ /Users/admin/Library/Application\ Support/Local\ by\ Flywheel/ssh-entry/SkT58d83M.sh ; exit;
root@facd8a5a3d28:/# cat /app/sql/*.sql > /app/full.sql
root@facd8a5a3d28:/# mysql -u root -proot -e "DROP DATABASE local; CREATE DATABASE local;"
Warning: Using a password on the command line interface can be insecure.
root@facd8a5a3d28:/# mysql -u root -proot local < /app/full.sql
Warning: Using a password on the command line interface can be insecure.
root@facd8a5a3d28:/# 

```

What is up with that warning about the command line?

I can confirm that it made a full.sql file in the app directory that is 1.4MB; however now I’m getting a “Error establishing database connection”.

---

<div class="post-metadata">

**Author:** ![clay](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/clay/32/8248_2.png) [@clay](https://community.localwp.com/u/clay)\
**Post date:** [April 19, 2018, 9:05pm UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180/8 "2018-04-19T21:05:20Z")

</div>

> [@timbarber142](#):
>
> What is up with that warning about the command line?

The warning is triggered by using the `-p` parameter which exposes the password (`root` in this case) in plain sight. Fortunately, it’s not an issue in this case since every Local site uses `root`/`root` as the MySQL username/password.

> [@timbarber142](#):
>
> I can confirm that it made a full.sql file in the app directory that is 1.4MB;

Great!

> [@timbarber142](#):
>
> however now I’m getting a “Error establishing database connection”.

Can you try opening Adminer (see step #4 from @atempel’s post above) and then provide a screenshot? The main thing I’d like to see there is that all of the tables imported and what the prefix is.

The prefix will be something like `wp_` and it should match the `$table_prefix` value in the site’s `wp-config.php` file which can be found in the site’s `app/public` folder. @atempel mentioned that above too.

---

<div class="post-metadata">

**Author:** ![timbarber142](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/timbarber142/32/5151_2.png) [@timbarber142](https://community.localwp.com/u/timbarber142)\
**Post date:** [April 19, 2018, 9:08pm UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180/9 "2018-04-19T21:08:37Z")

</div>

Here’s the screenshot of the local database:

 ![06](https://us1.discourse-cdn.com/flex019/uploads/lwpforums/original/2X/2/276468b0fc7caa510454a0882237535e512767d2.png)

---

<div class="post-metadata">

**Author:** ![clay](https://sea1.discourse-cdn.com/flex019/user_avatar/community.localwp.com/clay/32/8248_2.png) [@clay](https://community.localwp.com/u/clay)\
**Post date:** [April 19, 2018, 9:50pm UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180/10 "2018-04-19T21:50:13Z")

</div>

Thanks! That looks good.

At this point, just check and make sure that the table prefix in the site’s `app/public/wp-config.php` folder is set to `wp_`.

---

<div class="post-metadata">

**Author:** ![razorpig](https://avatars.discourse-cdn.com/v4/letter/r/e274bd/32.png) [@razorpig](https://community.localwp.com/u/razorpig)\
**Post date:** [September 4, 2018, 7:40am UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180/11 "2018-09-04T07:40:12Z")

</div>

Hi,

I’m just wondering if this issue was ever resolved. I’m having exactly the same problem. I’ve lost so many sites and so many hours of work because of FlyWheel I’m very close to giving up. Such a shame as it’s so close to being just about the best piece of software I’ve ever used. Can’t help feeling like a beta tester though ☹ It’s just too flaky.

---

<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 25, 2020, 6:34pm UTC](https://community.localwp.com/t/unable-to-restore-sites-from-backups/6180/12 "2020-08-25T18:34:22Z")

</div>


