Files in trashbin NOT to delete

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.4
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04
  • Web server and version (e.g, Apache 2.4.25):
    • Apache
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • nginx
  • PHP version (e.g, 8.3):
    • 8.4
  • Is this the first time you’ve seen this error? (Yes / No):
    • No
  • When did this problem seem to first start?
    • long time ago
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • ?
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

In trashbin I see many files which should NOT be deleted.
To preserve these files I want to restore these files, preferrable to another (temp) location.
Which commands do I have to use in the CLI?

Best regards,
Marianne

If you search the documentation for the occ command, this can be used on CLI to restore files.

occ trashbin:restore --help

looks like there is no option to restore to a temporary location… seems like you can only restore to the original location

I think you are making a small mistake. Backup and Restore are important for a Nextcloud. These also should include the documents in the recycle bin. If you want to keep documents even longer, you should also keep the standard backup longer, which contains both the documents available in Nextcloud and the documents deleted in Nextcloud. Explain your backup and restore strategy.

You can find all files in /path/to/nextcloud/data/username ( files_trashbin) and /path/to/nextcloud/data/__groupfolders (trash). Hopefully you backup full /path/to/nextcloud/data including trashbins. Bear in mind that files deleted from the Nextcloud trashbin via Nextcloud can no longer be restored via Nextcloud mechanisms. You will then have to manually upload the files from the backup path to Nextcloud again.

You can make incremental backups for minimize your backup space.

Hint:
Files that may still be needed in Nextcloud should be moved to other folders such as e.g. self created /Archive directory with full Nextcloud function.

1 Like