CLI commands of pool import and export

First of all, yes you are missing some flags in your zpool command (-R /mnt at least). But using zpool directly is not supported anyway.

Any GUI action can be done via the API. The GUI is an API client in itself. In the command line you would use midclt to call the API.

Importing:

Works via pool-guid

  • sudo midclt call pool.import_pool '{"guid":POOLGUID}'

Exporting

I think this requires at least two steps due to export command NOT using the pool guid.

  • sudo midclt call pool.query to find id of the pool (different from the pool GUID)
  • sudo midclt call pool.export POOLID

Disclaimer: I don’t use these commands, use them at your own risks.

1 Like