transfer ownership of specific folders and all sub-files and folders recursively

2,670 views
Skip to first unread message

Jeff Prus

unread,
Sep 5, 2016, 8:56:08 AM9/5/16
to Google Apps Manager
I know that there is a way to transfer the entire contents of a user's Drive to another user's Drive.  However, is there a way for me to transfer ownership of only specific folders and all the sub files and folders recursively?  I haven't been able to find a way to do this yet.  I saw that there were new commands in GAM v.3.66 for  claim/transfer folder.  When I tried these commands, however, it seemed to be retrieving every file in the entire Drive (of which there are literally hundreds of thousands) first and it was taking forever.  In the end I had to stop the process and was left wondering if it was trying to transfer ownership of everything.

Any help or hints that you may have for me would be appreciated.  

Thanks,

Jeff

+KimNilsson

unread,
Sep 6, 2016, 8:37:06 AM9/6/16
to Google Apps Manager
Claim/Transfer - did you find that in the current GAM, or in this fork?
You need to give the folderID of the folder you want to transfer.

Jeff Prus

unread,
Sep 6, 2016, 9:08:48 AM9/6/16
to Google Apps Manager
I was using that fork to test the Transfer commands.  I did include the folderID of the folder in the command.  Tried testing it out with one folder that had one document in it to see if it would transfer ownership recursively for both the folder and file.  However, the command executing the getting of thousands and thousands of files without transferring the folder.  Took so long that I just cancelled it.  Has anyone had any luck with this?  It would be a great feature to be able to transfer ownership of just specific folders and all subfolders and files inside.  I can think of lots of applications for this feature.

+KimNilsson

unread,
Sep 6, 2016, 10:08:48 AM9/6/16
to Google Apps Manager

As I said, I use it regularly on two different domains, without any problems, so I must assume that you did it wrong.

Joseph Macchia

unread,
Oct 12, 2016, 11:40:20 AM10/12/16
to Google Apps Manager
Sorry. Just a bit of clarity needed. 

Claim/Transfer is only available in the fork? Not in 3.71?

Thanks

Kim Nilsson

unread,
Oct 12, 2016, 12:03:29 PM10/12/16
to google-ap...@googlegroups.com

Correct

A J Uddin

unread,
Oct 17, 2016, 1:14:25 PM10/17/16
to GAM for G Suite
I am having same problem, I am trying using version 3.66 downloaded from pre-release, I had to download source code as I am running on mac. 
when I run the command python gam.py user xxx claim folder [folder_id] 

I get "Getting all files for xxx"

any idea please?

Kim Nilsson

unread,
Oct 17, 2016, 3:33:18 PM10/17/16
to google-ap...@googlegroups.com

Try the GAMADV-X fork instead, and make sure that you read the GAMCOMMANDS.txt for the correct syntax.

A J Uddin

unread,
Oct 18, 2016, 5:09:22 AM10/18/16
to GAM for G Suite, Kim.N...@no-substitute.com
I have tried from fork  downloaded source code for mac, no luck, the command executing the getting of thousands and thousands of files nothing get transferred.

Much appreciated 

A J Uddin

unread,
Oct 18, 2016, 5:52:21 AM10/18/16
to GAM for G Suite
Hi Jeff, did you manage to get this working?
I am having same problem here in mac.

Regards 

AJ

+KimNilsson

unread,
Oct 18, 2016, 8:26:29 AM10/18/16
to GAM for G Suite
Using the fork I told you about (GAMADV-X) this the correct syntax.

gam user new.o...@email.address claim ownership folderID

A J Uddin

unread,
Oct 18, 2016, 10:29:56 AM10/18/16
to GAM for G Suite
Hi,
Thanks

Its bit better now maybe, I don't get any message but nothing happens.When I run the command its immediately go to next line ready for another command.seems like it has executed but nothing changes in terms of ownership. 
However syntax in here showing gam user <claiming_user> claim folder <folderID>  I was trying to use this initially!!

Version info

python gam.py version

GAM 3.66 - http://git.io/gam

Jay Lee <jay...@gmail.com>

Python 2.7.10 64-bit final

google-api-python-client 1.5.0

Darwin-14.5.0-x86_64-i386-64bit x86_64

Kim Nilsson

unread,
Oct 18, 2016, 11:04:59 AM10/18/16
to google-ap...@googlegroups.com
This is what it looks like, with the adv fork. For the first test it already owns all files and folders recursively.

 /usr/bin/python /Users/me/GAMADV-X-4.26.01/src/gam.py user newo...@domain.com claim ownership 0BrestofthefolderID

User: newo...@domain.com, Claim Ownership 1 Drive File/Folder

Getting all Drive Files/Folders for newo...@domain.com

Got 43 Drive Files/Folders for newo...@domain.com...

User: newo...@domain.com, Claim Ownership 0 Users


Added a new document in the root of that folder.
Waited a bit for Google to realise I did that. :-)

$ /usr/bin/python /Users/me/GAMADV-X-4.26.01/src/gam.py user newo...@domain.com claim ownership 0BrestofthefolderID

User: newo...@domain.com, Claim Ownership 1 Drive File/Folder

Getting all Drive Files/Folders for newo...@domain.com

Got 44 Drive Files/Folders for newo...@domain.com...

User: newo...@domain.com, Claim Ownership 1 User

  User: newo...@domain.com, Claim Ownership 1 Drive File/Folder from User: old_...@domain.com

    User: newo...@domain.com, Drive File: Endast ett test (1BnewfileID), Ownership Claimed from User: old_...@domain.com

A J Uddin

unread,
Oct 18, 2016, 12:23:48 PM10/18/16
to GAM for G Suite
sorry no luck, are you able to provide me the link for the source code, kindly?

Jeff Prus

unread,
Oct 23, 2016, 5:56:08 AM10/23/16
to GAM for G Suite
AJ,

I finally got it to work using the fork for v3.66 in the link above and the commands on that download page.  After entering the commands it does start with "getting all files for XXXX" and then takes forever to read all the files before transferring the files one by one.  It was tedious and takes forever but eventually did the job.  

I may try the GAMADV-X fork that KimNilsson recommends.  Perhaps that will be faster???

Jeff
Reply all
Reply to author
Forward
0 new messages