Exporting Models

Export a registered Model to back it up, inspect its definitions, or move it to another Meshery Server. The export contains the model definition and, unless you leave them out, its components and relationships.

Export a model with Meshery CLI

You need mesheryctl installed and logged in to your Meshery Server.

Run:

mesheryctl model export <model-name>

By default, mesheryctl writes an OCI image with YAML definitions to the current directory. Change that with these flags:

FlagWhat it does
-o, --output-type <oci|tar>Package as an OCI image (oci, the default) or a compressed archive (tar).
-t, --output-format <yaml|json>Write the definitions as YAML (the default) or JSON.
-l, --output-location <dir>Write the file to this directory instead of the current one.
--version <vX.Y.Z>Export this version of the model instead of the latest.
-c, --discard-componentsLeave out the components.
-r, --discard-relationshipsLeave out the relationships.

For example:

# OCI image with JSON definitions
mesheryctl model export istio-base -t json

# Compressed archive of version v1.20.0 in ./exports
mesheryctl model export istio-base -o tar --version v1.20.0 -l ./exports

# Only the model definition
mesheryctl model export istio-base --discard-components --discard-relationships

Export a model with Meshery UI

  1. Open the Registry. Click your avatar in the top right and choose Registry, or go to Settings > Registry.

    Registry-Navigator

  2. On the Models tab, select the model. To export a specific version, select that version.

  3. Click Export. Meshery downloads the model as an OCI image.

Export-Model

Next steps