Monday, December 2, 2013

Google Drive API - Feeling the openness of Google

I'm currently working on a project that need to migrate all my organization documents (of all users) which hosted on Google App to a new domain (also on Google App)

So, the process is:

1. Using a Service Account of the old domain to read all files and folders of all user in the old domain along with their current sharing permissions.
2. For each file / folder, share with the relevant new accounts in the new domain.
3. In the new domain, make a copy of each shared file / folder by another Service Account of this new domain.
4. Apply the old sharing permissions to the same file in the new domain.
5. In the old domain, remove shared permissions to new domain accounts.

Service Account is a special account used by the application (this) with the domain-wide privileges. It can manipulate all files and folders of all accounts in the domain. (

I've just played around with the api documentations and have some utility functions. The job have to be done in a week, so I uploaded the source code to Github to keep track of everything and for further references:

I make use of the example codes in the Google Drive SDK documentations so, you should need to read the docs carefully to be able to understand.