docker run example. Omni instances set up by following it keep the embedded etcd data inside the container instead of on the host. The data is intact, but it is deleted together with the container, e.g., when the container is recreated for an upgrade.
Check if you are affected
Run this on the host. If your container is not namedomni, use its name instead (docker ps -a lists them).
Move the data to the host
The commands below use the current directory. The copy taken in step 3 lands in./etcd, and step 5 mounts that same directory into the new container as its permanent data directory on the host. Because of this, run all steps from the directory you normally start Omni from, the one holding the certificate files from the setup guide.
Run the commands one at a time, and if one of them errors, stop there.
- Check the container is not set to auto-remove.
false. If it prints true, do not stop the container. Stopping it would delete it together with the data. Contact support in that case.
- Stop Omni. Do not remove the container.
- Copy the etcd data out of the container.
/. form copies the directory contents, and works the same whether ./etcd existed before or not.
- Keep the old container as a backup.
omni name.
- Start Omni again with the missing mount added.
docker run command and the same image version as before, and add this to the mounts:
docker inspect omni-old --format '{{.Config.Image}}' prints it. Do not upgrade in the same step. First get back to a working state, then upgrade the normal way.
- Check everything is there, then clean up.
omni-old the same way before removing it.
If you run Omni with docker compose
Do not rundocker compose down. It removes the container together with the data. Instead:
- Stop with
docker compose stop omni, then copy the data out as in step 3. - Make an extra copy on the host (
cp -a etcd etcd.bak) instead of renaming the container. Compose removes the old container on the nextdocker compose up -deven when it was renamed, so the rename does not protect anything there. - Add the volume to the compose file and run
docker compose up -d. - After checking everything is there, remove the extra copy with
rm -rf etcd.bak.