This script handles all required commands to migrate a hcloud server to a new server type.
- Run all required API commands with one shell command
- checks the server status for every migration step
- workflow is optimized to be used with automations, eg. crontab.
- Text-output for logging and debugging keeps track of progress and server status
- migration is only possible when the server is not running, so this script will shut down your server!
- the migration will keep the inital storage size! This is required to easily downgrade a server.
- the script requries the 'jq' command.
-
Clone this repo
-
Copy the sample file to a
.sh
-fileeg.
cp migrate.sh.sample migrate.sh
-
Enter required data
- server-id
- migration target (eg. "cx21")
- API key
-
If not already done, install
jq
apt-get install jq
-
Run your script or add it to your automation tool