Importing site to local machine

What issue or error are you experiencing?

I have tried to restore my backup to LocalWP using 2 methods.

  1. Using the import function
    But it prompted a warning message that it failed to import 7 sql files. I am able to login to admin dashboard.
    → What is causing the failure to import only some sql files?

  2. Import manually - creating new site and then manually replacing the wp-content folder, wp-config, changing the home and site urls.
    There was an error message 'Error establishing database connection".
    → Is it possible to import this way and if yes, what am I doing wrong?

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version:
    local-9.0.5-windows

  • Operating System (OS) and OS version:
    Windows 10 Pro 22H2


Local Logs

Import function
local-lightning-verbose0-importstaging.log (24.8 KB)

Manual import
local-lightning-verbose0-newstaging.log (27.5 KB)


Thank you in advance for your assistance.

Hi @name_hidden

In your original site backup do you have extra DB copies or site backups included?

Is your database abnormally large? Or does it have a specific table with many many rows?

Hi @Nick-B, the DB is small as it is a testing site. Only one backup.

This error could mean some other things are at play for example do you have any security, antivirus or firewall applications that could be blocking Local?

Is this a person machine or one issued by your employer?

Are you running other developer applications simultaneously? That could also cause similar issues. Apps like MAMP, XAMPP, or Docker for example.

Its a personal machine. I dont have any FW and am using the built-in Windows Defender.

No other developer applications installed

Have you tested disabling Windows Defender?

The error is indicating that something is blocking Local. So we’re just trying to rule out any other culprits here.

Yes I have…to no avail.

I see there is a crash in the log. Part of the log pertaining to the crash:

{"class":"Process","level":"warn","message":"2024-08-31T00:12:33.628691Z 0 [System] [MY-010116] [Server] %%userDataPath%%\\lightning-services\\mysql-8.0.16+6\\bin\\win64\\bin\\mysqld.exe (mysqld 8.0.16) starting as process 2332","process":"mysql","thread":"main","timestamp":"2024-08-31T00:12:35.446Z"}
{"class":"Process","level":"warn","message":"2024-08-31T00:12:33.636720Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","process":"mysql","thread":"main","timestamp":"2024-08-31T00:12:35.446Z"}
{"class":"Process","level":"warn","message":"2024-08-31T00:12:34.522099Z 0 [System] [MY-010229] [Server] Starting crash recovery...","process":"mysql","thread":"main","timestamp":"2024-08-31T00:12:35.447Z"}
{"class":"Process","level":"warn","message":"2024-08-31T00:12:34.526024Z 0 [System] [MY-010232] [Server] Crash recovery finished.","process":"mysql","thread":"main","timestamp":"2024-08-31T00:12:35.447Z"}
{"class":"Process","level":"warn","message":"2024-08-31T00:12:35.417523Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","process":"mysql","thread":"main","timestamp":"2024-08-31T00:12:35.447Z"}
{"class":"Process","level":"warn","message":"2024-08-31T00:12:35.446627Z 0 [System] [MY-010931] [Server] %%userDataPath%%\\lightning-services\\mysql-8.0.16+6\\bin\\win64\\bin\\mysqld.exe: ready for connections. Version: '8.0.16'  socket: ''  port: 10011  MySQL Community Server - GPL.","process":"mysql","thread":"main","timestamp":"2024-08-31T00:12:35.448Z"}

Is UTF8MB3 as causing the crash? What should I do/

UTF8MB3 wouldn’t be causing the crash. That is more of just a warning.

If the DB is small you could try and use the DB importer in AdminerEVO to see if that works.

First click Start Site, then Database, Open AdminerEVO, Import, and Choose Files

If you’re not having any trouble creating a new, blank site in Local and running that then it must be something specific about this site/DB that’s creating an issue.

Going back to your original message

But it prompted a warning message that it failed to import 7 sql files

Your DB should just be a single SQL file. Do you have all of the tables broken out? If so you could try and import them one at a time into a new DB. Otherwise you could go back to your original site and use a plugin like WP Migrate Lite which is free, to create a new DB export of a single SQL file.

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