How to reduce size of my RDS mySql database of 5000 GB to 2000 GB, with all the triggers and functions intact?
I have a RDS MySql database of provisioned storage 5000 GiB. Out of 5000 GiB I am using only 1400 GiB and want to reduce size of provisioned storgae to 2000 GiB. All the tables are innoDb.
I want to keep my triggers, indexes, keys and functions intact.
What will be the simplest and most fail proof approach to achieve this ?
According to Amazon's documentation for RDS storage:
You can't reduce the amount of storage for a DB instance after storage has been allocated.
See here: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html
If you really need to reduce the storage, then it sounds like you would have to spin up a completely new RDS instance and migrate your entire database, then shutdown the original instance entirely.