Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

anon

Same thing happened to me, lost a bunch of important files, strange thing is ext4magic can't even find they were deleted.

Basically in WinSCP moved one folder NameA containing some sub-folders into another folder which also contained a folder named NameA containing some of the same sub-folders, but with files in them.

WinSCP popped up a prompt and I thought it was similar to Windows when merging folders, but it just overwrite the entire contents. I don't think Linux allows that with the mv command, seems like WinSCP should use rsync for merging and be even more explicit.
martin

Re: Move to function deletes target folder

@MarcoF: OK, I've improved it further to check if the target is an existing remote folder. If it is, WinSCP will imply the trailing slash, even if it is not present. I hope that this is what you refer to "Linux's native 'move to' function".

I'm sending you an email with a development version of WinSCP to the address you have used to register on this forum.
MarcoF

Re: Move to function deletes target folder

@martin: Dear Martin, WinSCP is a client that I love and have been using for many years. But in the case of the "Move to" function your approach is completely wrong. Because, regardless of the correctness of the path chosen, it cannot carry out such a disastrous overwrite operation. For example, in my case a gh directory already existed in the guru directory, so the override request appeared consistent to me.
In reality, as demonstrated by Linux's native 'move to' function, such a disaster just can't (must not) never happen.
martin

Re: Move to function deletes target folder

Ok, now I understand. You are not moving gh to guru. You are moving gh to app under name guru. So basically, you are renaming gh to guru. That's why WinSCP asked about overwrite and that's why after you confirmed the overwrite, WinSCP deleted the guru and renamed gh to guru.

The correct input to move the gh to guru would be /var/www/html/app/guru/gh (that's what you would get had you drag&droped gh to guru) or just /var/www/html/app/guru/.

I'm sorry, but that means your files are lost.

I'll improve the "overwrite" prompt to be more explicit about the consequences:
Issue 2209 – Improve behavior when moving/renaming over an existing folder
MarcoF

Re: Move to function deletes target folder

@martin: Yes. I send you the video but I stop when the overwrite window appears.
The second part of the video concerns the reverse action which instead works without problems and without proposing any (incomprehensible) overwriting request. However you can reproduce the problem yourself, as many times as you like.
martin

Re: Move to function deletes target folder

Yes please, send the video to me. Or attach it here.
MarcoF

Re: Move to function deletes target folder

This is what happened after asking WinSCP to move the ws folder into the guru folder.
MarcoF

Move to

@martin : Dear Martin, I reproduced what happens and recorded it on video. Can I send it to you by email?
martin

Re: Move to function deletes target folder

@MarcoF: So can you reproduce the problem? (on some test files) If you can, can you send me the session log file? That might help me to understand what has happened and where might the files went to.
MarcoF

Re: Move to function deletes target folder

@martin: Ok, I'll give you an example of what happened. I have two directories on the same level, A and B, both containing some files. I move directory A into directory B using the "Move to" command. The result is that in B there are only the files of A. So the files of B and the folder A disappeared.

Neither "Upload/Download and Delete" nor "Move to" delete any additional files (except those moved/overwritten)

Now starting from this assumption, where can I find 2gb of data that were inside the B folder? Since they disappeared after using the "Move to" function, is there a way to recover them along with the structure or to restore the structure as it was before?
That data was very important to me.
martin

Re: Move to function deletes target folder

@MarcoF: F6 is for "Upload/Download and Delete", not for "Move to" (that's Shift+F6). So what did you do exactly? Please give us step by step description. Are you able to reproduce the problem? Neither "Upload/Download and Delete" nor "Move to" delete any additional files (except those moved/overwritten).
MarcoF

Move to function deletes target folder

I used the Move to (F6) function to move a folder into another folder with other files. The result is that I moved the folder but deleted all the other files that were already inside. How do I recover them? Help me