Moving folders with the same name on local external storage can replace the existing folder and delete its contents
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 30/100
Línea de trabajo
The report names no files or tests; it describes a folder MOVE onto an existing same-named folder on local external storage. Start by reproducing with two "2026" folders and confirming whether the client sends a WebDAV MOVE and how the destination-exists branch is handled, including whether files_trashbin is bypassed. Done means the destination is preserved (merge/refuse/confirm) and a regression test covers the same-name move on external storage.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
⚠️ Before posting ⚠️
- This is a bug, not a question or an enhancement.
- I've searched for similar issues and didn't find a duplicate.
- I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- I agree to follow Nextcloud's Code of Conduct.
Steps to reproduce
I experienced apparent data loss when moving folders with the same name inside a Nextcloud local external storage mount.
I have Nextcloud AIO running on Windows with Docker Desktop. A Windows NTFS folder is exposed to Nextcloud as local external storage.
The affected path is:
"F:\NextcloudExternal\Gallery\Pictures"
There were two folders named:
"2026"
When I moved one "2026" folder into the location containing the other "2026" folder, I expected Nextcloud to either:
- merge the contents of the two folders, or
- warn that a folder with the same name already exists and require confirmation before replacing anything.
Instead, the existing "2026" folder was replaced. Its previous contents disappeared.
The deleted files did not appear in:
- Nextcloud Trash
- Windows Recycle Bin
The source files were actually removed from the Windows NTFS filesystem.
I was able to recover the deleted data using Windows File Recovery ("winfr"). A targeted recovery scan recovered 808 files, including the original directory structure:
"NextcloudExternal\Gallery\Pictures\2026\08"
and files such as:
"26-08-23 20-38-56 5397.jpg"
This indicates that the files were actually deleted/replaced on the underlying external storage rather than simply disappearing from the Nextcloud file index.
Steps to reproduce
- Configure a Nextcloud local external storage mount pointing to a writable Windows folder.
- Create two separate folders named "2026" in different locations.
- Put different files in each "2026" folder.
- Using android or ios app or web move one "2026" folder into the location containing the other "2026" folder.
- Observe the resulting destination folder.
Expected behaviour
Nextcloud should not silently destroy the contents of an existing same-named folder.
Possible expected behaviors would be:
- merge the folders while preserving all files, or
- refuse the operation because the destination already exists, or
- clearly warn that the destination will be replaced and require explicit confirmation.
If replacement is intentionally supported, the existing folder's contents should be recoverable through Nextcloud Trash where the external-storage backend supports it.
Actual behaviour
Actual behavior
The existing "2026" folder was replaced and its previous contents disappeared.
The deleted files were not present in Nextcloud Trash or the Windows Recycle Bin.
The Nextcloud activity section did mentioned that 2026 folder is removed.
The files were actually deleted from the underlying Windows NTFS filesystem.
Windows File Recovery was subsequently able to recover 808 files from the affected folder.
Impact
This can result in unexpected permanent data loss when users move folders with names that already exist at the destination.
This is particularly concerning for local external storage because the operation directly affects the underlying filesystem.
Environment
- Nextcloud: Nextcloud AIO
- Deployment: Docker Desktop
- Host OS: Windows
- Docker context: "desktop-linux"
- External storage type: local folder / local external storage
- Host filesystem: NTFS
- External storage root:
"F:\NextcloudExternal"
- Affected path:
"F:\NextcloudExternal\Gallery\Pictures"
- Affected folder:
"2026"
Additional information
The external storage was intentionally limited to:
"F:\NextcloudExternal"
The entire "F:" drive was not exposed to Nextcloud.
Docker was able to access the external storage correctly.
After the incident, Windows showed only the remaining "2025" folder under:
"F:\NextcloudExternal\Gallery\Pictures"
The missing "2026" folder was not present.
No files from the missing folder were found in either Nextcloud Trash or the Windows Recycle Bin.
Windows File Recovery was run against the NTFS volume and successfully recovered 808 files from the affected "2026" directory, confirming that the underlying files had been deleted.
Related reports
I found several existing Nextcloud reports involving external-storage move/delete behavior, including:
- #63168 — deletion on external storage can succeed even though the client receives an error.
- #54977 — move/copy and delete-folder problems involving external storage.
- #39516 — move operations involving external storage can copy data and fail during deletion.
- #37934 — files on local external storage can be deleted when the external storage becomes unavailable.
However, I did not find an existing report describing this exact same-name-folder replacement scenario on local external storage.
Request
Please investigate whether moving a folder onto an existing folder with the same name can cause the destination folder to be replaced/deleted rather than safely merged or rejected.
In particular, please verify:
- How the Files app handles a directory MOVE operation when the destination directory already exists.
- Whether the operation can recursively delete the existing destination contents.
- Whether the operation bypasses "files_trashbin" for local external storage.
- Whether the behavior differs between normal Nextcloud storage and local external storage.
- Whether the UI should prevent or explicitly warn about this operation.
I can provide additional logs, configuration information, or a reproduction test if needed..
Android version
15
Device brand and model
onplus 10 pro
Stock or custom OS?
Stock
Nextcloud android app version
35.0.0
Nextcloud server version
latest
Using a reverse proxy?
No
Android logs
No response
Server error logs
Additional information
No response
- Lenguaje dominante
- Kotlin
- Estrellas
- 5.7k
- Forks
- 2.1k
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 135
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de nextcloud/android
-
0. Needs triage bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
nextcloud/android#17845 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Bug] Lock owned by another client (e.g. Text app) cannot be unlocked from the appPosiblemente ocupada @falkloewert la tomó hace 28 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
nextcloud/android#17837 · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
0. Needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
nextcloud/android#17533 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
RC 34.1.0-01: Duplicated wording in creation menu — "New" prefix + creator name produces "New New document" ("Neu Neues Dokument")Posiblemente ocupada @ChristianTannheimer la tomó hace 118 días. Abierto0. Needs triage bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
Todos los issues de nextcloud/android
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Kotlin/kotlin-lsp#309 ·
-
Two stored artist rows are not act names: "DJS" from a Renate floor heading and "Stevie Cox -"Abiertoarea:data-quality importer size:S
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
enorm-labs/event-junkie#5136 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Type: Possible bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
spacecowboy/Feeder#1318 ·
Los mantenedores suelen responder en 1 día
-
个人助手回复内容既无法手动选中复制,也没有一键复制Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
wangzan101/Mika#644 ·
Los mantenedores suelen responder en 1 día