Migrate a Controller Installation
Here's an example of migrating an existing controller's configuration to the Linux service's working directory.
- Remove the quickstart controller service if you followed the BASH quickstart to create /etc/systemd/system/ziti-controller.service. 
- Follow the Linux controller deployment guide to install the controller service. 
- Ensure the controller service is disabled and the state is clean. - sudo systemctl disable --now ziti-controller.service
 sudo systemctl clean --what=state ziti-controller.service
- Copy the controller's configuration to the working directory and rename it - config.yml.- 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
- 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.ymlhas the correct file paths.- sudo sed -Ei "s|$PWD|/var/lib/ziti-controller|g" /var/lib/ziti-controller/config.yml
- Disable bootstrapping. We're migrating a complete controller configuration (PKI, configuration file, and database) so we don't want the bootstrapper to generate a configuration. - sudo sed -Ei 's|(ZITI_BOOTSTRAP)=.*|\1=false|g' /opt/openziti/etc/controller/service.env
- Start the service. - sudo systemctl enable --now ziti-controller.service
 sudo systemctl status ziti-controller.service
- 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/'