davidstrauss / google-drive-recursive-ownership

Tool to recursively give away file and document ownership to another user.
MIT License
269 stars 68 forks source link

Directory structure is not preserved. #19

Open Nottt opened 7 years ago

Nottt commented 7 years ago

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

Paraka321 commented 7 years ago

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?

Nottt commented 7 years ago

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.

davidstrauss commented 7 years ago

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.

Nottt commented 7 years ago

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

davidstrauss commented 7 years ago

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.

Nottt commented 7 years ago

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

davidstrauss commented 7 years ago

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.

Nottt commented 7 years ago

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