NOTE: This procedure should only be followed if both datastores are in the same ESXi cluster and both datastores are accessible from the ESXi hosts where TKGi is running. Failing to adhere to this requirement could result in loss of persistent volumes.
Change the datastore in persistent datastore and ephemeral store section of Bosh Director tile > "vCenter Config".
Select "Recreate Bosh Director VM" and "Recreate all VMs" deployed by bosh director option in Bosh director tile > "Director Config". Note: Do not select the Recreate Persistent Disk option.
Change the datastore under TKGI tile > "Kubernetes Cloud Provider".
Apply Changes with both the Director tile and the TKGI tile selected. Under the TKGI Errands deselect the upgrade all clusters errand. After the apply is finished, only the Bosh director and TKGI API VMs and persistent disks would have been moved to the new datastore.
To move each of the TKGI clusters, use the bosh cli and run bosh -d service-instance_<ID> recreate for each service-instance deployment. (Run bosh deployments --column=name | grep service-instance_ to get the list of deployment IDs.)
To move the OpsMan VM use a standard storage vMotion.
Finally we can migrate TKGi volumes to the new datastore using either Velero (Option A) or Cloud Native Storage migration on TKGi v1.16+ (Option B).
Follow the official documentation to restore Kubernetes workloads to the new datastore using Velero.
Follow the official documentation to migrate volumes to the new datastore using cloud native storage migration.
Important Notes:
When you recreate the clusters make sure you have backup copies of your apps.
If you have single control plane node still you can proceed with the previous steps, however you will not be able to use kubectl commands for sometime until your control plane node is up.
You might see the old stemcells vms still present on the old datastore after this process (powered off VM named sc-1234xx), From Vsphere GUI you can safely delete those old Stemcells, as the new stemcells will be automatically created on the new datastore.