Frequently Asked Question
Nextcloud, especially when using Groupfolders, relies on its oc_filecache database table to track file locations, ownerships, and metadata. This cache is crucial for performance and for handling various filesystem details, including filenames that might be problematic on certain operating systems or in WebDAV contexts.
When moving files or folders between Groupfolders, particularly large or complex directory structures, directly attempting a 'move' operation can be risky. If the operation fails or is interrupted (e.g., due to network issues, server timeouts, or insufficient permissions), the oc_filecache can become corrupted. This corruption can lead to:
- Invalid File Locations: The database might still reference the old location while the file has been partially moved, or the new location is incomplete.
- Missing Files: Files might disappear from both the source and destination in the Nextcloud interface, even if they physically exist on the storage backend.
- Incorrect Ownership/Permissions: Metadata related to who owns the file or what permissions are applied can be incorrect.
- Inconsistent Views: Different users might see different file structures.
To mitigate these risks and ensure data integrity, always follow this procedure when transferring files or folders between Groupfolders:
- Always Copy, Never Move (Initially): Perform a copy operation from the source Groupfolder to the destination Groupfolder.
- Use the Nextcloud Web Interface: Always initiate file and folder transfers via the Nextcloud web interface. Avoid using local sync clients for these operations between Groupfolders as they often perform direct moves that bypass the necessary
oc_filecacheupdates or lack robust error handling for such complex scenarios. - Verify the Copy Operation: After the copy process completes, thoroughly verify that all files and folders have been successfully copied to the destination Groupfolder. Check:
- File and folder counts.
- File sizes.
- Content integrity (e.g., open a few files to ensure they are not corrupted).
- Correct permissions and ownership.
- Delete from Source: Once you are absolutely certain that the copy is complete and successful in the destination, then and only then, delete the original files and folders from the source Groupfolder.
This "copy then verify then delete" workflow ensures that a complete and valid copy exists before the original is removed, significantly reducing the risk of data loss or oc_filecache corruption. If a copy operation fails, the original data remains intact, allowing you to retry without data loss.
This FAQ was generated and/or edited by GAIN, GENs Artificial Intelligence Network and should not be considered 100% accurate. Always check facts and do your research, things change all the time. If you are unsure about any information provided, please raise a support ticket for clarification.
