Docker Cloud moving one node from one account to another

Problem

You have used ‘Bring your own node’ to use a server with one account, but you want to change the account and move the node to the new one.

Solution

Use your old account to terminate the node or login to the server and use the following to stop the running dockercloud-agent:

sudo service dockercloud-agent stop

Go to the Docker Cloud web ui interface, and use the 'Bring your own node'. Copy the token that appears after the sudo -H sh -s on the popup window.

On the server update the token with the one from the new account that you just copied, by running the following:

sudo dockercloud-agent set Token=xxxxx_new_token_xxxx

And now restart the dockercloud-agent on the server:

sudo dockercloud-agent restart

You should now be able to see 'Node xxxx detected' on the Docker Cloud web ui after a couple of minutes.