WP CLI export to local directory

Hello, I am SSH’d in to my Local Flywheel WordPress site and using WP CLI, which is great. I would like to “wp export”…does anyone know how I access the xml file that is exported?

Seems like I will either have to A) navigate to the directory in the container in which the xml file was exported and download it to my local directory or B) set a local path in the “wp export” command so the xml file is exported to my local directory. I’m inexperienced with SSH and containers and not sure how to do either really.

Any help is appreciated!

In the meantime, I figured out a hacky solution where I export the file to the /app/public directory and then I can just browse to the file in the root of my site in the browser and save it from there.

If anyone knows a less hacky way of doing this, I would love to learn what it is.

I think that’s the only way to do it since that’s where the Host’s folder is mounted into the container.

Ok thanks @ben.turner.

Actually, looks like I don’t need to browse to the file in my browser: When the file is exported to the /app/public directory in the container it gets synchronized to the local app/public directory for the site. So apparently, this results in a local export after all. :clap:

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.