funkwhale/docs/administrator_documentation/upgrade_docs/debian.md

2.7 KiB

Upgrade your Debian Funkwhale installation

If you installed Funkwhale following the Debian guide, follow these steps to upgrade.

:::{dropdown} Upgrading to a new version of Python :icon: alert :color: warning

If you upgrade your Python version, you need to update your virtualenv. Python is updated with each new version of Debian.

To upgrade your virtualenv:

  1. Change to your api directory.

    cd /srv/funkwhale/api
    
  2. Rerun poetry install to reinstall your dependencies in a new virtualenv.

    poetry install
    

:::

Download the updated files

  1. SSH into your server.

  2. Log in as your funkwhale user.

    su funkwhale
    
  3. Navigate to your Funkwhale directory.

    cd /srv/funkwhale
    
  4. Stop the Funkwhale services.

    sudo systemctl stop funkwhale.target
    
  5. Export the Funkwhale version you want to update to. You'll use this in the rest of the commands in this guide.

    export FUNKWHALE_VERSION={sub-ref}`version`
    
  6. Download the API files for your chosen Funkwhale version.

    curl -L -o "api-$FUNKWHALE_VERSION.zip" "https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/$FUNKWHALE_VERSION/download?job=build_api"
    
  7. Extract the downloaded archive to a new directory.

    unzip "api-$FUNKWHALE_VERSION.zip" -o api_new
    
  8. Remove the old api directory and move the extracted directory to the api directory.

    rm -rf api/ && mv api_new api
    
  9. Remove the downloaded archive file.

    rm api-$FUNKWHALE_VERSION.zip
    

Update your Funkwhale instance

Once you have downloaded the new files, you can update your Funkwhale instance. To do this:

  1. Install or upgrade all OS dependencies using the dependencies script.

    sudo api/install_os_dependencies.sh install
    
  2. Enter the api directory to run the following commands.

    cd api
    
  3. Install all Python dependencies using poetry.

    poetry install
    
  4. Collect the new static files to serve.

    poetry run python manage.py collectstatic --no-input
    
  5. Apply new database migrations.

    poetry run python manage.py migrate
    
  6. Restart the Funkwhale services.

    sudo systemctl start funkwhale.target
    

That's it! You've updated your Funkwhale pod. You should now see the new version running in your web browser.