Local was unable to import the following SQL files

I have a WP site that is currently on XAMPP. I’d like to transfer it to Local. Which backup plugins can I use to successfully upload the site/database into a new Local WP site?

I saw an Elementor tutorial that used BackWPup for demonstration purposes. I tried that but it did not work. It failed for unknown reasons when trying to upload the database:

Uh-oh! Unable to import site.
Error: Local was unable to import the following SQL files:
sql file name

In the log file:

ERROR 1064 (42000) at line 23987: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 4\n at h. (%%appPath%%\main\importer\Importer.js:1:8277)\n at Generator.next ()\n at a (%%appPath%%\main\importer\Importer.js:1:124)\n at processTicksAndRejections (internal/process/task_queues.js:85:5)",“level”:“error”

I have no idea what caused it and I am extremely hesitant to run the backup again as it took almost 7 hours!

So I am looking for another backup plugin that would work with uploading into Local.

Anything else that would work?

When you are telling it to import are you setting custom preferences or are you using preferred?
I cant remember if preferred is using MySql or MariaDB.

Anyway, Xampp uses MariaDB. You may want to try using that when you create the site. The error message that is shown is usually an invalid character that is not back ticked. However, MariaDB sometimes just works.

The bad news is that the error is so far in it will be hard to find if that does not work. Sadly those imports file are a giant mass of run on text.

if that does not work though I have other ideas… You can backup your database and restore it with a tool to the local instance.

I tried it with all database variations. MariaDB was my 1st choice.

I am not sure what you mean with your “other ideas”

Please elaborate.

Was waiting for you to say it didn’t work :slight_smile:
So what I had to do was

  1. create a new website in local.
  2. Copy files over to the newly created website public folder
  3. I use Datagrip as a database manager but all the tools have a way to backup the database.
  4. Ok now this is where I am not sure if something like PHPAdmin will work, you have to overwrite the database for the newly created site with the backup you made. (anybody know this ?)
  5. Make sure you change your site URL in the options table.

I have not done the regular procedure to create/update a WP site.
The big advantage of just uploading a zip file to create a new site was the exciting part with Local. And, unfortunately, it just does not work for me.
I just ran another 7hr BackWPup to create a zip file for uploading into Local. Did not work again.
I reconfigured the zip file to not include the sql file. That did not work either.
My conclusion: BackWPup is extremely buggy although they refuse to admit that.
And Local has not yet provided any official explanation why these zip files don’t work, or provide work arounds. So I have to assume that Local also has major bugs.

2 Likes

I have a the same issue reported by hapzfl: I created the zip with BackWPu (10 hours job!!!), and then I was so happy that I could finally “just” drag&drop the zip on localwp and wait for the magic → but no, no magic: same error message.

Here is my log:
{“stack”:“Error: Local was unable to import the following SQL files: \n\n\n at ImporterGeneric. (%%appPath%%/main/importer/Importer.js:1:9662)\n at Generator.next ()\n at n (%%appPath%%/main/importer/Importer.js:1:742)”,“level”:“warn”,“message”:“Unable to import site.”,“timestamp”:“2022-04-23T19:01:41.725Z”}