documentation/content/en/admin/upgrading.md

75 lines
2.6 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
2020-02-28 14:27:39 +01:00
Mastodon releases correspond to git tags. Before attempting an upgrade, look up the desired release on the [GitHub releases page](https://github.com/tootsuite/mastodon/releases). The page will contain a **changelog** describing everything you need to know about what's different, as well as **specific upgrade instructions**.
To begin, switch to the `mastodon` user:
2018-09-26 00:51:12 +02:00
```bash
2018-09-26 00:51:12 +02:00
su - mastodon
```
And navigate to the Mastodon root directory:
```bash
2020-02-28 14:27:39 +01:00
cd /home/mastodon/live
2018-09-26 00:51:12 +02:00
```
2020-02-28 14:27:39 +01:00
Download the releasess code, assuming that the version is called `v3.1.2`:
2018-09-26 00:51:12 +02:00
```bash
2020-02-28 14:27:39 +01:00
git fetch --tags
git checkout v3.1.2
2018-09-26 00:51:12 +02:00
```
2020-02-28 14:27:39 +01:00
Now execute the upgrade instructions that are included in that version's release notes on GitHub. Because different releases require different instructions, we do not include any instructions on this page.
2018-09-26 00:51:12 +02:00
2020-02-28 14:27:39 +01:00
{{< hint style="info" >}}
You can safely skip intermediate releases when upgrading from an old version. You do not need to individually check them out. However, you do need to keep track of the instructions with each release. Most instructions overlap, you just need to make sure you execute everything at least once.
{{< /hint >}}
After you have executed the instructions from the release notes, switch back to root:
2018-09-26 00:53:18 +02:00
```bash
2018-09-26 00:53:18 +02:00
exit
```
2020-02-28 14:27:39 +01:00
Restart **background workers**:
2018-09-26 00:51:12 +02:00
```bash
2018-09-26 00:51:12 +02:00
systemctl restart mastodon-sidekiq
```
2020-02-28 14:27:39 +01:00
And reload the **web process**:
2018-09-26 00:51:12 +02:00
```bash
2018-09-26 00:51:12 +02:00
systemctl reload mastodon-web
```
2020-02-28 14:27:39 +01:00
{{< hint style="info" >}}
The `reload` operation is a zero-downtime restart, also called "phased restart". As such, Mastodon upgrades usually do not require any advance notice to users about planned downtime. In rare cases, you can use the `restart` operation instead, but there will be a (short) felt interruption of service for your users.
{{< /hint >}}
Rarely, the **streaming API** server is also updated and requires a restart:
```bash
systemctl restart mastodon-streaming
```
2020-02-28 14:27:39 +01:00
{{< hint style="danger" >}}
The streaming API server is updated very rarely, and in most releases, does *not* require a restart. Restarting the streaming API leads to an increased load on your server as disconnected clients attempt to reconnect or poll the REST API instead, so avoid it whenever you can.
{{< /hint >}}
{{< hint style="success" >}}
**Thats all!** Youre running the new version of Mastodon now.
{{< /hint >}}