Upgrading Mastodon on FreeBSD

Update: On 2017-09-15 the FreeBSD Mastodon port, net-im/mastodon, was overhauled with version 1.6.0 to handle installation of Mastodon's node modules and assets. This installation guide has been updated to reflect those changes.

What follows in based on the official Mastodon release notes.

Stop the three Mastodon servers.
# service mastodon_web stop
# service mastodon_workers stop
# service mastodon_stream stop
Some special steps are required when upgrading from a version less than 1.6.0 to version 1.6.0 or greater. You should first delete the old mastodon package.
# pkg delete mastodon

Move the leftover files under Mastodon's installation directory out of the way, but keep your customized .env.production and nginx-include.conf and keep everything under public/system.

Install the new Mastodon package.
# pkg install mastodon
Upgrade your packages.
# pkg upgrade
Switch to the mastodon user.
# su - mastodon
Remove the old Gemfile.lock.
% rm Gemfile.lock
If you are upgrading for the first time from a version less than 1.4.3, an extra step needs to be run before the database migration.
% RAILS_ENV=production rails mastodon:maintenance:prepare_for_foreign_keys
If you are upgrading for the first time from a version less than 1.5.0, to enable Web Push notifications, you need to generate a few extra secrets and put them in .env.production.
% RAILS_ENV=production rake mastodon:webpush:generate_vapid_key
Check the release notes to see if the database migration script needs to be run for the new release.
% RAILS_ENV=production rails db:migrate
If you ran the database migration script, also clean out old preview cards thumbnails.
% RAILS_ENV=production rails mastodon:maintenance:remove_deprecated_preview_cards

Do a diff between nginx-include.conf.sample and nginx-include.conf to check for changes. Update nginx-include.conf if necessary.

Return to root privileges.

If you made changes to nginx-include.conf, reload the nginx configuration.
# service nginx reload
Finally, restart the Mastodon daemons.
# service mastodon_web start
# service mastodon_workers start
# service mastodon_stream start

Posted 2017-04-27 12:55 | Comments

Recent posts

Monthly Archives

Yearly Archives