SlideShare a Scribd company logo
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:-
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"
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
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>"
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:
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.
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.
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:-
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:-
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.
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.

More Related Content

PPTX
Automating Your Azure Environment
PPTX
What's New for the Windows Azure Developer? Lots!!
PDF
Hyperlight Websites - Chris Zacharias
PDF
Deploying SharePoint @ Cloud
PDF
Future of Web Apps: Google Gears
PDF
New features of Azure Cloud Provider at OCP 3.10
PPTX
More Cache for Less Cash
PDF
New features of Azure Cloud Provider in OpenShift Container Platform 3.10
Automating Your Azure Environment
What's New for the Windows Azure Developer? Lots!!
Hyperlight Websites - Chris Zacharias
Deploying SharePoint @ Cloud
Future of Web Apps: Google Gears
New features of Azure Cloud Provider at OCP 3.10
More Cache for Less Cash
New features of Azure Cloud Provider in OpenShift Container Platform 3.10

What's hot (18)

PPTX
Windows Azure for Developers - Building Block Services
PPTX
Enrique lima azure-it-pro-ps
PDF
Extending spring
PPTX
Azure from scratch part 5 By Girish Kalamati
PDF
오픈소스 게임 서버 엔진 스터디 캠프 - CloudBread
PDF
[KGC 2012] Online Game Server Architecture Case Study Performance and Security
PDF
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
PPTX
Windows Azure for Developers - Service Management
PPTX
SPSSTL - PowerShell - Through the SharePoint Looking Glass
ODP
AutoScaling and Drupal
PPTX
MSFT Dumaguete 061616 - Building High Performance Apps
PPTX
OGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo Thai
PPTX
Windows azure camp
PDF
Operacion Guinda 2
PPTX
Enough with the javas cript already! de Nicholas Zakas
PPTX
Ansible & CloudStack - Configuration Management
PDF
Kubernetes Operability Tooling (Minnebar 2019)
PPTX
Gaming across multiple devices
Windows Azure for Developers - Building Block Services
Enrique lima azure-it-pro-ps
Extending spring
Azure from scratch part 5 By Girish Kalamati
오픈소스 게임 서버 엔진 스터디 캠프 - CloudBread
[KGC 2012] Online Game Server Architecture Case Study Performance and Security
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
Windows Azure for Developers - Service Management
SPSSTL - PowerShell - Through the SharePoint Looking Glass
AutoScaling and Drupal
MSFT Dumaguete 061616 - Building High Performance Apps
OGDC2012 A Practical Architecture Design For MMO Casual Game_Mr. An, Ngo Thai
Windows azure camp
Operacion Guinda 2
Enough with the javas cript already! de Nicholas Zakas
Ansible & CloudStack - Configuration Management
Kubernetes Operability Tooling (Minnebar 2019)
Gaming across multiple devices
Ad

Similar to Step by Step Personal Drive to One Drive Migration using SPMT (9)

PDF
Total ODFB Migration Process through SPMT Tool
PPTX
Accelerate your journey to the cloud using the Microsoft SharePoint Migration...
PPTX
Migrating on premises and cloud contents to SharePoint Online at no cost with...
PDF
Migrate to SharePoint Online using native Tools
PPTX
One101 double the trouble double the fun_ migrating to one_drive and sharepoi...
PDF
Andy Malone - Migrating to office 365
PDF
Office 365 migration
PPTX
SPO Migration - New API
PDF
How SharePoint Online Migration API Works
Total ODFB Migration Process through SPMT Tool
Accelerate your journey to the cloud using the Microsoft SharePoint Migration...
Migrating on premises and cloud contents to SharePoint Online at no cost with...
Migrate to SharePoint Online using native Tools
One101 double the trouble double the fun_ migrating to one_drive and sharepoi...
Andy Malone - Migrating to office 365
Office 365 migration
SPO Migration - New API
How SharePoint Online Migration API Works
Ad

More from IT Industry (11)

DOCX
🕉️🌌🚀🦁👑BHAGWAN PADNABHANARASIMHAINFINITY 16 KALALU.docx👸♌🧑‍🚀🌌🕉️
DOCX
PRIME COMPARISON of Azure Data Bricks, Azure Synapse, vs Azure Data Factory.docx
DOCX
THE FUTURE OF AI SPACIAL PROJECTIONZ.docx
PPTX
DOOMS DAY SUPERHACKED SERIES PROJECTIONZ.pptx
DOCX
Document Library Folder Operations User Guide
DOCX
PDrive Validation Status Documentation
PDF
Mover Migration from Box to One drive
PDF
SP Rest API Documentation
PPTX
Box vs OneDrive Features Comparison
PPTX
Modern SharePoint Content Management Training
PPTX
Box vs One Drive
🕉️🌌🚀🦁👑BHAGWAN PADNABHANARASIMHAINFINITY 16 KALALU.docx👸♌🧑‍🚀🌌🕉️
PRIME COMPARISON of Azure Data Bricks, Azure Synapse, vs Azure Data Factory.docx
THE FUTURE OF AI SPACIAL PROJECTIONZ.docx
DOOMS DAY SUPERHACKED SERIES PROJECTIONZ.pptx
Document Library Folder Operations User Guide
PDrive Validation Status Documentation
Mover Migration from Box to One drive
SP Rest API Documentation
Box vs OneDrive Features Comparison
Modern SharePoint Content Management Training
Box vs One Drive

Recently uploaded (20)

PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
August Patch Tuesday
PDF
Getting Started with Data Integration: FME Form 101
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Tartificialntelligence_presentation.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
A comparative study of natural language inference in Swahili using monolingua...
Heart disease approach using modified random forest and particle swarm optimi...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
August Patch Tuesday
Getting Started with Data Integration: FME Form 101
WOOl fibre morphology and structure.pdf for textiles
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Enhancing emotion recognition model for a student engagement use case through...
cloud_computing_Infrastucture_as_cloud_p
Assigned Numbers - 2025 - Bluetooth® Document
Encapsulation_ Review paper, used for researhc scholars
Zenith AI: Advanced Artificial Intelligence
OMC Textile Division Presentation 2021.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Tartificialntelligence_presentation.pptx
Approach and Philosophy of On baking technology
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.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.