Hi,
Explored some stuff and I found that there is a backup/restore procedure for docker container. Is there a way to take backup for hosted server anywhere? In ZAC or via CLI?
Thank you
Hi @kashif,
To backup your OpenZiti network you should:
- backup the database by running this CLI command:
ziti edge db snapshot
. If you used the quickstart that will put a file into$ZITI_HOME/db/
namdedctrl.db-*
. Or, look at the controller's config file and find thedb:
setting. The backup is placed next to that file and has the current time appended inYYYYMMDD-hhmmss
format. Example:ctrl.db-20230828-114750
- backup the PKI for the controller. If you ran the quickstart this will be
$ZITI_HOME/pki
. Backup the full folder. If not, you probably understand how to back your whole pki up. - backup the controller config file at $ZITI_HOME
Thank you again.
In the controller folder ($ZITI_HOME | /root/.ziti/quickstart/openziti) you mean to take backup just yaml file or to take whole folder as a backup?
And restore procedure please.
I'd tell you to take JUST the $ZITI_HOME/pki
folder, the controller's configuration file (If using "the host it anywhere" quickstart it'd be named: $ZITI_HOME/$ZITI_NETWORK.yaml
) and the db snapshot. Oh and actually, you might want to also backup the systemd file at /etc/systemd/system/ziti-controller.service
We don't have this whole process documented at this time and I will admit that I have not tested this myself yet but here's the process that you should be able to use to restore:
- put back systemd unit file
/etc/systemd/system/ziti-controller.service
- put back yaml file at
$ZITI_HOME/$ZITI_NETWORK.yaml
- put pki directory back into
$ZITI_HOME/pki
- put db back into
$ZITI_HOME/db/ctrl.db
(notice I renamed it, without the timestamp) - enable the systemd unit file:
sudo systemctl enable --now ziti-controller
Thank you for your kind help.
Will try it out soon.