When I use WP-CLI I'm having some issues with the wp db export and wp db import commands.

I have a local site on my desktop that I would like to migrate to my laptop so I can work on it. So I go on my desktop, navigate to the appropriate directory and type wp db export. It is a success and creates the file: ccv3-2018-07-12-4e523fb.sql

Now here is the part I don't get. I copy paste the SQL file that it creates on my desktop to my laptops directory where the local website resides. I type wp db import ccv3-2018-07-12-4e523fb.sql --authors=skip and then I get:

Starting the import process... Error: This does not appear to be a WXR file, missing/invalid WXR version number

After googling this issue it looks like the file it's trying to import should be an XML file, but after looking at the file I get when I use wp db export reveals an actual SQL file.

So what gives? What should I be doing to migrate databases with WP-CLI?

  • 1
    Are you sure you're using the correct commands? wp import expects a WXR file, while wp db import is for SQL. Jul 12, 2018 at 2:03

1 Answer 1


Seems you are mixing wp db import with wp import.

wp import indeed expects an WordPress Extended RSS (WXR) file as input. Whereas wp db import doesn't know of an --authors option.

Just use wp db import ccv3-2018-07-12-4e523fb.sql and everything should be fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.