-
Notifications
You must be signed in to change notification settings - Fork 0
Update Mastodon form v2.7.1 to v2.8.0
ℹ️ Because foresdon.jp is a customized Mastodon server, use v2.7.1 as update base.
- system update
- update Mastodon v2.7.1 to v2.8.0
create and mount a volume as a working area. Because already created the volume in my server, just only mount it in my case.
run as root:
# mount /dev/vg001/lvtmp /mnt/tmp
for ensuring empty area if need.
run as mastodon user:
$ rbenv versions
2.5.3
2.6.0
$ rbenv uninstall 2.5.3
rbenv: remove /home/mastodon/.rbenv/versions/2.5.3? [yN] y
$ cd ~/.rbenv/plugins/ruby-build
$ git fetch
$ git checkout v20190401
my $RUBY_CONFIGURE_OPTS is written in the ~/.bachrc.
ℹ️ ${TMPDIR}
is used as working area by ruby-build. default is '/tmp'.
$ cd ~
$ echo ${RUBY_CONFIGURE_OPTS}
--with-jemalloc
$ TMPDIR='/mnt/tmp' rbenv install 2.6.1
if you want to watch the installation progress:
$ tail -f /mnt/tmp/ruby-build.*.log
if there is no problem, check installed.
$ rbenv versions
2.6.0
2.6.1
i have changed the systemd service name. this is for don't stop services in production server with misunderstanding another environment servers.
run as root:
# systemctl stop foresdon-web
# systemctl stop foresdon-streaming
# systemctl stop foresdon-sidekiq
# cd /mnt/tmp
# sudo -u postgres pg_dumpall > foresdon.jp.190414.dump
# gzip foresdon.jp.190414.dump
# redis-cli lastsave
# redis-cli bgsave
# redis-cli lastsave
# cp /var/lib/redis/dump.rdb ./foresdon.jp.190414.dump.rdb
# gzip foresdon.jp.190414.dump.rdb
get backups to some other remote box with scp. get /home/mastodon/live/.env.production too if need.
ℹ️ redis-cli lastsave
returns timestamp when last saving data to file. if timestamp changed after redis-cli bgsave
, saving is completed.
run as root:
# systemctl poweroff
get snapshot of the vps volume and restart vps.
run as root:
# apt upgrade
# apt autoremove
# systemctl reboot
current-foresdon
is my customized branch. if your repository tracks the tootsuite/mastodon, you must checkout v2.8.0
instead of current-foresdon
.
run as mastodon user:
$ cd ~/live
$ git fetch
$ git checkout current-foresdon
$ gem update --system
$ bundle install
$ curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
$ yarn install --pure-lockfile
$ RAILS_ENV=production bundle exec rails assets:precompile
$ RAILS_ENV=production bundle exec rails db:migrate
run as root:
# systemctl start foresdon-sidekiq
# systemctl start foresdon-streaming
# systemctl start foresdon-web