The document provides step-by-step instructions for migrating files from Personal Drives to OneDrive using the SharePoint Migration Tool (SPMT). It details restoring files to a common location, installing SPMT, configuring variables and tasks, running parallel migrations via PowerShell, monitoring performance, and analyzing the migration reports and logs generated upon completion to understand failures, successes, and statistics. Email notifications are also triggered containing personalized migration summaries and lists of skipped files for each user.
Key Trends Shaping the Future of Infrastructure.pdf
Step by Step Personal Drive to One Drive Migration using SPMT
1. Step by Step P Drive to OneDrive Migration using SPMT
From: Veera Bharat BhushanKaveri
Introduction: SharePointMigrationTool isasimple tool fortransferringall ourPersonal Drive
filestoOneDrive locationfor everyUserIDaccounts respectively. Let’sgothroughthe stepsin
detail asdescribedbelowtomake ourSPMT migrationagrand success.
Note:Before proceedingonthiswe needtomake sure thatall the Personal Drive fileswith
folders/sub-foldersshouldbe restoredtoa commondesktoplocationwhere youwanttorun
the SPMT tool.Youcan eitherdothe data restorationthroughToolslike Robocopyoranyother
available inthe market/freeware toolsasperyourcomfort!
1. Install iton yourmachine/serverbycontrol clickingthe givenlink:
http://spmtreleasescus.blob.core.windows.net/install/default.htm.
2. On a smarterapproach we are implementingthe PowerShellcmdletsoaswe can run parallel
jobssay 100 at a time witha max speed upto 30 MB/sec.
3. Delete all the oldCookies,Temp,Prefetchfilesforfasterperformance.
4. Please uncheckthe ProxySettingsforfasterperformance asinthe below snap:-
5. You can maintainthe File Share pathsinanyof the Drive say E drive in the machine folderwise
and can alsoinclude asmanydeep multi-level subfolders includingemptyfoldersalsoIDwise
followingsome standardnamingconvention asshownbelow:
6. There are 3 most importanttemplate filesneededforourSPMT PSenabledmigration
proceedings:-
2. Step by Step P Drive to OneDrive Migration using SPMT
USERS folderconsistsof variousindividualPDrive accountfoldersnamed ontheirUserIdsas
showninthe belowsnap
Andin eachUser Accountfolderyoucan have as many files,documentssegregatedinn-number
of deepmulti-level subfoldersthatare available formigration.
Note:
The above User AccountFoldercan’t contain> 1 Terabyte of data as perthe OneDrive
limitationtoholddatasize peruser.
It alsocan’t containfiles/documents/attachmentswithsize >15 GB as SPMT has a
limitationtomigrate aFile <=15 GB size onlyandwill be skippedduringthe migrationif
includedwithall otherfiles.
Exceptiondocumentsare alwaysskippedevenif availableinthe toplayeror even
hiddeninthe deepermostlayersubfolder.Theyare skippedevenif theyare multiple
timesavailable indifferentfoldersinthe givensetof documentsof aFile SharePoint
[PDrive].
Fileswithspecial characterthatare allowedare alsomigratedsuccessfullywithoutany
kindof error generationorskippingduringmigration.
InitiateMigrationisthe Total PowerShell modulecmdletwhichisused toenable SPMTmigration
withvariousconditionsexplainedindetail furtherinthisprocessdocument.
Note:Onlysave the belowcode in.ps1 extensiontoruneffectivelyusingWindowsPSafteryour
customizedconfigurationchangesasperthe requirement.
InitiateMigration
Detailed explanation aboutsomehighlightsof theaboveInitiateMigration PSscriptused forthis
SPMTMigration is given below:-
Initiallywe are definingthe global variablesin#Define SPOtarget#for accessingrespective
Target environment
We are skippingthe followingkindsof fileswhile migration: -SkipFilesWithExtension
"pst:one:onetoc2"
3. Step by Step P Drive to OneDrive Migration using SPMT
Nextwe are declaringfewglobal variablesunder#Define File Share datasource#forthe
respective file share pathsandfixedTargetsite url:"https://XYZcorp-
my.sharepoint.com/personal/"[extendableasperthe useraccount].
Users csv file whichonlycontainsall the useraccountsfromwhichthe above file pathshave to
be extractedandtheirrespective TargetOne Drove url getsgeneratedautomaticallyusingthe
For Each loop.
Everyitemsinthe Users.csvfile ispassedintothe ForEachloopand the respective Azure
connectionhappensthroughthe Global username andPassword
ForEach ($itemin$csvItems)
{
if ($user= Get-AzureADUser-ObjectId$($item.samaccountname+"@corp.XYZ.com")) {
$sharesource = $Global:FileshareSource+$item.samaccountname [Gettingthe
SourceFileSharePath]
$siteurl = $Global:TargetSiteUrl+$item.samaccountname+"_corp_XYZ_com"
[Gettingthe Accountname specificTargeturl]
$task = (Add-SPMTTask -FileShareSource $sharesource -TargetSiteUrl $siteurl -
TargetList"Documents" -TargetListRelativePath"Personal") [Addingthe SPMTTask
to migrate filesfromthe FileshareSource toTargetSiteurl withDocumentsListand
Personal Subfolderonlyasperthe projectrequirement]
$userdetails=New-ObjectPSObject-Property@{
UserPrincipalName =$user.UserPrincipalName
Mail = $user.Mail
Guid= $task.Guid
DisplayName =$user.DisplayName
GivenName =$user.GivenName
}
$Global:UserList+= $userdetails
}
else {
write-output"Nouserfound:"
$($item.samaccountname+"@corp.XYZ.com") [Displaymessage if usernot
found]
}
}
SPMT Migrationjob getsstartedforthe above addedtask(s) withprogressbarshownforour
reference purposetill disconnectingthe Azure connectiononce done
$migration= Get-SPMTMigration
#Start Migrationin the background.#
#Start-SPMTMigration –NoShow [If youdon’twant the progressbar uncommentit]
Start-SPMTMigration
#Cancel the startedmigrationandunregisterthe migrationsession.#
Stop-SPMTMigration
Unregister-SPMTMigration
Disconnect-AzureAD
4. Step by Step P Drive to OneDrive Migration using SPMT
Email triggeringalongwiththe Failuresandthe MigrationSummaryreportsdetailswiththeir
respective pathstobe mentionedinthe mail contentasperthe below code:-
if ($migration.Status -eq"Finished") {
foreach($i in $migration.statusoftasks) {
$Body = $null
$BodyFailed=$null
$user = $Global:UserList|where-object{ $_.guid-eq$i.taskid}
$Body = "<font face='Calibri'>Dear$($user.GivenName),<br><br>"
$Body += "Please be aware thatyourP-drive hasbeensuccessfullycopiedto
OneDrive.<br>Youmayreferto<a href='https://XYZ.service-
now.com/kb_view.do?sysparm_article=KB15137'>KB15137</a> to findouthowto
openit.<br><br>" [BodyandSubjectincludingthe hyperlinks]
if (($i.Status -eq"COMPLETED") -and($i.MigratingProgressPercentage -ne0)) {
$filename =$i.reportfolder+"ItemReport_R1.csv"[Containstotal itemsthathave
beenmigrated-Success/Failure descriptionsbutuserspecific]
$filelist=Import-Csv$filename
foreach($n in$filelist){
if ($n.status -ne "Failed") {
# successful filesare note reported
} else {
$BodyFailed+=
$n.destination.substring($n.Destination.lastindexof("_com/Documents")+21)
$BodyFailed+="<br>"
}
}
}
If ($BodyFailed) {
$Body += "Here isthe listof skippedfiles:<br>" [Skippedfilesdetailsalsoget
presentedasperthe script]
$Body += $BodyFailed [Detailsgetgeneratedasperthe above ForEach Loop and
presentedoverhere]
}
If ($BodyFailed) { $Body+= "<br><a href='https://XYZ.service-
now.com/kb_view.do?sysparm_article=KB14738'>Name restrictionsforfilesstored
inOneDrive</a><br>"}
$Body += "<br>Your P-Drive will stayinread-onlymode foratleastone monthand
thenwill be removed.<br><br>"
$Body += "Incase youuse the library'Businessdocuments'itwill stopworking.If
youwant to accessany of yourOneDrive folderwhilebeingoffline, justdothe right
clickon itand choose 'Alwayskeeponthisdevice'.Readmore aboutOneDrive <a
href='https://XYZ.service-
now.com/sp?id=kb_article_view&sys_kb_id=70b7055e4f6a57c40dd29dcd0310c723
'>files-on-demand</a>.<br><br>"
5. Step by Step P Drive to OneDrive Migration using SPMT
$Body += "For more details regardingthismigration,referto<a
href='https://XYZ.service-
now.com/kb_view.do?sysparm_article=KB15236'>KB15236</a> or <a
href='https://XYZ.service-
now.com/sp/?id=sc_cat_item&sys_id=125230584f139300bde88c401310c774'>ask
GSD</a>.<br><br>"
Send-MailMessage-To"$(($user.mail))" -BCC
"<Z_GVAPDRIVEMIGRATION@XYZ.com>",
"<VeeraBharat.BhushanKaveri@XYZ.com>"-From"P-Drive migration
<z_gvapdrivemigration@XYZ.COM>"-Subject"P-DrivemigratedtoOneDrive
$(($user.userprincipalname))" -Body$Body -BodyAsHtml -EncodingUnicode -
smtpserverGVASMTP
[Caninclude multiple useremail idsashighlighted]
Stop-Transcript
#Pause [To have lookforlongertime please uncommentit]
The above Email is codedinsimple HTML formatand the last few linesdirectusTo,From,
Bcc, Subjectand Bodywithautomatedinformationretrieval andpresentationwherever
necessaryforeverymigrationspecificjob/taskthatgetscompleted.
There are 2 kindsof Emailsgeneratedduringthiswhole processformerfromthe P-Drive Source
MigrationService Accountandlatterfromthe respective user’sOneDrive asinthe below snaps:
6. Step by Step P Drive to OneDrive Migration using SPMT
7. Users csv file cancontains the listof all the PDrive UserID(s) whose fileshave tobe migrated
fromtheirPDrive File share paths totheirOneDrive UserAccountsrespectively. Parallel
migrationscanbe possible byaddingtheirrespective useraccountsinthe Users.csvfile andit
takesmore time comparedto a single useraccountmigrationof the same size of fileswith
documents.
Belowsnapdescribesabout asample file representing2PDrive UserIDs have to be presentedin
a single column insidethisUserscsvfile withoutanykindof headers,special charactersand
tables. Withthe belowdeclarationwe have 2parallel jobsrunningwhenranthe PSscript.
8. Nowafterall the configurationsare made please Runthe InitiateMigrationfilewithPowerShell
and youwill getthe PSwindowopenedwiththe progressbarmentioningall the job(s).
9. You can alsomonitorthe Performance efficiencybyRightclickingthe Taskbar andclick
Performance tabinside thatformonitoringSendingvs Receivingspeed.
Note:SendingSpeedalwaysgreaterthanReceivingSpeed.
Please terminateotherunnecessaryjobsforfasterandsmarterperformance.
Please make sure thatthe above PowerShell jobdoesn’texceed70% of the CPU and Memoryto
avoidhandoverproblems.
7. Step by Step P Drive to OneDrive Migration using SPMT
Once the job(s) getcompletedhere isthe message thatgetsdisplayed.PressEntertocontinue
and the windowgetsclosedautomatically.
10. We have 3 Outputfolders[ForOutputanalysisusingthe Reports] thatare generated inside the
same File pathas perthe PSscript afterthe migration job(s) getscompletedasshowninthe
givenbelowsnap:-
11. Time takencan be easilycalculatedbytakingthe differenceof EndTime andStart Time
mentionedinthe Transcriptfile.
8. Step by Step P Drive to OneDrive Migration using SPMT
12. Complete informationpresentedinthe Transcriptfile isshownasbelow:-
You can alsoclearlysee the Start andEnd Time for a quickreference toyourfurtheranalysis.
13. MigrationTool folderconsistsof all the Log and Reportsfilesaftersome deeplevel digginginto
it
You will have multiple foldersgeneratedinsideitif yourunthe same job withsame
configurationsettings multiple times mentionedbytheirtime stampforindividual Log, Reports,
and Outputanalysis.Eg:I ran the jobfor 2 timesandhence 2 foldersgotgenerated:-
9. Step by Step P Drive to OneDrive Migration using SPMT
14. Each Job namedwithsome unique name has2 foldersLogandReportsas shownbelow:-
15. Migrations001 file containsthe completemigrationdetails inthisformat:-
16. Similarlyinthe Reportfolderyouhave the below outputfoldersgeneratedasshownbelow:-
10. Step by Step P Drive to OneDrive Migration using SPMT
17. Main reportsto focusfor our job(s) analysispurpose are :-
FailureSummaryReportgivesinfoaboutall the properties [Source,Destination,Item
name,Extension,Itemsize (bytes),Contenttype,Status,Resultcategory,Message,Error
code,Source itemID,DestinationitemID,Package number,MigrationjobID,Incremental
round,TaskID,Device name] of the failed migrationfiles asshownbelowforourclear
understanding.Thisreportwill notbe generatedif nofailuresinthe migration.
SummaryReportgivesinfoaboutall the properties [Source,Destination,Status,Totalbytes,Total
GB,Migratedbytes,MigratedGB,GBnotmigrated,Total scanneditem,Total tobe
migrated,Migrateditems,Itemsnotmigrated,Warningcount,Starttime,End
time,Duration,GB/hour,Roundnumber,Workflow ID,TaskID,LogPath] of the single orparallel
migrationsthattookplace in detail presentedinarow wise mannerasshownbelow:
Otherfoldersare notof so importantforour Outputanalysisreferencesandunderstanding.
MigrationToolStorage folderisof notso importance to analyze.Soplease ignore it.
18. For a newmigrationjobconfigure the InitiateMigration PSfile asperyourrequirementsand
delete boththe below highlightedfolders.Repeatall the above mentionedstepsandfresh
outputfolderswill be generatedrespectively fortheirrespective outputanalysis.
11. Step by Step P Drive to OneDrive Migration using SPMT
19. Overwritingthe files canbe done justby rerunningthe Initiate MigrationPScmdletagainandis
veryfastas scanninggetscompleted veryfastandhence respectiveDelta/Incremental
migrationstake place[onlyformodifieddocuments] leavingthe unchangedfilesun-migratedfor
robustperformance.All the detailswhetherskipped/migrated/failedare completely
explainedindetail inthe ReportsSummary.
Total Reference FilesZippedhere:
Total SPMT Stuff.zip
Summary: We have got a keenunderstandingof the above SPMTPDrivestoOneDrive migrationprocess
overview.