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,870
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