Rails 6 to Rails 8 Upgrade and Deployment Through Kamal
This is a list of all the files added, modified, or deleted as part of the upgrade from Rails 6 to Rails 8, from MySQL to SQLite, and from hand deployed to Kamal deployed. I did not list application specific files if they did not require modifications to facilitate the upgrade. It's probably missing a few steps but it's what I can remember / find in my .zsh_history file.
I hope you find this helpful.
You can view the actual commits at https://github.com/smhauck/ProjectUseful/commits/main/. See the listing at the end of the page.
I hope you find this helpful.
You can view the actual commits at https://github.com/smhauck/ProjectUseful/commits/main/. See the listing at the end of the page.
COMMANDS
(in approximate order)
bundle add kamal rails app:upgrade yarn install --immutable rails credentials:edit rails db:system:change --to=sqlite3 bundle add solid_queue rails solid_queue:install
ADDED
Many of these files had to be copied from a clean Rails 8 app.
.dockerignore.kamal/* .kamal/hooks/docker-setup.sample .kamal/hooks/post-app-boot.sample .kamal/hooks/post-deploy.sample .kamal/hooks/post-proxy-reboot.sample .kamal/hooks/pre-app-boot.sample .kamal/hooks/pre-build.sample .kamal/hooks/pre-connect.sample .kamal/hooks/pre-deploy.sample .kamal/hooks/pre-proxy-reboot.sample .kamal/secrets app/assets/stylesheets/application.bootstrap.scss app/javascript/application.js app/javascript/controllers/application.js app/javascript/controllers/hello_controller.js app/javascript/controllers/index.js app/views/layouts/_navbar.html.erbbin/brakeman bin/dev bin/docker-entrypoint bin/jobs bin/kamal bin/rubocop bin/thrustconfig/cache.yml config/credentials.yml.enc config/deploy.ymlconfig/queue.yml config/recurring.yml Dockerfile log/.keep Procfile.dev storage/.keep
MODIFIED
Many of the modifications in these files had to be copied from a clean Rails 8 app. Other changes had to be hand edited.
app/controllers/pages_controller.rb app/views/layouts/application.html.erb bin/setup config/application.rb config/boot.rb config/environments/development.rb config/environments/production.rb config/environments/test.rb config/initializers/assets.rb config/initializers/content_security_policy.rb config/initializers/filter_parameter_logging.rb config/initializers/inflections.rb config/initializers/version.rb config/puma.rb
Add to .ruby-version
3.4.1
Add to bin/rails
APP_PATH = File.expand_path("../config/application", __dir__) require_relative "../config/boot" require "rails/commands"
Add to bin/setup
# Install JavaScript dependencies system("yarn install --check-files")
Add to app/controllers/pages_controller.rb
def index end
Add to config/routes.rb
get "up" => "rails/health#show", as: :rails_health_check get "pages/index" root 'pages#index'
Add to Gemfile
gem 'bootsnap' gem 'cssbundling-rails' gem "image_processing", "~> 1.2" gem 'kamal', require: false gem 'jbuilder' gem 'jsbundling-rails' gem 'loofah', '~> 2.21' gem 'propshaft' gem 'puma', '>= 5.0' gem 'rails', '>= 8.0.2' gem 'rails-html-sanitizer', '>= 1.6' gem "solid_cache" gem "solid_queue" gem "solid_cable" gem "sqlite3", ">= 2.1" gem 'thruster', require: false gem 'turbo-rails' gem 'stimulus-rails'
Remove from .ruby-version
2.6.6
Remove from bin/rails
APP_PATH = File.expand_path('../config/application', __dir__) require_relative '../config/boot' require 'rails/commands'
Remove from config/routes.rb
get "welcome/index" root 'welcome#index'
Remove from Gemfile
gem 'bootstrap', '~> 4.3.1' gem 'carrierwave' gem 'coffee-rails', '~> 4.2' gem 'jbuilder', '~> 2.5' gem 'jquery-rails' gem 'loofah', '~> 2.19.1' gem 'mysql2' gem 'puma', '~> 3.7' gem 'rails', '~> 6.1', '>= 6.1' gem 'rails-html-sanitizer', '~> 1.4.3' gem 'sass-rails', '~> 5.0' gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' gem 'sprockets', '~> 3.7.2' gem 'turbolinks', '~> 5' gem "webpacker"
REMOVED
config/spring.rb app/assets/config/manifest.js app/assets/javascripts/application.js app/assets/javascripts/jquery-ui.min.js app/assets/javascripts/jquery.tablesorter.js app/assets/javascripts/tinymce/* app/assets/javascripts app/assets/stylesheets/application.scss config/initializers/application_controller_renderer.rb config/initializers/backtrace_silencers.rb config/initializers/cookies_serializer.rb config/initializers/mime_types.rb config/initializers/new_framework_defaults_5_2.rb config/initializers/secret_token.rb config/initializers/session_store.rb config/initializers/wrap_parameters.rb package-lock.json
List of commits
66203dc
dbc7d63
cb556d1
6586c3b
9b9f8e4
b43beb4
0781ab6
59252a1
6fa6723
0293da1
f8cf76c
ee017d9
60342d3
85cdf1d
2406d2d
25b9f6c
ecfbc0a
257b2ba
af8e794
3d99c4d
fbfdb4e
55d67cf
0c48c5c
3018d51
3c7413a
034c8ae
decf900
0392be9
6b7e114
f212320
0c75ad7
a542669
ecff695
a6ee45d
2c08d97
d6197c2
7d243c8
9ca2bf0