Question

How to downscale a Managed Database

Posted December 29, 2020 933 views
DigitalOcean Managed PostgreSQL DatabaseNeeds Product Answer

I have a managed Postgres Database that I temporarily scaled up to the $60/month version, to account for an expected spike. Since the spike is over, I’d like to go back down to the $30/month node plan.

However, these plans are greyed out, with the Text “Disk must be at least the same size” superimposed over the items.

Is there a way to force-migrate the database back to a lower plan without destroying my data?

edited by bobbyiliev

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
3 answers

There is no way to force migrate a database to a lower plan that has less disk space. Because that would require a file system level of migration which we do not support. We do not analyze your FS to determine how much diskspace is used and how to do that and truncating a file system could be dangerous depending on disk space used.

You would need to create a new smaller cluster with the desired space and then import your data.

Additionally, depending on your load spikes, if it is mostly READ access you can create READ replicas to increase the capacity of your DB without having to resize to a larger size.

You can also setup a primary DB as a WRITE only server, while creating multiple READ replicas to scale your DB usage without changing disk space and giving you more flexibility in spinning up additional resources and then destroying them when they are no longer in use.

  • This is all very sensible, but I wish I had known this before I scaled up the database server. My options are now “pay more than I’m comfortable with, forever” or “create a new database server and migrate all my data over”, all because I wanted to try out a DB server with more CPUs and RAM for a moment.

    Since I hadn’t even realised the disk space would change, I recommend giving a warning that this operation is not reversible in the UI.

  • Offering the option to change the instance size (RAM, CPU) keeping the smaller disk size would also be very helpful for temporary spikes allowing downscaling after the spike.

So, the $15/month and $30/month have the same disk size (25GB), but I can’t scale down. Why? The $15/month was inactive for me =(

Hi,

Check the below Community question that was answered on how to downgrade DB cluster using DO API/DOCTL CLI:

https://www.digitalocean.com/community/questions/how-can-i-downgrade-my-db-cluster

I hope this helps!

Regards,
Rajkishore

  • Hi Rajkishore, thanks for this post. Can you confirm that downgrading a DB cluster via CLI or API is a safe operation? Moisey’s Jan 6, 2021 comment seemed to simply that downgrading wasn’t possible because of technical limitations, i.e. that downsizing the disk would be an unsafe operation. Are those concerns no longer relevant? Thank you both!