Note, my shell sets RAILS_ENV=production so I often skip that on a per-command bases, contra the official docs.
Be running as mastodon user: su - mastodon
Took a backup of postgres using my backup script notes :
Fetch the new commits: git fetch
Checkout the release: git checkout v4.1.0rc1
Install ruby dependencies: bundle install
Install js dependencies: yarn install
DB Migrations: bundle exec rails db:migrate
1 2 3 4
Migrating to BackfillAdminActionLogsAgain (20221206114142) == 20221206114142 BackfillAdminActionLogsAgain: migrating ===================== Scoped order is ignored, it's forced to be batch order. == 20221206114142 BackfillAdminActionLogsAgain: migrated (0.0952s) ============
mastodon@mastodon:~/live$ bundle exec rails assets:precompile yarn install v1.22.19 [1/6] Validating package.json... [2/6] Resolving packages... success Already up-to-date. Done in 1.56s. Compiling... Compiled all packs in /home/mastodon/live/public/packs
Worked this time.
Restart all mastodon processes: (exit to root first) systemctl restart mastodon-*
Notes for next time
Probably should stop mastodon processes during the upgrade. Theres an extended
period where database and code could be mismatched due to how slow the install
process is on this machine. Incoming federation should be retried by the sender
if we are not up to receive.
This might also give some more breathing room to the install and compile steps.