Just upgraded #Pleroma, which Iโd been putting off for a while.
I had been using the packaged, โOTPโ, version of Pleroma, but it turned out the package is ancient, and it required an older cryptography library. Because Iโd upgraded to a newer version of #Ubuntu, the older crypto library had been removed and replaced with a newer version.
The whole process took maybe half an hour, and no more than 10 or so commands. Basically:
Stop Pleroma (so itโs not running while trying to backup/update): sudo systemctl stop pleroma.
Backup my instance.
First make a place to store the backup: mkdir -p ~/backup/pleroma. I made it (temporarily!) world-writable to make things easier: chmod 777 ~/backup/pleroma.
Backup the configuration: sudo cp /etc/pleroma/config.exs /home/saria/backup/pleroma.
Delete the Pleroma installation (actually, just put it to one side for now, just in case): sudo mv /opt/pleroma /home/saria/backup/pleroma/old-installation and sudo mv /etc/pleroma /home/saria/backup/pleroma/old-configuration.
Adjust stuff that differs between the OTP installation and the source installation.
Update the pleroma userโs home directory: sudo usermod -d /var/lib/pleroma pleroma (Here I got an error that the pleroma user was still running process 758. No problem, just sudo kill 758, then retry.)
Make the โnewโ locations: sudo mkdir - /opt/pleroma /var/lib/pleroma. (I think /var/lib/pleroma already existed, and was storing images and uploads, which was fine.)
Make the pleroma user the owner of those locations: sudo chown -R pleroma: /opt/pleroma /var/lib/pleroma.
Edit the configuration file config/prod.secret.exs, copying all the important stuff (passwords, salts, personal settings) from the old file at /home/saria/backup/pleroma/old-configuration/config.exs.
Run the database migration: sudo -Hu pleroma MIX_ENV=prod mix ecto.migrate.
Restart Pleroma: sudo systemctl start pleroma. I discovered (using sudo systemctl status pleroma) that Pleroma would not start. I realised that was because the systemd service file was still trying to start the old, OTP version. So I replaced the service file with the one from the source installation (sudo cp -f /opt/pleroma/installation/pleroma.service /etc/systemd/system/pleroma.service) and tried again. Now I got an error from systemd because the service file had changed, telling me I had to do systemd daemon-reload. So I did sudo systemd daemon-reload, and tried to start Pleroma again. Success! ๐ฆธ๐พโโ๏ธ
As you can see, I ran into some hiccups, but the documentation and error messages were clear enough that I was able to fix stuff and move on.
Now, I am no expert on any of this stuff! I know literally nothing about Erlang or Elixir (the languages/tools/whatever that Pleroma is made with). But as you can see, if you take the time to carefully read the documentation, and understand what each step is actually doing, itโs really not that hard! ๐ช๐พ