Can not import database in Local copy of the Wordpress site.
What steps can be taken to replicate the issue?
This is a fresh Local install (.deb on linux ubuntu 23.04), connected to my employers WP development wp-engine site, downloaded it and everything seems to run fine except the database import. I have multiple lightning-services processes running, amongst which is a mysql process that listens on localhost:10004.
But the import says it canât connect as root@localhost using the default password:
This is the exact error in the Local logs:
10/10/2023, 1:56:48 PM [warn] [main] ImporterWPE: Unable to import site. -- {"stack":"Error: Command failed: %%userDataPath%%/lightning-services/mysql-8.0.16+6/bin/linux/bin/mysql --default-character-set=utf8 -A --skip-column-names -e SELECT @@SQL_MODE;\nERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)\n\n at ChildProcess.exithandler (node:child_process:430:12)\n at ChildProcess.emit (node:events:513:28)\n at maybeClose (node:internal/child_process:1091:16)\n at Socket.<anonymous> (node:internal/child_process:449:11)\n at Socket.emit (node:events:513:28)\n at Pipe.<anonymous> (node:net:322:12)"}
Connecting to the socket works like a charm? So why canât Local connect and import the database?
Are you able to download a backup of your WPE site? That will give you a zip file including the Database. You could also use a free plugin like WP Migrate Lite to grab a site backup as well.
I can access the admin pages of the site, but âexportâ would result in a .wxr (xml base) file, it says? 'm not sure whether I can install plugins though?
On your WP Engine dashboard you would be creating and downloading a backup of the hosted site with the instructions on the link above, not trying to export from within the WordPress dashboard.
Yes, managed to do that now.
I have the DB backup, but I assume I need to load it into a database called âlocalâ? This doesnât exist (probably due to the failure) so should I create an empty DB local?
It shouldnât matter too much but you could use a command like wp db reset --yes before importing the new DB just to make sure itâs a clean install. After that you could jump to the last few steps here.
Sorry looking back I see that you mentioned the database doesnât exist at all or failed?
I assume I need to load it into a database called âlocalâ? This doesnât exist (probably due to the failure) so should I create an empty DB local?
What might be easier is just spinning up a new, blank site in Local which is what I was inferring when I mentioned the steps to manually import a site. That way youâll spin up a base install and then manually replace its files and DB with your WP-Content and SQL database.
There is no command âwpâ and Open site shell doesnât work (for me, Iâm on KDE. Maybe you hard-coded the required shell application?)
When you click on Open Site Shell what happens? Do you get an error or does it just not open at all?
If you go to Preferences>Advanced>Appearance & Behavior you can see what your default Terminal application is set to.
Ok, this is embarassing. I redid the whole pull, and this time everything seems ok, even the database pull and restore (btw Open Site shell still doesnât work, nothing happens when I click the option and I canât find any reference to terminal in preferences).
Thank you very much for your timely responses and patient support!
Letâs see now whether I can tame this beast from here
And now all my problems are solved. Please keep track of this somewhere in your knowledge base (I mentioned KDE/Plasma!) and please consider using the platform indepent /usr/bin/x-terminal-emulator