title: Close the Postgre DB connection and open a new connection with different DB ruby on rails
body: <p>I'm migrating the previous database to my new application I have a dump file imported from heroku and there are some tables missing in the dump file as well in almost every table there are some attributes missing so for this I'm creating a new database and imported the dump in that database, and when I imported that from that DB and close the connection so that I can create a new connection with the production database where I need to migrate the data the connection is closed but the instance variables which I stored the data from the previous database is also reset so can anybody tell me how to close the Postgre DB connection and open a new connection to a different PG DB without loosing the saved data fetched from previous DB to populate the second DB.</p>
  
  <p>I am using this to establish the connection</p>
  
  <pre><code> ActiveRecord::Base.establish_connection('DB')
  </code></pre>
  
  <p>and I'm using to close the DB connection</p>
  
  <pre><code> ActiveRecord::Base.clear_active_connections!
  </code></pre>
  
  <p>Please answer my question?</p>