Skip to main content
Star us on GitHub Star

Migrate a Controller Installation

Here's an example of migrating an existing controller's configuration to the Linux service's working directory.

  1. Ensure the controller service is disabled and state is clean.

    sudo systemctl disable --now ziti-controller.service
    sudo systemctl clean --what=state ziti-controller.service
  2. Duplicate the controller's configuration to the working directory using the config.yml filename.

    sudo mkdir -pv /var/lib/ziti-controller/
    sudo cp -Rv ./pki ./db /var/lib/ziti-controller/
    sudo cp -v ./ctrl.yaml /var/lib/ziti-controller/config.yml
  3. Correct the file paths in config.yml. Ensure your current working directory matches the existing controller's working directory, e.g. ZITI_HOME, or substitute the old working directory for $PWD. After completing this step, verify the new config.yml has the correct file paths.

    sudo sed -Ei "s|$PWD|/var/lib/ziti-controller|g" /var/lib/ziti-controller/config.yml
  4. Disable bootstrapping. We're migrating a complete controller configuration (PKI, configuration file, and database) so we don't need the bootstrapping process.

    sudo sed -Ei 's|(ZITI_BOOTSTRAP_.*)=.*|\1=false|g' /opt/openziti/etc/controller/service.env
  5. Start the service.

    sudo systemctl enable --now ziti-controller.service
    sudo systemctl status ziti-controller.service
  6. Verify the controller is running and listening on the expected port.

    journalctl -u ziti-controller.service
    sudo lsof -Pnp $(systemctl show -p MainPID --value ziti-controller.service) |& awk '$5~/IP/'
    Output
    ziti    2694474 ziti-controller    8u     IPv6          222078013       0t0       TCP *:1280 (LISTEN)