Unable to restore sites from backups

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?

@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.

@timbarber142,

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

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

  5. Click the “Import” button on the Adminer interface to upload an SQL file
    image

  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

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.


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

1 Like

@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
1 Like

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”.

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.

Great!

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.

1 Like

Here’s the screenshot of the local database:

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_.

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 :frowning: It’s just too flaky.

1 Like