forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 0
Update Mastodon from v2.8.0 to v2.8.1
kedama edited this page May 4, 2019
·
3 revisions
- update Mastodon v2.8.0 to v2.8.1
# cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.2 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
current-foresdon
is my customized branch. if your repository tracks the tootsuite/mastodon, you must run git checkout v2.8.1
instead of git pull
.
run as mastodon user:
$ cd ~/live
$ git fetch
$ git pull
$ bundle install
$ yarn install --pure-lockfile
$ RAILS_ENV=production bundle exec rails assets:precompile
add new environment variable GITHUB_REPOSITORY
into .env.production if needed.
GITHUB_REPOSITORY=kedamaDQ/mastodon
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
mount working volume if needed. run as root:
# mount /dev/vg001/lvtmp /mnt/tmp
backing up postgres and redis. run as root:
# cd /mnt/tmp
# sudo -u postgres pg_dumpall > foresdon.jp.190504.dump
# gzip foresdon.jp.190504.dump
# redis-cli lastsave
# redis-cli bgsave
# redis-cli lastsave
# cp /var/lib/redis/dump.rdb ./foresdon.jp.190504.dump.rdb
# gzip foresdon.jp.190504.dump.rdb
ℹ️ redis-cli lastsave
returns timestamp when last saving data to file. if timestamp changed after redis-cli bgsave
, saving is completed.
run as mastodon user:
$ cd ~/live
$ RAILS_ENV=production bundle exec rails db:migrate
run as root:
# systemctl start foresdon-sidekiq
# systemctl start foresdon-streaming
# systemctl start foresdon-web
run as mastodon user:
$ cd ~/live
$ RAILS_ENV=production bin/tootctl cache clear