1

I am looking to do a mass migration of user files from a Windows Server to Google Drive. Each user has their own folder on the Windows Server and I am looking for a way to bulk migrate to each users Google Drive.

I have 1200+ users to do this for (lucky for me no data limitations). I also have quite a large time frame, so if it goes slow it will not matter.

Has anyone seen a solution for this?

tyelford
  • 255
  • 2
  • 11

2 Answers2

0

After doing a quick poke around Google Drive for work, here's a possible solution: (WARNING: its not very pretty. In fact, its quite ugly, but it just might work.)

  1. Share each users Google Drive folder with an administrator or role account.
  2. Log into that account on the Server machine.
  3. Using a variable in the batch script (assuming the employees have the same user name on the Windows system as Drive) have the script detect the folder and automatically place it in the correct drive folder.

    FOR %%c in (C:\Users\*.*) DO    
    set FileName=%%c
    robocopy C:\Users\%FileName% C:\...\GoogleDrive\%FileName% /E /Z /TEE /LOG:migrationLog.log 
    del %FileName%
    exit
    

Basic theory behind this found here: http://learn.googleapps.com/products/drive/set-up-file-share

Here is Microsoft's page on robocopy and its functions and attributes: https://technet.microsoft.com/en-us/library/cc733145.aspx

GregL
  • 9,030
  • 2
  • 24
  • 35
  • Problem is that I have 1200+ users. That will move all the files from every user on my windows server to one user on Google Apps. I need to be able to move user files from windows server to individual user accounts in Google Apps. – tyelford Nov 09 '15 at 01:04
  • @tyelford See edited answer for possible solution. – Michelfrancis Bustillos Nov 09 '15 at 01:35
  • Yes it technically would work, however it would mean that I would have to share over 1200 folders in Google Drive – tyelford Nov 09 '15 at 01:46
  • Unfortunately true, though there is a possibility that, as a Google Drive for Business admin, you might have access already to each employee's Drive folder. This might be something to take to the Google forums. – Michelfrancis Bustillos Nov 09 '15 at 01:58
  • I am going to see what I can do with Google Apps Script. If I come up with something ill post it back here – tyelford Nov 09 '15 at 02:04
0

Here is what I did in the end

  • Created a service account in Google Apps
  • Setup the Google Drive Sync Utility for Windows
  • Transferred all the files and folders to that one Google Drive Account
  • Created a Google Apps Script to Share the users folder properly

Here is the Apps Script I used, each folder has the name of the user:

function myFunction() {
  //Top Level Directory that contains each users folder
  var folder = DriveApp.getFolderById('0ByoBlv24h');

  //Get a list of all the folders (also usernames)
  var folders = folder.getFolders();

  //Loop through all the folders
  while(folders.hasNext()){
    var thisFolder = folders.next();

    //Get the username and email address
    var username = thisFolder;
    var email = username + '@domain.com';

    //Add the user as an editor for this folder
    thisFolder.addEditor(email);

    //Add a name for the folder
    thisFolder.setName(username + ' - Google Drive');     
 }
}
tyelford
  • 255
  • 2
  • 11