Mastodon upgrade workflow

This is the manual upgrade workflow for mementomori.social.

This document is outdated and being replaced by automation. See repo: mementomori-social/upgrade-workflow-automation.

Test on the development environment

Start with logging in as the right user on your local Linux development environment.

sudo su - mastodon
cd /opt/mastodon

This branch is 45 commits behind mastodon/mastodon:main.

Steps

  1. Go to GitHub

  2. Take note: "This branch is X commits behind mastodon/mastodon:main", add note to part above.

  3. Sync fork with main

  4. Fetch all changes:

git fetch --all
  1. Checkout main, build and test:

yarn cache clean && git checkout main && git pull
# If needed, install whatever version is needed in this point
rbenv install 3.3.4
bundle install && yarn install && RAILS_ENV=production bundle exec rails assets:precompile

This is an alias for:

  1. Check migrations:

  1. Migrate:

  1. If needs manual migrations, add:

  1. After migrations you might need to clear cache before restart:

  1. Test:

  1. Reset search index (on dev first: sudo service elasticsearch start):

  1. Rebuild search index:

  1. Restart all services:

  1. Create new branch for new version based on fresh main/tag:

  1. Attempt to merge previous branch:

  1. If it doesn't work with merge: Check the mods from last working branch, apply them on top of the branch and push the new working branch.

  2. Update version:

  1. Recompile:

  1. It's good to clear cache sometimes:

  1. Start Elasticsearch on dev:

  1. Reset search index (on dev first: sudo service elasticsearch start):

  1. If needed, build index for search:

  1. Restart:

  1. It's now time to test (If you see "Oops!An unexpected error occurred.", it is completely okay because we don't have access to the outside world.)

  2. When everything works, push changes to git:

  1. Set upstream when asked.

Install on production

  1. When everything works properly, login to mementomori.social on mastodon user.

  2. Backup first:

  1. Fetch changes:

  1. Check that all changes are there:

  1. Update version:

  1. Rebuild:

  1. Migrate:

  1. Clear cache:

  1. Run immediately:

  1. Open debug log:

  1. Or monitor fatals:

  1. Done!

Last updated