Export and Import
Use export when you want to capture the current CloudPeek images — and optionally the data volumes — so you can move CloudPeek to another host or keep a backup. import stands that export back up on the destination host.
Exporting an existing instance
From inside the cloudpeek/ directory of your existing install:
cd cloudpeek
./cpk export
This produces an output_folder/ in your current directory containing:
- A complete copy of your install directory — the
cpkbinary, the compose file, the.secrets/directory, and the other supporting files. cloudpeek-images.tar.gz— the current Docker images.
Handle the export as a secret. It includes .secrets/, which holds your credentials and certificate private key. Transfer it over a secure channel and store it accordingly.
Including your data volumes
If you also want to back up your data (database contents, uploaded files, and so on) pass the --save-data flag:
./cpk export --save-data
Volume archives are written to output_folder/volumes/.
--save-data stops the running containers while it archives the volumes to guarantee a consistent snapshot, then restarts them when it finishes. Expect a brief outage during export.
Importing a previous export
On the destination host, copy the entire output_folder/ produced by export over (for example via scp or a USB drive), rename it to cloudpeek/, and enter it:
mv output_folder cloudpeek
cd cloudpeek
./cpk import
The rename is only for tidiness — import cares that you run it from inside the directory, not what the directory is called.
import will:
- Check that the compose file,
cloudpeek-images.tar.gzand.secrets/compose.envare all present, and load your exported settings. A missing.secrets/compose.envstops the import withMissing required file: .secrets/compose.env. - Load the CloudPeek Docker images from the archive.
- Make sure the third-party images are on the host, downloading only any that are missing. An air-gapped export needs no network here.
- Offer to restore the data volumes, if the export contains any. Answer
yto restore; any other answer starts with a fresh database. This prompt only appears if you exported with--save-data. - Start the full stack.
When it finishes you have a running copy of the exported CloudPeek instance on the new host.
Related
- Uninstalling CloudPeek: export first — uninstalling deletes your data.
- Updating CloudPeek: upgrading in place instead of moving hosts.
- Installing CloudPeek: a fresh install on the destination host.