How to rename a cluster without losing data #13683
-
Hi, I would like to change cluster name (I have only one node in a ssh-proxy role). But I cannot find any working procedure how to do that. I tried to stop teleport service. Edited
But in web interface and Is there any way to change that without loosing data? Cause if I remove |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Unfortunately there is no way to easily change the name of the cluster without losing data. This is because the cluster name is encoded into the identity of the certificate authorities within Teleport and changing it requires them to be regenerated from scratch. Here's something you can try that might work.
sudo tctl get users --with-secrets > /tmp/backup.yaml
echo "---" | sudo tee -A /tmp/backup.yaml
sudo tctl get roles --with-secrets >> /tmp/backup.yaml
This should create you a new cluster with the name as set in At this point, you should be able to log in with your old username/password. Check the cluster name and it should be updated. All your old roles should also still exist. This may not work, so just be warned. |
Beta Was this translation helpful? Give feedback.
-
How about the sessions and recording? |
Beta Was this translation helpful? Give feedback.
Unfortunately there is no way to easily change the name of the cluster without losing data. This is because the cluster name is encoded into the identity of the certificate authorities within Teleport and changing it requires them to be regenerated from scratch.
Here's something you can try that might work.
/var/lib/teleport
out of the way to clear your cluster name/database:sudo mv /var/lib/teleport /var/lib/teleport-old