# Migrating a Docker Fleio installation to Kubernetes ```{warning} Fleio in Kubernetes is still in beta, and is not intended for production use. ``` ```{contents} :depth: 4 :backlinks: none ``` ## License considerations A Fleio license allows you to run Fleio on one machine. However, during the migration process, Fleio needs to run on two machines. Before starting the migration process, you should contact us to update your license so it can temporarily be used on more than one machine. ## Deploy Fleio on Kubernetes First, you need to deploy Fleio in a Kubernetes cluster. See [](#deploying-using-kubernetes-operator). If you contacted us to temporarily update your license, you should be able to use the same license as on your Docker installation. We recommend using a public IP for the cluster and a real domain (subdomain name) so an SSL certificate can be automatically acquired. ## Stop old Docker Fleio installation & backup database ```{warning} Once the old Fleio installation has been stopped you should not start it again to avoid conflicts. ``` Once you have a working Fleio in Kubernetes, it's time to stop your old Fleio installation. Use the following command to stop Fleio: ```shell fleio stop ``` And then use the following command to create a backup of the database: ```shell fleio backup now ``` A new backup should be present in /home/fleio/backups folder. ## Copy database Now you should create a new database in your MariaDB server used in your Kubernetes deployment and populate it using the backup created at the previous step. Once the backup is restored, you need to create a [](#fleio-db-connection) custom resource in Kubernetes and wait for the Fleio operator to validate it. You can query resource status using the following command: ```shell kubectl get fleiodbconnection ``` ## Copy secret keys Next, you will need the secret keys from your Fleio Docker installation to be able to access encrypted data in DB. Run the following command on your Fleio Docker installation to open a Fleio shell: ```shell fleio bash ``` And then use the following commands to retrieve `SECRET_KEY` and `SSO_SALT`: ```shell cat fleio/fleiosettings/settings.py | grep SSO_SALT cat fleio/fleiosettings/settings.py | grep SECRET_KEY ``` Once you have retrieved the keys, update the deployment-keys secret in your Fleio Kubernetes deployment (see [](#fleio-deployment-keys)). ## Update Fleio Kubernetes deployment After all the above steps have been completed, you can edit your FleioDeployment custom resource and set the new FleioDbConnection name (see [](#fleio-deployment-resource)). After you update the resource, the Fleio Kubernetes operator will detect the change and switch Fleio to the new database.