I have an app in Heroku which is reaching the 10K rows cap so I have to upgrade my Heroku DB, but I have a couple of doubts regarding this and I wan't to be completely sure about what I'm doing before doing anything to the production DB.
First of all I'm not 100% of this process and after a lot of time I found this link, so what I'm guessing is that I have to put my billing details in account settings, add a credit card and then after that I would be able to create a hobby-basic DB and automatically 9 dollars will be deducted from my credit card every month, am I right?
Regardin the process to change the DB of my app, the commands would be:
- First I would put my app in maintenance mode
heroku maintenance:on --app my_app_name
- Then I would make a DB backup and download it
heroku pg:backups:capture --app my_app_name
heroku pg:backups:download --app my_app_name
- I would also get my old DB name with
heroku pg:info --app my_app_name
- Then I create a new DB
heroku addons:create heroku-postgresql:hobby-basic --app my_app_name
Let's suppose HEROKU_POSTGRESQL_ROSE_URL
is the name of thee new DB.
- And I copy all the record from my old DB to the new one
heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_ROSE_URL --app my_app_name
- To confirm I write the name of my app
my_app_name
- Then I designate my new DB as the prrimary DB
heroku pg:promote HEROKU_POSTGRESQL_ROSE_URL --app my_app_name
- Finally I turn off the maintenance mode
heroku maintenance:off --app my_app_name
- And then I delete my old DB
heroku addons:destroy old_db_name --app my_app_name
Is everything correct?
EDIT: So I made a test creating a hobby-dev
DB, but at the end of the process this new DB had like 150 more rows (before it had like 820 rows and now it have like 970 rows), is this normal?
Also, is it normal that the size of the backup is like 200 KB, while in the Heroku interface, the DB had like 10 MB of size?