# How to manually delete older file versions?

**URL:** <https://help.nextcloud.com/t/how-to-manually-delete-older-file-versions/26353>\
**Category:** ℹ️ Support\
**Created:** [January 25, 2018, 2:15am UTC](https://help.nextcloud.com/t/how-to-manually-delete-older-file-versions/26353 "2018-01-25T02:15:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rolandixor](https://help.nextcloud.com/user_avatar/help.nextcloud.com/rolandixor/32/703_2.png) [@rolandixor](https://help.nextcloud.com/u/rolandixor)\
**Post date:** [January 25, 2018, 2:15am UTC](https://help.nextcloud.com/t/how-to-manually-delete-older-file-versions/26353/1 "2018-01-25T02:15:47Z")

</div>

Hi, I’m running low on space, and I was wondering how to manually remove old file versions to free up space. It is these files that are taking up the majority of the space on the server as far as I understand (I haven’t checked the logs yet, and these have taken up a lot of space in the past).

---

<div class="post-metadata">

**Author:** ![Timelord](https://help.nextcloud.com/user_avatar/help.nextcloud.com/timelord/32/7343_2.png) [@Timelord](https://help.nextcloud.com/u/Timelord)\
**Post date:** [January 25, 2018, 3:02am UTC](https://help.nextcloud.com/t/how-to-manually-delete-older-file-versions/26353/2 "2018-01-25T03:02:07Z")

</div>

You can set it in config.php when to delete trash/old versions.

[https://docs.nextcloud.com/server/12/admin\_manual/configuration\_server/config\_sample\_php\_parameters.html#deleted-items-trash-bin](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#deleted-items-trash-bin)

[https://docs.nextcloud.com/server/12/admin\_manual/configuration\_server/config\_sample\_php\_parameters.html#file-versions](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#file-versions)

---

<div class="post-metadata">

**Author:** ![rolandixor](https://help.nextcloud.com/user_avatar/help.nextcloud.com/rolandixor/32/703_2.png) [@rolandixor](https://help.nextcloud.com/u/rolandixor)\
**Post date:** [January 25, 2018, 5:46am UTC](https://help.nextcloud.com/t/how-to-manually-delete-older-file-versions/26353/3 "2018-01-25T05:46:17Z")

</div>

I managed to fix the issue by deleting the files in the trash bin (which, interestingly, I’d barely paid any attention to before).

---

<div class="post-metadata">

**Author:** ![anon99252149](https://help.nextcloud.com/letter_avatar/anon99252149/32/6_449c533f586939b6e5f246632a46421f.png) [@anon99252149](https://help.nextcloud.com/u/anon99252149)\
**Post date:** [January 25, 2018, 12:12pm UTC](https://help.nextcloud.com/t/how-to-manually-delete-older-file-versions/26353/4 "2018-01-25T12:12:08Z")

</div>

> [@rolandixor](#):
>
> manually remove old file versions

`./occ versions:cleanup`

[https://docs.nextcloud.com/server/12/admin\_manual/configuration\_server/occ\_command.html#versions](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/occ_command.html#versions)

---

<div class="post-metadata">

**Author:** ![rolandixor](https://help.nextcloud.com/user_avatar/help.nextcloud.com/rolandixor/32/703_2.png) [@rolandixor](https://help.nextcloud.com/u/rolandixor)\
**Post date:** [January 25, 2018, 4:14pm UTC](https://help.nextcloud.com/t/how-to-manually-delete-older-file-versions/26353/5 "2018-01-25T16:14:39Z")

</div>

Thank you! This is exactly what I’m looking for.

---

<div class="post-metadata">

**Author:** ![alexis.rosano](https://help.nextcloud.com/user_avatar/help.nextcloud.com/alexis.rosano/32/5727_2.png) [@alexis.rosano](https://help.nextcloud.com/u/alexis.rosano)\
**Post date:** [June 4, 2018, 4:54pm UTC](https://help.nextcloud.com/t/how-to-manually-delete-older-file-versions/26353/6 "2018-06-04T16:54:08Z")

</div>

About the automatic delete of old versions, using the key ''versions\_retention\_obligation" how it suposes that erases files? Which process is running?

Regards.

---

<div class="post-metadata">

**Author:** ![e-raser](https://help.nextcloud.com/user_avatar/help.nextcloud.com/e-raser/32/7563_2.png) [@e-raser](https://help.nextcloud.com/u/e-raser)\
**Post date:** [January 13, 2019, 3:01pm UTC](https://help.nextcloud.com/t/how-to-manually-delete-older-file-versions/26353/7 "2019-01-13T15:01:38Z")

</div>

I´m also wondering **when files are really deleted**. In my case I lowered the “trashbin\_retention\_oblitation” setting in config.php and even run the cron manually. Files are still existing and not deleted (yet).

To be more precise: I don´t want ALL deleted files to be deleted (I could do that using occ), I only want those deleted being older than D configured in config.php.

**Update:**  
Seems like the occ “trashbin:expire” command is working. Found it in an Owncloud doc ([https://doc.owncloud.org/server/9.1/admin\_manual/configuration\_files/trashbin\_options.html](https://doc.owncloud.org/server/9.1/admin_manual/configuration_files/trashbin_options.html)).

---

<div class="post-metadata">

**Author:** ![stkw](https://help.nextcloud.com/letter_avatar/stkw/32/6_449c533f586939b6e5f246632a46421f.png) [@stkw](https://help.nextcloud.com/u/stkw)\
**Post date:** [January 29, 2020, 9:05pm UTC](https://help.nextcloud.com/t/how-to-manually-delete-older-file-versions/26353/8 "2020-01-29T21:05:52Z")

</div>

I would like to delete specific versions of a file as my settings keep all versions (I usually need them), but some versions are meant to be deleted and I can’t find an option to delete them or mark them for delete.  
As an alternative it would be cool to keep different version settings by filetype.

---

<div class="post-metadata">

**Author:** ![mds21](https://help.nextcloud.com/letter_avatar/mds21/32/6_449c533f586939b6e5f246632a46421f.png) [@mds21](https://help.nextcloud.com/u/mds21)\
**Post date:** [December 1, 2023, 9:31pm UTC](https://help.nextcloud.com/t/how-to-manually-delete-older-file-versions/26353/9 "2023-12-01T21:31:29Z")

</div>

If you only want to delete the old versions of a single file:  
Create a copy of your file with a new file name → delete the original (including all old versions) → go to the recycle bin and delete the original with all versions → rename the copy back to the original file name if necessary.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 11:54am UTC](https://help.nextcloud.com/t/how-to-manually-delete-older-file-versions/26353/10 "2024-12-04T11:54:31Z")

</div>


