Partially addresses #1071 Just documenting `mc alias import` and `mc alias export`, the former of which we seem to have missed a year or so back. Staged: http://192.241.195.202:9000/staging/DOCS-1071/linux/reference/minio-mc/mc-alias-import.html http://192.241.195.202:9000/staging/DOCS-1071/linux/reference/minio-mc/mc-alias-export.html
2.9 KiB
mc alias export
minio
Table of Contents
mc alias export
mc.RELEASE.2023-11-15T22-45-58Z
Syntax
The mc alias export
command exports an alias configuration from the existing configuration <mc-configuration>
.
The command outputs the result to STDOUT
where you can
either capture the output as a file or perform further
modifications to the output as necessary.
Use the mc alias import
command to import the resulting JSON
configuration.
EXAMPLE
The following command exports an alias configuration from the existing host and outputs it to a file:
mc alias export play > play.json
The command outputs the file to Standard Out (STDOUT
).
You can alternatively pipe the output to a utility of your choice for
further operations.
SYNTAX
The mc alias export
command has the following syntax:
mc [GLOBALFLAGS] alias export ALIAS
Parameters
ALIAS
The name of the alias to export.
Global Flags
Behavior
JSON Format
The command outputs a JSON object with the following schema:
{
"url" : "https://hostname:port",
"accessKey": "<STRING>",
"secretKey": "<STRING>",
"api": "s3v4",
"path": "auto"
}
You can use the mc alias import
to import the JSON document.
Examples
Export and Transform an Alias
The following example exports the alias for the play.min.io sandbox. It then transforms the configuration using the jq utility and creates a new alias from the modified configuration:
mc alias export play | jq '.accessKey = "minioadmin" | .secretKey = "minioadmin"' | mc alias import play-custom
Back Up An Alias Configuration
The following command exports an alias configuration to a JSON file. You can then back up that file using your preferred process.
mc alias export play > play-backup.json