index.rst 4.25 KB
Newer Older
Reg's avatar
Reg committed
1
Upgrading your Funkwhale instance to a newer version
2
3
4
5
====================================================

.. note::

6
7
8
9
    Before upgrading your instance, we strongly advise you to make at least a database backup. Ideally, you should make a full backup, including
    the database and the media files.

    We're commited to make upgrade as easy and straightforward as possible,
Reg's avatar
Reg committed
10
    however, Funkwhale is still in development and you'll be safer with a backup.
11

12

13
14
15
16
17
18
19
20
Reading the release notes
-------------------------

Please take a few minutes to read the :doc:`changelog`: updates should work
similarly from version to version, but some of them may require additional steps.
Those steps would be described in the version release notes.


21
22
23
24
25
26
27
28
29
30
31
32
Insights about new versions
---------------------------

Some versions may be bigger than usual, and we'll try to detail the changes
when possible.

.. toctree::
   :maxdepth: 1

   0.17


33
Docker setup
34
------------
35
36
37
38
39
40
41
42
43
44

If you've followed the setup instructions in :doc:`Docker`, upgrade path is
easy:

.. parsed-literal::

    cd /srv/funkwhale
    # hardcode the targeted version your env file
    # (look for the FUNKWHALE_VERSION variable)
    nano .env
45
46
47
    # Load your environment variables
    source .env
    # Download newest nginx configuration file
Eliot Berriot's avatar
Eliot Berriot committed
48
49
    curl -L -o nginx/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/develop/deploy/docker.nginx.template"
    curl -L -o nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/develop/deploy/funkwhale_proxy.conf"
50
51
52
53
54
55
56
    # Pull the new version containers
    docker-compose pull
    # Apply the database migrations
    docker-compose run --rm api python manage.py migrate
    # Relaunch the containers
    docker-compose up -d

57
58
59
60
61
62
63
64
.. warning::

    You may sometimes get the following warning while applying migrations::

        "Your models have changes that are not yet reflected in a migration, and so won't be applied."

    This is a warning, not an error, and it can be safely ignored.
    Never run the ``makemigrations`` command yourself.
65
66


67
Non-docker setup
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
----------------

Upgrade the static files
^^^^^^^^^^^^^^^^^^^^^^^^

On non-docker setups, the front-end app
is updated separately from the API. This is as simple as downloading
the zip with the static files and extracting it in the correct place.

The following example assume your setup match :ref:`frontend-setup`.

.. parsed-literal::

    # this assumes you want to upgrade to version "|version|"
    export FUNKWHALE_VERSION="|version|"
    cd /srv/funkwhale
Eliot Berriot's avatar
Eliot Berriot committed
84
    sudo -u funkwhale curl -L -o front.zip "https://dev.funkwhale.audio/funkwhale/funkwhale/builds/artifacts/$FUNKWHALE_VERSION/download?job=build_front"
85
86
    sudo -u funkwhale unzip -o front.zip
    sudo -u funkwhale rm front.zip
87
88
89

Upgrading the API
^^^^^^^^^^^^^^^^^
90

91
On non-docker, upgrade involves a few more commands. We assume your setup
92
match what is described in :doc:`/installation/debian`:
93
94
95
96

.. parsed-literal::

    # this assumes you want to upgrade to version "|version|"
97
    export FUNKWHALE_VERSION="|version|"
98
99
100
    cd /srv/funkwhale

    # download more recent API files
Eliot Berriot's avatar
Eliot Berriot committed
101
    sudo -u funkwhale curl -L -o "api-$FUNKWHALE_VERSION.zip" "https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/$FUNKWHALE_VERSION/download?job=build_api"
102
    sudo -u funkwhale unzip "api-$FUNKWHALE_VERSION.zip" -d extracted
103
104
    sudo -u funkwhale rm -rf api/ && mv extracted/api .
    sudo -u funkwhale rm -rf extracted
105
106
107

    # update os dependencies
    sudo api/install_os_dependencies.sh install
108
    sudo -u funkwhale -E /srv/funkwhale/virtualenv/bin/pip install -r api/requirements.txt
109
110

    # collect static files
111
112
113
114
115
116
117
    sudo -u funkwhale -E /srv/funkwhale/virtualenv/bin/python api/manage.py collectstatic --no-input

    # stop the services
    sudo systemctl stop funkwhale.target

    # apply database migrations
    sudo -u funkwhale -E /srv/funkwhale/virtualenv/bin/python api/manage.py migrate
118
119

    # restart the services
120
    sudo systemctl start funkwhale.target
121
122
123
124
125
126
127
128
129

.. warning::

    You may sometimes get the following warning while applying migrations::

        "Your models have changes that are not yet reflected in a migration, and so won't be applied."

    This is a warning, not an error, and it can be safely ignored.
    Never run the ``makemigrations`` command yourself.