Skip to content

Instantly share code, notes, and snippets.

@defulmere
Created November 15, 2022 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save defulmere/2377e49a017d9d49a9753d9d37551c63 to your computer and use it in GitHub Desktop.
Save defulmere/2377e49a017d9d49a9753d9d37551c63 to your computer and use it in GitHub Desktop.
tl;dr mastodon upgrade from 3.5.3 to 4.0.2

Adapted from the official upgrade notes and starting with a v3.5.3 non-Docker source install:

# back everything up first, then as mastodon user
cd ~/live
git fetch && git checkout v4.0.2
# do next step only if you're stuck on ruby 3.0.3
sed -e -i 's/3.0.4/3.0.3/' .ruby-version
bundle install
yarn install
SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate
RAILS_ENV=production bundle exec rails assets:precompile

# restart everything as root
systemctl restart mastodon-streaming
systemctl restart mastodon-sidekiq
systemctl restart mastodon-web

# as mastodon user
RAILS_ENV=production bundle exec rails db:migrate

# restart everything again as root
systemctl restart mastodon-streaming
systemctl restart mastodon-sidekiq
systemctl restart mastodon-web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment