Hello,
I’m new to Local and trying to import a site into Local using a backup from WPbackup in zip format.
Import starts but when the DB is being imported the process aborts and I get this error message.
The error “Uploading .zip file to local Lightning results in a missing local.wp_options table:”
Upon trying to upload a customer's .zip file - we had the same error you are reporting:
Error: Command failed: /Applications/Local.app/Contents/Resources/extraResources/lightning-services/mysql-8.0.16+3/bin/darwin/bin/mysql local -B --disable-column-names -e SELECT option_value FROM wp_options WHERE option_name = 'siteurl';
ERROR 1146 (42S02) at line 1: Table 'local.wp_options' doesn't exist
We worked with a customer who had reported the same error when importing a site into Local Lightning and when I then tried installing it on local 3.2.0 and it appears to have worked.
Testing:
When starting the site from Local 3.2.0 you see the empty database screen to select a language but there is no database tables in the local database (empty) - when I look at the .SQL file (attached) it shows there are tables.
I tried to import the database manually within adminer but it produced an error:
I realized the database is actually present just in the wrong location and explains the initial error
The issue:
The issue is that the site’s database is actually located inside the wrong database somehow. I moved the tables to the local database and the site appears magically.
You will need to move the database from it’s d_baginc_wp database into the local database. You can do that by following these steps:
Solution:
In Local by Flywheel 3.3.0 (Local by Flywheel 3.3.0 download link) you can import that .zip backup by dragging and dropping the file. Then head to the database tab after the site spins up.
Select the Adminer button which should open a browser window that will look like this: https://i.getf.ly/WnuGzddD
Select the Server tab at the top https://i.getf.ly/5zu1W77Q
Then select all tables and move them to the “local database” like this: https://i.getf.ly/Kouqzyey
From there just select move and the site should now load.
Just ran into the exact same issue today using a DB export from cPanel. Was unable to import/fix in Local (Lightning), but installing Local by Flywheel 3.3.0 was able to import/correct following your instructions.