diff --git a/src/docs/markdown/command-line.md b/src/docs/markdown/command-line.md index 04ff841..3261f90 100644 --- a/src/docs/markdown/command-line.md +++ b/src/docs/markdown/command-line.md @@ -12,10 +12,12 @@ caddy [] The `` indicate parameters that get replaced by your input. -The`[brackets]` indicate optional parameters. The`(brackets)` indicate required parameters. +The`[brackets]` indicate optional parameters. The `(brackets)` indicate required parameters. The ellipses `...` indicates a continuation, i.e. one or more parameters. +The `--flags` may have a single-letter shortcut like `-f`. + **Quick start: `caddy`, `caddy help`, or `man caddy` (if installed)** --- @@ -68,6 +70,12 @@ The ellipses `...` indicates a continuation, i.e. one or more parameters. - **[caddy stop](#caddy-stop)** Stops the running Caddy process +- **[caddy storage export](#caddy-storage)** + Exports the contents of the configured storage to a tarball + +- **[caddy storage import](#caddy-storage)** + Imports a previously exported tarball to the configured storage + - **[caddy trust](#caddy-trust)** Installs a certificate into local trust store(s) @@ -495,6 +503,51 @@ The address of this request can be customized using the `--address` flag, or fro If you want to stop the current configuration but do not want to exit the process, use [`caddy reload`](#caddy-reload) with a blank config, or the [`DELETE /config/`](/docs/api#delete-configpath) endpoint. +### `caddy storage` + +Allows export and import of the contents of Caddy's configured data storage. + +This is useful when needing to transition from one [storage module](/docs/json/storage/) to another, by exporting from your old one, updating your config, then importing into the new one. + +The following command can be used to do this all in one shot, using and old and new config with different configured storage modules, piping the export output into the + +``` +$ caddy storage export -c Caddyfile.old -o- | + caddy storage import -c Caddyfile.new -i- +``` + + + + +#### `caddy storage export` + +
caddy storage export
+	-c, --config <path>
+	[-o, --output <path>]
+ +`--config` is the config file load. This is required, so that the correct storage module is connected to. + +`--output` is the filename to write the tarball. If `-`, the output is written to stdout. + + + +#### `caddy storage import` + +
caddy storage import
+	-c, --config <path>
+	-i, --input <path>
+ +`--config` is the config file load. This is required, so that the correct storage module is connected to. + +`--input` is the filename of the tarball to read from. If `-`, the input is read from stdin. + + ### `caddy trust`
caddy trust