@saria@social.saria.fun avatar

saria

@saria@social.saria.fun

๐Ÿงš๐Ÿพโ€โ™€๏ธ

This profile is from a federated server and may be incomplete. Browse more on the original instance.

saria, to fediverse
@saria@social.saria.fun avatar

Just upgraded , 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 , the older crypto library had been removed and replaced with a newer version.

I found all this out when I tried to upgrade and got an error, searched for the error text, and found the bug report with a detailed explanation of the problem and solution.

So, I just backed up my instance, removed the OTP version of Pleroma, and re-installed it directly from the source repository.

The whole process took maybe half an hour, and no more than 10 or so commands. Basically:

  1. Stop Pleroma (so itโ€™s not running while trying to backup/update): sudo systemctl stop pleroma.
  2. Backup my instance.
    1. 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.
    2. Backup the database: sudo -Hu postgres pg_dump -d pleroma --format=custom -f /home/saria/backup/pleroma/pleroma.pgdump.
    3. Backup the configuration: sudo cp /etc/pleroma/config.exs /home/saria/backup/pleroma.
  3. 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.
  4. Adjust stuff that differs between the OTP installation and the source installation.
    1. 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.)
    2. 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.)
    3. Make the pleroma user the owner of those locations: sudo chown -R pleroma: /opt/pleroma /var/lib/pleroma.
  5. Change to the pleroma direcory: cd /opt/pleroma.
  6. Download pleroma: sudo -Hu pleroma git clone -b stable <a href="https://git.pleroma.social/pleroma/pleroma" rel="ugc">https://git.pleroma.social/pleroma/pleroma</a> /opt/pleroma.
  7. Build pleroma.
    1. Get the dependencies: sudo -Hu pleroma mix deps.get.
    2. Run the build: sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen.
  8. Configure pleroma.
    1. Copy the generated configuration file: sudo -Hu pleroma mv config/generated_config.exs config/prod.secret.exs.
    2. 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.
  9. Run the database migration: sudo -Hu pleroma MIX_ENV=prod mix ecto.migrate.
  10. 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! ๐Ÿ’ช๐Ÿพ

@selfhosted

  • All
  • Subscribed
  • Moderated
  • Favorites
  • โ€ข
  • megavids
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • GTA5RPClips
  • Youngstown
  • mdbf
  • osvaldo12
  • slotface
  • everett
  • rosin
  • modclub
  • kavyap
  • DreamBathrooms
  • anitta
  • vwfavf
  • Durango
  • cisconetworking
  • ethstaker
  • cubers
  • khanakhh
  • tester
  • ngwrru68w68
  • tacticalgear
  • normalnudes
  • provamag3
  • Leos
  • JUstTest
  • All magazines