mc inventory migrate-from-batch

mc inventory migrate-from-batch converts an existing batch catalog YAML configuration (v2 format) to the inventory YAML format (v1 format). This command enables migration from the batch catalog system to the newer inventory system.

The command transforms the YAML structure by:

  • Changing apiVersion from v2 to v1.
  • Removing the bucket field (the bucket is specified when submitting the configuration).
  • Adding an id field with the specified inventory ID.
  • Preserving all comments and other configuration fields.

After converting the batch catalog YAML, use mc inventory put to upload the configuration to your target bucket.

Syntax

Parameters

BATCH_FILE

Required

The path to the batch catalog YAML file to convert. The file must use the batch catalog format with apiVersion: v2.

INVENTORY_ID

Required

The identifier for the new inventory configuration. The ID must be unique within the bucket where you submit the configuration.

The ID must meet the following requirements:

  • Between 1 and 63 characters in length
  • Start and end with an alphanumeric character
  • Contain only alphanumeric characters and hyphens

Valid examples: test-inv-1, my-inventory, inv-001

OUTPUT_FILE

Optional

The path where the converted inventory YAML file should be saved.

If not specified, the command prints the converted YAML to STDOUT.

Global flags

This command supports any of the global flags.

Examples

Convert and output to stdout

The following command converts a batch catalog file and prints the result to the terminal:

mc inventory migrate-from-batch batch-job.yml my-inventory-1

Convert and save to file

The following command converts a batch catalog file and saves the result to a file:

mc inventory migrate-from-batch batch-job.yml my-inventory-1 inventory-job.yml

Conversion example

The following shows an example of the YAML transformation performed by this command.

Input (Batch Catalog v2):

apiVersion: v2
bucket: test-bucket
destination:
  bucket: output-bucket
schedule: once

Output (Inventory v1):

apiVersion: v1
id: my-inventory-1
destination:
  bucket: output-bucket
schedule: once

S3 compatibility

The mc commandline tool is built for compatibility with the AWS S3 API and is tested with AIStor and AWS S3 for expected functionality and behavior.

MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported.

While mc commands may work as documented, any such usage is at your own risk.