## pyre export prepare

Operator: copy a volume's blocks off the store into parts, ready for media or a download link

### Synopsis

Reads the volume's objects from the store with S3 credentials
(PYRE_EXPORT_S3_ACCESS_KEY / PYRE_EXPORT_S3_SECRET_KEY: on a hub the
tenant's MinIO root credentials, PYRE_MINIO_ROOT_USER/PASSWORD in
/etc/pyre/tenants/<bucket>.env, which also names the endpoint) and
lays them out under --out: one directory per piece of media of
--part-size, or with --archive one zip file per part (what a download
link serves), each with its index, SHA256SUMS, README and a copy of
the export manifest.

An encrypted volume is exported as the ciphertext it is. A volume
that is not encrypted must be sealed to the customer's export public
key (--recipient, from their pyre export keygen); --plain exports it
readable, on your say-so (the download link does this: the link is
the secret).

```
pyre export prepare <volume> [flags]
```

### Examples

```
  # on the hub, as root: the tenant's store and its credentials
  . /etc/pyre/tenants/t-000012.env
  PYRE_EXPORT_S3_ACCESS_KEY=$PYRE_MINIO_ROOT_USER PYRE_EXPORT_S3_SECRET_KEY=$PYRE_MINIO_ROOT_PASSWORD \
    pyre export prepare backups --endpoint http://$PYRE_MINIO_IP:$PYRE_MINIO_PORT --bucket t-000012 \
      --out /srv/export/job-1234 --part-size 100GB --label "job 1234"
  # a volume that was never encrypted, for media
  pyre export prepare docs --endpoint ... --bucket t-000012 --out /srv/export/j2 \
      --recipient pyre-export-pub-v1.…
  # zip parts for a download link (the hub's export-start does this)
  pyre export prepare docs --endpoint ... --bucket t-000012 --out /srv/export/work/TOKEN \
      --archive --plain --yes --part-size 100GB
```

### Options

```
      --archive              write each part as one zip file (stored, not compressed) instead of a directory
      --bucket string        the tenant's bucket (t-000012)
      --endpoint string      S3 endpoint of the store, e.g. http://127.0.0.1:9000 on a hub
  -h, --help                 help for prepare
      --insecure-store       skip TLS verification towards the store
      --label string         free text recorded in the export (job or ticket number)
      --out string           directory to create the part directories in
      --parallel int         objects fetched at once (default 4)
      --part-size string     most a part may hold (100GB for BD-R XL, 18TB for LTO-9); default one part
      --plain                export a volume that is not encrypted as it is (anyone with the media can read it)
      --prefix string        object prefix, when not <volume>/ (a pre-prefix volume at the bucket root: --prefix '')
      --recipient string     customer's export public key, for a volume that is not encrypted
      --region string        S3 region (default us-east-1; MinIO ignores it)
      --salt-prefix string   the prefix the volume's key is salted with, when not the volume's own (a promoted copy: its source's, e.g. testvol/)
```

### Options inherited from parent commands

```
      --api string       API base URL (default from the profile, or https://api.pyredata.io)
      --ca-cert string   PEM file with an extra CA to trust (self-hosted managers)
      --insecure         skip TLS certificate verification (lab use only)
  -o, --output string    output format: table, json or plain (default "table")
      --profile string   config profile to use (see: pyre config)
  -q, --quiet            print results only, no notices
      --token string     API token (default from the profile; prefer PYRE_TOKEN in scripts)
  -y, --yes              answer yes to every confirmation (for scripts)
```

### SEE ALSO

* [pyre export](pyre_export.md)	 - A copy of a volume: downloaded from a link, or on tape or disc; opened with your key

