documentation/content/en/admin/upgrading.md

56 lines
1.5 KiB
Markdown
Raw Normal View History

2018-09-26 00:51:12 +02:00
---
title: Upgrading to a new release
menu:
docs:
weight: 70
parent: admin
2018-09-26 00:51:12 +02:00
---
{{< hint style="info" >}}
2018-09-26 00:51:12 +02:00
When a new version of Mastodon comes out, it appears on the [GitHub releases page](https://github.com/tootsuite/mastodon/releases). Please mind that running unreleased code from the `master` branch, while possible, is not recommended.
{{< /hint >}}
2018-09-26 00:51:12 +02:00
Mastodon releases correspond to git tags. First, switch to the `mastodon` user:
```bash
2018-09-26 00:51:12 +02:00
su - mastodon
```
And navigate to the Mastodon root directory:
Download the releasess code, assuming that the version is called `v2.5.0`:
2018-09-26 00:51:12 +02:00
```bash
2018-09-26 00:51:12 +02:00
git fetch --tags
git checkout v2.5.0
```
**The release page contains a changelog, and below it, upgrade instructions**. This is where you would execute them, for example, if the release mentions that you need to re-compile assets, you would execute:
2018-09-26 00:51:12 +02:00
```bash
2018-09-26 00:51:12 +02:00
RAILS_ENV=production bundle exec rails assets:precompile
```
After you have executed all special release-specific instructions, the last thing remaining is restarting Mastodon. _Usually_ the streaming API is not updated, and therefore does not require a restart. Restarting the streaming API can lead to an unusually high load on the server, so it is advised to avoid it if possible.
2018-09-26 00:51:12 +02:00
2018-09-26 00:53:18 +02:00
Switch back to root:
```bash
2018-09-26 00:53:18 +02:00
exit
```
2018-09-26 00:51:12 +02:00
You would restart Sidekiq:
```bash
2018-09-26 00:51:12 +02:00
systemctl restart mastodon-sidekiq
```
And you would reload the web process to avoid downtime:
```bash
2018-09-26 00:51:12 +02:00
systemctl reload mastodon-web
```
**Thats all!** Youre running the new version of Mastodon now.