Bacancy Bacancy
  • Customers

      Fortune 500 Clients

      Verizon
      Verizon
      Franklin Templeton
      Franklin Templeton
      The Container Store
      The Container Store
      KPMG
      KPMG
      Academy Sports & Outdoors
      Academy Sports & Outdoors
      Shell
      Shell
      Bangkok Bank Ltd
      Bangkok Bank Ltd
      The Children's Place
      The Children's Place
      Edward Jones
      Edward Jones
      United Parcel Service
      United Parcel Service
      AdviceWorks
      AdviceWorks
      NatWest Markets
      NatWest Markets
      Bridgestone
      Bridgestone

      Technologies

      React JS VueJS Angular JS React Native Flutter Full Stack
      Ruby on Rails Node JS Golang AI & ML Data Science Java
      Python Salesforce DevOps Block Chain Mobile App Embedded & Hardware
      Explore All
      skype-icon

      Skype ID

      bacancy
      gmail-icon

      Email Us

      [email protected]
      call-yellow-icon

      USA

      +1 347 441 4161
      wp-icon

      Canada

      +1 416 907 6738
  • what we do

      Experience

      Digital Workplace Services Product Enhancement

      Insights

      AI & Automation Data Analytics

      Innovate

      Blockchain Software Engineering Services Internet of Things (IoT) Data Science Artificial Intelligence Machine Learning

      Accelerate

      Cloud - Bacancy Combalt Digital Process Automation Open Source Microsoft Dynamics Salesforce

      Assure

      Quality Assurance IT Staff Augmentation

      Embedded & Hardware

      Product Engineering Analog Design Services FPGA Engineering Service Wireless Design Embedded Software Design

      not list

      Hardware Engineering Power Engineering IoT Hardware
      skype-icon

      Skype ID

      bacancy
      gmail-icon

      Email Us

      [email protected]
      call-yellow-icon

      USA

      +1 347 441 4161
      wp-icon

      Canada

      +1 416 907 6738
  • who we work with

      Industries

      Banking Financial services & Insurance Startups Oil & Gas

      not list

      Healthcare Life Science Real Estate & Construction Logistics
      bacancy

      Let’s grow together Partner with us

      get quote
      skype-icon

      Skype ID

      bacancy
      gmail-icon

      Email Us

      [email protected]
      call-yellow-icon

      USA

      +1 347 441 4161
      wp-icon

      Canada

      +1 416 907 6738
  • about us

      Culture

      Agile Mindset Bacancy Values Bacancy Culture

      About Company

      About Us Leadership Team Awards & Recognition Infrastructure

      not list

      Customer Reviews Our Locations Partnership Media Coverage

      WE ARE

      GREAT PLACE TO WORK - CERTIFIEDTM

      Building and sustaining High-Trust, High-Performance CultureTM

      Bacancy Great Place to Work
      skype-icon

      Skype ID

      bacancy
      gmail-icon

      Email Us

      [email protected]
      call-yellow-icon

      USA

      +1 347 441 4161
      wp-icon

      Canada

      +1 416 907 6738
  • technology

      Front End

      Angular Reactjs Vue.js UI/UX

      Platforms

      MS Dynamics Salesforce

      Back End

      Ruby on Rails Node.js Golang Laravel .NET Java Python

      Mobile

      React Native Flutter Android iOS

      Cloud

      AWS DevOps

      QA

      Automation Testing Software Testing

      Embedded & Hardware

      Embedded
      bacancy

      World-class expertise,Delivered

      get quote
      Explore All
      skype-icon

      Skype ID

      bacancy
      gmail-icon

      Email Us

      [email protected]
      call-yellow-icon

      USA

      +1 347 441 4161
      wp-icon

      Canada

      +1 416 907 6738
  • PRODUCTS

      EV Products

      Battery Management System Motor Controller AC Charger Explore All

      not list

      CCS2 Controller DC Fast Charger AC Charge Controller
      bacancy

      Let’s grow together Partner with us

      get quote
      skype-icon

      Skype ID

      bacancy
      gmail-icon

      Email Us

      [email protected]
      call-yellow-icon

      USA

      +1 347 441 4161
      wp-icon

      Canada

      +1 416 907 6738
hire developers

Bacancy

Bacancy represents the connected world, offering innovative and customer-centric information technology experiences, enabling Enterprises, Associates and the Society to Rise™.

12+

Countries where we have happy customers

1050+

Agile enabled employees

06

World wide offices

10+

Years of Experience

05

Agile Coaches

14

Certified Scrum Masters

1000+

Clients projects

1458

Happy customers

  • Customers
      Technologies
      • React JS
      • Angular JS
      • Vue JS
      • Node JS
      • AI & ML
      • Explore All
      Fortune 500 Clients
      • Verizon
      • The Container Store
      • KPMG
      • Academy Sports & Outdoors
      • Bangkok Bank Ltd
      • The Children's Place
      • Edward Jones
      • Franklin Templeton
      • AdviceWorks
      • NatWest Markets
      • Bridgestone
      • United Parcel Service
  • What we do
      Experience
      • Digital Workplace Services
      • Product Enhancement
      Insights
      • AI & Automation
      • Data Analytics
      Innovate
      • Blockchain
      • Software Engineering Services
      • Internet of Things (IoT)
      Accelerate
      • Cloud - Bacancy Combalt
      • Digital Process Automation
      • Open Source
      • Microsoft Dynamics
      • Salesforce
      • Service Experience Transformation
      Assure
      • Testing
      • Resource Augmentation
      Embedded & Hardware
      • Product Engineering
      • Analog Design Services
      • FPGA Engineering Service
      • Wireless Design
      • Embedded Software Design
      • Hardware Engineering
      • Power Engineering
      • IoT Hardware
      • AL/ML
  • who we work with
      Industries
      • Banking Financial services & Insurance
      • Startups
      • Oil & Gas
      • Healthcare Life Science
      • Real Estate & Construction
      • Logistics
  • About Us
      About Company
      • About Us
      • Leadership Team
      • Awards & Recognition
      • Infrastructure
      • Our Locations
      • Partnership
      Culture
      • Agile Mindset
      • Bacancy Values
      • Bacancy Culture
  • Technology
      Front End
      • Angular
      • Reactjs
      • Vue.js
      • UI/UX
      Platforms
      • MS Dynamics
      • Salesforce
      Back End
      • Ruby on Rails
      • Node.js
      • Golang
      • Laravel
      • .NET
      • Java
      • Python
      Mobile
      • React Native
      • Flutter
      • Android
      • iOS
      Cloud
      • AWS
      • DevOps
      QA
      • Automation Testing
      • Software Testing
      Embedded & Hardware
      • Embedded
      Explore All
  • Products
    • Battery Management System
    • Motor Controller
    • CCS2 Controller
    • AC Charger
    • DC Fast Charger
    • AC Charge Controller
    • Explore All
  • Careers
  • Work @ Bacancy
  • Blogs
  • Resources
  • Customer Reviews
  • Contact
  • Get Quote
Heroku and Rails

How to Upgrade Your Database Plan on Heroku and Rails Setup?

Viral Parekh
Viral Parekh Technical Writer
Last Updated on March 18, 2021
December 21, 2020 4 min read

Ruby on Rails is a very established web framework, and Heroku is a platform as a service that offers for building, running, and operating the applications in the cloud itself.

Since you are reading this, I assume either you have some horrifying task of playing with the production database or are just curious! So let’s get right into it.

This method works on any Postgres plan you have on Heroku.

Follow these 09 steps to upgrade your plan on Heroku and Rails set up and experience how things work wonders.

===========================================================================================================

Step 1: Firing up your Heroku App Console

This step is for absolute beginners; the complete process will be done on Heroku Rails Console.
For accessing your console, use this command :

heroku run rails c --app your-app-name

===========================================================================================================

Step 2: Backing Up Current Database

Perhaps the most important thing you should never forget is to ensure that your current database is safe. Therefore we will start with backing up your database and then downloading it. For this process, use these commands in your console.

heroku pg:backups:capture --app your-app-name
heroku pg:backups:download --app your-app-name

===========================================================================================================

Step 3: Get your application’s current information.

Since we are done with backing up the database, now we need the current information of the application regarding Postgres.

pg:info command comes in handy here.

I would suggest saving the output of this as it will be helpful later.

heroku pg:info --app your-app-name

===========================================================================================================

Step 4: Creating your new database

After you get the information from Postgres, you need to create another database with a required plan ( for me, it’s hobby-basic ). Find the command below:

// use pg:wait command to notify you when provisioning ( database creation ) is complete. //

heroku pg:wait --app your-app-name

> HEROKU_POSTGRESQL_SILVER_URL //Sample o/p – your’s can be different

===========================================================================================================

Step 5: Enter maintenance mode

Until now, all the above processes didn’t affect your current database, but now we will be copying all the data from our existing database to the newly created database. Since we don’t miss out on any entries, we have to take down our website. Yes, I feel sad too.

//Scaling workers to 0 to ensure that delay jobs don’t write to our database. //

heroku ps:scale worker=0 --app your-app-name

//Entering maintenance mode

Heroku maintenance:on --app your-app-name

===========================================================================================================

Step 6: Transfer data from old DB to new DB

//This command copies all the content from DATABASE_URL(Current Database name which you will find in pg:info command ) to HEROKU_POSTGRESQL_SILVER_URL

heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_SILVER_URL --app your-app-name

//Enter app name again to confirm when it prompts.

your-app-name

===========================================================================================================

Step 7: Promote the new DB / connect the DB to live

Since we have copied all the data to the new database and are ready to use it, we need to promote it. It means we are attaching this newly created database as a primary database to our application.

Heroku pg:promote HEROKU_POSTGRESQL_SILVER_URL --app your-app-name

===========================================================================================================

Step 8: Exit maintenance mode

Everything is done, and our newly created database is ready to use. Now it’s time to bring our app back to life. I love this step 3000. At this point, anxiety must be kicking in along with that smirk of hoping it will work; anyway, let’s get this thing running. To do so, follow me.

//Scaling workers to 1 to ensure workers start writing to the database

heroku ps:scale worker=1 --app your-app-name

// Finally exiting maintenance mode

heroku maintenance:off --app your-app-name

===========================================================================================================

Step 9: Deprovisioning old database

Since we have moved to our new database and don’t need the old database anymore, we can delete it. Follow this to achieve it.

( Not mandatory )

You can use this database as a follower too.

heroku addons:destroy HEROKU_POSTGRESQL_CRIMSON_URL --app your-app-name

Run pg:info command to find your application’s database url, HEROKU_POSTGRESQL_CRIMSON_URL in my case.

===========================================================================================================

But wait. There’s more!

Bonus: Add follower database

To add a follower database, use this in step 3

heroku addons:create heroku-postgresql:standard-0 --follow DATABASE_URL --app your-app-name

===========================================================================================================

So, this was all about how to upgrade your database plan on Heroku and Rails setup. I hope you have understood it pretty well. I have tried my best to go through Heroku’s official documentation and bring this blog to you.

If you are looking for expert Ruby on Rails developers who are well-versed with Ruby on Rails development services and following best Ruby on rails practices, then get in touch with Bacancy Technology today. A globally-renowned Ruby on Rails allows you to hire dedicated Ruby on Rails developers at your convenience and ease. Connect with us to know more about full-stack Ruby on Rails expertise on JSON Standards, MVC architecture, OOPs concepts, HTML, CSS, and JQuery.


Expand Your Digital Horizons With Us.

Start a new project or take an existing one to the next level. Get in touch to start small, scale-up, and go Agile.


Or
E-mail us : [email protected]

Your Success Is Guaranteed !

Related Articles

ruby on rails for fintech
Paridhi Wadhwani

March 17, 2023

Ruby on Rails

Ruby on Rails for FinTech App: Accelerating Business

By : Paridhi Wadhwani

Quick Summary: Want to build a breakthrough application in the FinTech domain? Ensure that the backend technology is robust, secure, and scalable. Ruby on Rails...

10 Minute Read
Read More
Ruby on Rails Statistics and Facts
Paridhi Wadhwani

February 27, 2023

Ruby on Rails

Ruby on Rails Statistics and Facts 2023

By : Paridhi Wadhwani

Preface Ruby on Rails is a popular choice for startup companies and small businesses due to its ease of use, rapid development capabilities, and low...

8 Minute Read
Read More
Hotwire Rails
Paridhi Wadhwani
Isha Gupta

January 30, 2023

Ruby on Rails

How to Use Hotwire Rails: Getting Started Tutorial

By : Paridhi Wadhwani & Isha Gupta

Introduction We are back with another exciting and much-talked-about Rails tutorial on how to use Hotwire with the Rails application. This Hotwire Rails tutorial is...

10 Minute Read
Read More
india India (HQ)

Corporate House
15-16, Times Corporate Park, Thaltej, Ahmedabad, Gujarat 380059

USA USA

601 Brickell Key Drive, Suite 700, Miami, Florida, 33131, USA

canada Canada

71 Dawes Road, Brampton, On L6X 5N9, Toronto

australia-flag Australia

351A Hampstead Rd, Northfield SA 5085

UAE UAE

1608 Clover Bay, Business Bay, Dubai, UAE. PO Box 62049

sweden Sweden

Junkergatan 4, 126 53 Hagersten


Great Place to Work
Get in Touch
call-yellow-icon

Contact Number

+1 347 441 4161

gmail-icon

Email Us

[email protected]


  • Bacancy Behance
  • Bacancy Uplabs
  • Bacancy Pinterest
  • Brochure
  • Quality Assurance
  • Resources
  • Tutorials
  • Customer Reviews
  • Privacy Policy
  • FAQs
  • Contact Us
  • Sitemap
  • Employee
bacancy google review 4.6
bacancy google review
bacancy glassdoor review 4.5
bacancy glassdoor review
bacancy clutch review 4.8
bacancy clutch review
bacancy goodfirms review 4.5
bacancy goodfirms review
X

Get Our Newsletter

Be The First To Get The Latest Updates And Tutorials.

Request A Free Consultation

Before You Go...

Try our free consultation to visualize the best outcome of your business ideas.

INSTANT 30 MIN FREE CONSULTATION CALL