google-drive-recursive-ownership icon indicating copy to clipboard operation
google-drive-recursive-ownership copied to clipboard

Directory structure is not preserved.

Open Nottt opened this issue 6 years ago • 8 comments

Is there a way to fix this? Please fix this as it is very annoying :/

Nottt avatar Aug 16 '17 10:08 Nottt

I have not had this issue. Do you have an example of what was expected, what was encountered, and which screen or view in Google you are viewing this on?

Paraka321 avatar Aug 16 '17 23:08 Paraka321

I was expecting 3 root folders in the account I was transferring the files.

But it appears your script is "symlink" them in the web interface, and the subfolders of the root folders also appear on the web interface as another root folders. The files inside also appear without being inside any folder.

http://imgur.com/a/l7msq

My files are encrypted so that's why they are like this.

But there should be only 3 folders here after changing the ownership. If I select a file or folder you'll see they appear to have multiple locations. I found that this is mostly a "visual" issue as the original folder structure is still preserved but it's like it was created symlinks of it in other places.

Nottt avatar Aug 16 '17 23:08 Nottt

There are no strict hierarchies or symlinks in Google Drive. There is only the multi-hierarchy of folders and files/objects. A file in two folders is equally in both. To my knowledge, the script only shares and changes ownership of folders, files, and objects in Drive. It does not intentionally move anything, nor can it control the layout experienced by the new owner.

It's probably possible to extend the script to save the original hierarchy and then apply it to the new owner's account, but the account giving away ownership can't do that on its own.

davidstrauss avatar Aug 16 '17 23:08 davidstrauss

But why do you think this happening? They aren't like that in the account I'm transferring.

Nottt avatar Aug 16 '17 23:08 Nottt

Google is probably throwing newly owned items into the root of the new owner's Drive, though they should also appear in the original shared folders as well.

davidstrauss avatar Aug 16 '17 23:08 davidstrauss

Is there anything we can do? With encrypted files this can be a pain?

Nottt avatar Aug 17 '17 00:08 Nottt

Nothing to do with encrypted files. My only suggestion is export of the original hierarchy followed by restoration (via API) in the new owner's account. You could also try moving the items to a Team Drive and then from one; I believe that will coerce ownership.

davidstrauss avatar Aug 17 '17 00:08 davidstrauss

I was saying that with encrypted files it's a hassle to use the webUI to organize them. However I found a workaround.

You need to share the folder file and move it to where you want to be, then you use the script to change recursively the files

Nottt avatar Aug 19 '17 04:08 Nottt