bjornjohansen / do-upgrade-plans
Upgrade your DigitalOcean droplets to better plans with the same cost.
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- nategood/httpful: ^0.2.20
This package is auto-updated.
Last update: 2024-10-29 04:53:26 UTC
README
Upgrade your DigitalOcean droplets to better plans with the same cost.
This script will use the DigitalOcean API to upgrade all of your droplets to better plans with the same cost if available.
Background
January 16, 2018 DigitalOcean released new pricing plans where they basically doubled the RAM for the same price of the old plans. But to get the benefits for your existing droplets, you have to upgrade all of your existing droplets in a process that involves shutting them down, selecting the new plan, waiting for the upgrade to happen and power on the droplets again. I have tens of droplets and had no intention of doing this manually, so I wrote a script to use the DigitalOcean API to automate the upgrades.
Installation
composer create-project bjornjohansen/do-upgrade-plans
Run the upgrades
First you need a Personal Access Token with read and write access, which you can generate on the Applications & API page.
Copy your access token and set it as an environment variable: export DO_ACCESS_TOKEN=<YOUR_64_CHAR_TOKEN_HERE>
.
Run the script: php -f do-upgrade-plans/upgrade-plans.php
Watch as your droplets get upgraded.
In case an error happens, your droplets will power cycle, to make sure they are in a running state. This happened to 3 of my droplets. Further investigation (trying to upgrade manually) revealed that “Due to high demand and capacity restrictions we have temporarily disabled this size in this region.”