Ninja Space Content Tech Blog

Upgrading From heroku-18 to heroku-22 and Subscribing to Eco Dynos Plan

Posted by Ninja Space Content on Tuesday, December 20, 2022 Under: heroku
During my coding bootcamp, we were using Heroku with heroku-18 on a free version. However, Heroku is changing things. Last November, Heroku eliminated the free version and heroku-18 is now deprecated and will reach end-of-life on April 30, 2023! 

All of my databases and API end points were down for a month because I was hosting all of them on Heroku via their now deprecated free version. 

Below are my outlined steps that I took to upgrade my heroku-18 to heroku-22 and subscribe to their lowest tier plan, Eco Dynos. For my Steps #1 - #5, I followed the steps from Heroku, which you can view from this link: https://devcenter.heroku.com/articles/upgrading-to-the-latest-stack, with a couple of modifications because of the way my app was already set up. They recommend you doing a test first which you should, but I didn't do it. It's not a money-making API and I'm solely just keeping it for my portfolio so I skipped the test and went straight to upgrading. In a real workplace situation, I would never skip the test. 

Steps:

  1. I went into my folder where my app sits on my computer and opened it up in VSC.
  2. In the command line, I typed the following to upgrade to heroku-22: heroku stack:set heroku-22 -a 
  3. After that was successful, in my command line within the app in VSC, I typed: git commit --allow-empty -m "Upgrading to heroku-22"
  4. Then, I pushed it to heroku master for deployment with this command: git push heroku master
  5. Unlike the instructions, I had originally deployed this with heroku master and not heroku main. Yours might be different. Then, I typed in the command line: heroku info to make sure it is listing heroku-22 for Stack and it did.
  6. Then, I logged into my Heroku Account via their website and now went through the app to add the postgres add on for an additional $5 per month so that I can use my database and also subscribed to the Eco Dynos plan for $5 a month under the "Resources" section. Good bye, money. 
  7. After adding my postgres package to the heroku under my plan, I now have to seed the data onto heroku on the command line. Uniquely for me, it is: heroku run npm run seed because I had set up my app this way and I use Node.
  8. To test that my postgres add on has been done successfully, I did a query on the Dataclips interface from Heroku and saw data when I did a query like this: select * from activities; because one of my tables is named 'activities'. Great, saw data on Dataclips via Heroku! However, I could not see anything on my API end point URL. I was racking my brain for like 25 minutes because I knew I added the Eco Dynos subscription and so I went back to my Heroku Log-in and under the "Resources" section and noticed that it didn't automatically toggle it to the right to turn it on!
    How to turn Eco Dynos on for Heroku upgrade
    So, remember that you still have to go make sure it is turned on and toggled to the right side. After I did that, my API ends point worked again. JSON never looked so beautiful. All done!

Pro

There is one pro from this heroku-18 deprecation. There is a lot of APIs that I created and don't care to keep up with so when heroku-18 deprecates and all of my app names under those disappear, it is just cleaning out the trash for me. I'm only concerned with 2 sets APIs and I finished deploying the first one today with the upgrade and subscription (see my 8 steps above).

Con

The con from all of this change is I'm going to have invest and pay the $5 per month (I chose the cheapest plan called Eco and Basic) for the APIs that I want to still work on and also the additional $5 a month on top of that for the postgres database add on. 

Cost

It is going to take cost me $120 for this server and database to run on Heroku per year but since it is my main full stack portfolio piece, I'd like to keep it up on Heroku for now.

It took a good full 2 hours for me to read the documentation on upgrading, subscribing and adding on today on Heroku and to also go through my 8 steps above. I'm still a noob so it takes me longer than a pro, but I know if I decide to still do this for my second database, it'll be faster the next time around. I'm going to wait on the second one as I want to improve some elements beforehand before forking out more money.

At the start of this blog post, all of my API end points were down but now I can happily say that one set is working again. 

:) 

Eating Ramen Efficiently:

In : heroku 


Tags: how to upgrade to heroku-22  heroku free deprecation 

About Ninja Space Content


Ninja Space Content I have been building simple websites on my own since 2008 and currently run several websites at the moment, including this one. I used to be an account manager for an affiliate/e-commerce company, helping affiliates grow their sales so I have some knowledge on the business side and client side of affiliate marketing. Most recently, I decided to complete a JavaScript coding bootcamp and graduated in Dec 2020.
Note: links to resources and promoting special deals may allow me to earn a small commission from each sale.
Work Station Accessories