# Suggestions re upgrading an old app

**URL:** <https://discuss.rubyonrails.org/t/suggestions-re-upgrading-an-old-app/84889>\
**Category:** rubyonrails-talk\
**Created:** [February 15, 2024, 8:32am UTC](https://discuss.rubyonrails.org/t/suggestions-re-upgrading-an-old-app/84889 "2024-02-15T08:32:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dave\_Porter](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/dave_porter/32/4031_2.png) [@Dave\_Porter](https://discuss.rubyonrails.org/u/Dave_Porter)\
**Post date:** [February 15, 2024, 8:32am UTC](https://discuss.rubyonrails.org/t/suggestions-re-upgrading-an-old-app/84889/1 "2024-02-15T08:32:17Z")

</div>

Hi there, I had an attempt to do this a while back, but left an app at 4.2.8 for the time being. So I thought I would try again getting it up to 7.1 The app is fairly simple (most crud with some basic logic). If I create a new 7.1 app and point it to the database on Heroku, what is the best way to get the schema up to date, so that future db changes can be done ? TIA, Dave

---

<div class="post-metadata">

**Author:** ![D-system](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/d-system/32/10998_2.png) [@D-system](https://discuss.rubyonrails.org/u/D-system)\
**Post date:** [February 16, 2024, 6:19am UTC](https://discuss.rubyonrails.org/t/suggestions-re-upgrading-an-old-app/84889/2 "2024-02-16T06:19:28Z")

</div>

When you point a new application to an existing database then run `rails db:migrate` it will populate the `db/schema.rb` with any syntax change.

---

<div class="post-metadata">

**Author:** ![Dave\_Porter](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/dave_porter/32/4031_2.png) [@Dave\_Porter](https://discuss.rubyonrails.org/u/Dave_Porter)\
**Post date:** [February 16, 2024, 6:32am UTC](https://discuss.rubyonrails.org/t/suggestions-re-upgrading-an-old-app/84889/3 "2024-02-16T06:32:32Z")

</div>

Thanks Thomas, So do you mean I copy over all the files from the migrate folder from the current version ? Dave

---

<div class="post-metadata">

**Author:** ![D-system](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/d-system/32/10998_2.png) [@D-system](https://discuss.rubyonrails.org/u/D-system)\
**Post date:** [February 16, 2024, 1:00pm UTC](https://discuss.rubyonrails.org/t/suggestions-re-upgrading-an-old-app/84889/4 "2024-02-16T13:00:07Z")

</div>

The migration files are here to change the database schema but you already have a database up and running. So no need to copy over the migration file. Also, if you start a database from zero, I would recommend you to use `rails db:schema:load` that will use the ` db/schema.rb` to create tables and columns.

---

<div class="post-metadata">

**Author:** ![ESouza](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/esouza/32/11307_2.png) [@ESouza](https://discuss.rubyonrails.org/u/ESouza)\
**Post date:** [February 16, 2024, 7:09pm UTC](https://discuss.rubyonrails.org/t/suggestions-re-upgrading-an-old-app/84889/5 "2024-02-16T19:09:14Z")

</div>

Hello Dave,

Can you provide a little more context we might be able to help you more. Have you tried updating the current app? I would suggest doing an incremental upgrade until you get to the latest Rails you want.

---

<div class="post-metadata">

**Author:** ![Dave\_Porter](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/dave_porter/32/4031_2.png) [@Dave\_Porter](https://discuss.rubyonrails.org/u/Dave_Porter)\
**Post date:** [February 17, 2024, 6:09am UTC](https://discuss.rubyonrails.org/t/suggestions-re-upgrading-an-old-app/84889/6 "2024-02-17T06:09:05Z")

</div>

Thanks for all the help. So I tried going from my current 4.2 version to 5.0.7.2 When I enter Bundle update I get lots of failure messages such as:

> 

Bundler could not find compatible versions for gem “actionpack”: In Gemfile: rails (= 5.0.7.2) was resolved to 5.0.7.2, which depends on actionpack (= 5.0.7.2)

```
simple_form (~> 5.0, >= 5.0.2) was resolved to 5.0.3, which depends on
  actionpack (>= 5.0)

```

Bundler could not find compatible versions for gem “activemodel”: In Gemfile: rails (= 5.0.7.2) was resolved to 5.0.7.2, which depends on activemodel (= 5.0.7.2)

```
web-console was resolved to 1.0.1, which depends on
  activemodel (~> 4.0.0)

```

## I started to investigate what version I should configure each gem at, but found this hard to find specifically for 5.0.7.2 ? My gemfile before I started making changes other than the rails version! Appreciate further thoughts? Dave

source ‘[https://rubygems.org](https://rubygems.org)’

# Standard Rails gems

ruby ‘2.6.8’

# gem ‘rails’, ‘4.2.8’

gem ‘rails’, ‘5.0.7.2’ gem ‘sass-rails’, ‘~\> 5.0’ gem ‘uglifier’, ‘\>= 1.3.0’ gem ‘coffee-rails’, ‘~\> 4.1.0’ gem ‘jquery-rails’, “~\> 2.3.0” gem ‘momentjs-rails’, ‘\>= 2.9.0’ gem ‘bootstrap3-datetimepicker-rails’, ‘~\> 4.14.30’ gem ‘turbolinks’ gem ‘jbuilder’, ‘~\> 2.0’ gem ‘bootstrap-sass’ gem ‘devise’#gem ‘simple\_form’ gem “simple\_form”, “\>= 3.5.1” gem ‘unicorn’ gem ‘unicorn-rails’ gem ‘bootswatch-rails’ gem ‘kaminari’ gem ‘rails\_db’ gem “pundit” gem ‘rails\_12factor’ gem “puma”#gem ‘sqlite3’

# Use sqlite3 as the database for Active Record

#gem “rack”, “\>= 2.1.4”#gem “nokogiri” “1.12.3”

group :production do gem ‘pg’, ‘~\> 0.21’ end

group :development do gem ‘sqlite3’, ‘~\> 1.3.6’ gem ‘better\_errors’ gem ‘quiet\_assets’ gem ‘rails\_layout’ end

group :development, :test do#gem ‘sqlite3’ gem ‘byebug’ gem ‘web-console’, ‘~\> 2.0’#gem ‘spring’ end

---

<div class="post-metadata">

**Author:** ![Dave\_Porter](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/dave_porter/32/4031_2.png) [@Dave\_Porter](https://discuss.rubyonrails.org/u/Dave_Porter)\
**Post date:** [February 17, 2024, 8:55am UTC](https://discuss.rubyonrails.org/t/suggestions-re-upgrading-an-old-app/84889/7 "2024-02-17T08:55:03Z")

</div>

I managed to resolve this and the app is now updated to RoR 5 locally on my Mac. I found a discussion on github for bundler where someone had the same issue and they remarked out all the gems except rails, run bundle update which worked, then un-rem each gem one-by-one and bundle update again. A bit laborious, but it worked. Thanks for everyone’s help!
