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?

  • Are you sure you're using the correct commands? wp import expects a WXR file, while wp db import is for SQL. – Jacob Peattie Jul 12 at 2:03
  • Yep! That was it!! Thank you so much!!! – J3ck Jul 12 at 10:53

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.