How to resolve the issue with a huge DB to pull / import

What issue or error are you experiencing?

I’m trying to import a Flywheel backup zip. It’s not working because the SQL file is 400mb. This happened before with the same website, but then just by failing to pull the website via Local.


System Details

  • **Local Version: Version 9.0.3+6684 **

  • Operating System (OS) and OS version: OSX Sonoma 14.1


Local Logs

Error > {“level”:“warn”,“message”:“Unable to import site.”,“stack”:"Error: Local was unable to import the following SQL files: \n\n• /app/sql/backup.sql\n


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @duetcolin

The overall size of the DB shouldn’t really be an issue as I wouldn’t consider that to be on the large side quite yet. Unless it has some specific tables or rows with an issue.

As a workaround you could unzip the backup and then use our manual steps here to get it imported:

Manually Import a Local Site

I’m having a similar issue with importing my website. I have a 0,98 GB sql file to import, and it is in “Importing Database: local.sql…” status from 10 hours.

Yesterday I tried to quit WP-Local program, erase all data on sql to import the file from localhost web interface, but it seems to take too long.

Is there a way to import a large database in few minutes or few hours with no errors? Thanks.

Andrea

Hi @Kappo

So by “localhost web interface” are you talking about directly importing it in AdminerEVO?

Did you try using the steps here to do a manual import by placing the DB in your site files and importing via Site Shell?

Manually Import a Local Site

Hi @Nick-B

Yes, I’m talking about AdminerEVO.

I tried just now to do a manual import, but when I send command “wp db import local.sql” from the “app>public” folder with WP-Local Site Shell I receive error “Error: Failed to get current SQL modes. Reason: ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)”

Any suggestion?

This is indicating there could be a conflict with the connection. You could try doing a reboot as the most simple step to see if that fixes it.

Some other things to try:

See if changing your Router Mode has any impact, or check to see if there are any programs that could be conflicting. What is Router Mode? - Local

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

Do you have any antivirus, security, or firewall applications that could be blocking Local?

After about 24 hours it has been finished.
So there was no problem, it was just slow because of large dimension of database.

Thanks for the support.

I’m glad that it finally finished @Kappo although for a database that’s only 1 GB it still shouldn’t take that long. I direct imported a 40GB site with a 2.5GB database into my Local app last weekend and it didn’t take very long at all.

Within the database is there any bloat like a specific table with lots of rows? Something like that contributing to the size?

Yes @Nick-B
The database has some tables with more than 1 million rows.

For example the wp_posts table or some that refers to the logs

Ah okay well that could certainly do it