How to use wp db export and import together?

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?

Topic wp-cli Wordpress

Category Web


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.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.