What is the correct way to vacuum the database to gain free space for Pleroma?

My YunoHost server

Hardware: VPS bought online
YunoHost version: (stable)
I have access to my server : Through SSH | through the webadmin |
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
If your request is related to an app, specify its name and version: Pleroma 2.5.5~ynh1

Description of my issue

Hello! When attempting to upgrade to the latest Pleroma version I ran into a problem : I don’t have enough space on the server to be able to make a backup, so yunohost is unable to continue with the upgrade.

I noticed that my server has grown from around 8-9GB to about 13GB. I am not storing remote media. I have now lowered remote post retention time to a minimum. But I learned from pleroma support IRC channel that I can free up already-used space by vacuuming the database. 'Do a ‘VACUUM FULL’, they told me.

I am assuming that I should be able to reduce the used space to something around 9 or 10GB by doing this. Pleroma official documentation gives two alternative ways to vacuum the database (I am looking at Database maintenance tasks - Pleroma Documentation and Database maintenance tasks - Pleroma Documentation) They specify instructions for OTP installations and from-source installations.

As far as I understood Pleroma on yunohost does not belong to these two categories. I have two questions :

  1. Is is possible to do a vacuum full in my case, (manually) and gain space?

  2. What is the correct way to do it with a Pleroma installation on yunohost?

Thanks and best regards,

  1. Yes.

  2. Here’s how:

Since Pleroma uses packaging v2, you can now open a shell into the app’s environment and follow most of the standard OTP instructions:

yunohost app shell pleroma
./bin/pleroma_ctl database vacuum full

Thank you very much! :slight_smile:

Should I stop Pleroma and postgresql before doing this?

Pleroma’s documentation does not mention it as far as I can see. Definitely leave the database running though.

1 Like

I just ran the command as root. I am getting the following error messages.

  • ynh_print_log ‘[Error] pleroma has no install_dir setting (does it use packaging format >=2?)’
  • echo -e ‘[Error] pleroma has no install_dir setting (does it use packaging format >=2?)’
    [Error] pleroma has no install_dir setting (does it use packaging format >=2?)
  • exit 1
    bash: ./bin/pleroma_ctl: No such file or directory

Am I doing it in the wrong location? I tried it in both /root directory and in /home/yunohost.app/pleroma

I see, it’s Pleroma 2.5.5~ynh2 that brings it to packaging v2. Upgrade your app.

Oh, I am unable to upgrade because yunohost doesn’t have enough space. That is why I needed to free up space with vacuuming :slight_smile:

That is a real dilemma. Is there a way to do the upgrade without creating the database backup?

UPDATE: Upgrade attempt’s log is here https://paste.yunohost.org/raw/refuqafula

Yes but, I really would not encourage it: sudo yunohost app upgrade pleroma -b

Instead let’s emulate the shell command. Run the commands one by one, do not copy the whole block together:

cd /var/www/pleroma/live
sudo -u pleroma env HOME=/var/www/pleroma/live bash
cd ~
./bin/pleroma_ctl database vacuum full

Thank you very much! It worked!

P.S : I realize I wasn’t running the command as the Pleroma user in my first attempts.

An update after the vacuum:

VACUUM FULL ran successfully as far as I could tell. I however did not gain any noticeable free space. In the end I decided to upgrade without creating the backup because there was no other alternative. I am now on the latest available version of Pleroma. I understand I will have to add more disk space some time soon, to be able to manage it the recommended way.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.