What are "versions" in relations to database when doing a clean up

Currently running
“nextcloudrpi 5.15.0-1034-raspi”
NC 26.0.3

Its been running well for 4 years and really is only for home use with just me using it. All the files shares are on a NAS so no local user data.
Anyway doing an upgrade it complained about errors and I found the little SD card had run out of space. 28GB.
I found my user folder /var/www/html/nextcloud/data/username to be consuming most of the disk space.
I ran the two database clean up commands
sudo -u www-data php occ trashbin:cleanup --all-users

which recovered a little bit of space.

So then ran “sudo -u www-data php occ versions:cleanup”

That seemed to clean up alot of space, my question is what is the Versions clean up doing.
After running I got 30% space back and now successfully upgraded.

Versions are the intermediate versions of documents that get created as you work with documents on your system, that you can revert to or download/edit.


Ok thanks that makes sense. But three more questions

  1. Why did it not clean up the space as it says in the article?
  2. Does this versioning only start on a file I edit within NC Web client/ Android app or does it also start if I edit the same file outside of NC like from a samba share. (Im not using a NC desktop client)
  3. Can I turn off versioning or set how aggressive space levels are so id don’t run out of space in future?


The “occ versions:cleanup” command deletes all version data. It doesn’t follow the configured policy.

Your disk space filling up is not the same as a user quota filling up. I believe version manages based on individual user quotas. I don’t recall if it has any awareness of system disk usage.

It’s possible the background job isn’t active for version management for some reason, but you can confirm that and/or fix it:

Everything version related is configurable. See the Admin Manual - i.e.:

1 Like