-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStart-SPOMigration.ps1
More file actions
27 lines (26 loc) · 1.83 KB
/
Start-SPOMigration.ps1
File metadata and controls
27 lines (26 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$creds = Get-Credential "dennis@hobmaier.net"
$sourcefilepath = “\\knecht\test”
$packageoutputpath = “\\knecht\Package”
$packageoutputpathout = “\\knecht\OutputPackage”
$targetweburl = “https://dns4ever.sharepoint.com/sites/Projekte”
#$targetdoclib = "CenterTools"
$targetdoclib = "IconsCT"
$filecontainername = "payload"
$packagecontainername = "migrationpackage"
$azurequeuename = “spomigration”
$azureaccountname = "<azurestorageaccountname>"
$azurestoragekey ="<azurestoragekey>"
#$targetsubfolder = "Office365Konferenz"
Import-Module Microsoft.Online.SharePoint.PowerShell -ErrorAction SilentlyContinue
write-host 'New Package'
$pkg = New-SPOMigrationPackage -SourceFilesPath $sourcefilepath -OutputPackagePath $packageoutputpath -TargetWebUrl $targetweburl -TargetDocumentLibraryPath $targetdoclib –NoADLookup -ErrorAction Stop
write-host 'Convert Package'
$tpkg = ConvertTo-SPOMigrationTargetedPackage -SourceFilesPath $sourcefilepath -SourcePackagePath $packageoutputpath -OutputPackagePath $packageoutputpathout -TargetWebUrl $targetweburl -TargetDocumentLibraryPath $targetdoclib -Credentials $creds -ErrorAction stop
write-host 'Upload package'
$uploadresult = Set-SPOMigrationPackageAzureSource –SourceFilesPath $sourcefilepath –SourcepackagePath $packageoutputpathout –FileContainerName $filecontainername –PackageContainerName $packagecontainername –AzureQueueName $azurequeuename –AccountName $azureaccountname -AccountKey $azurestoragekey -ErrorAction Stop
write-host 'FileContainerUri' $uploadresult.FileContainerUri
write-host 'FileContainerUploadUri' $uploadresult.FileContainerUploadUri
write-host 'Start Migration'
$jobresult = Submit-SPOMigrationJob –TargetwebUrl $targetweburl –MigrationPackageAzureLocations $uploadresult –Credentials $creds -ErrorAction Stop
write-host $jobresult
Write-host 'Done'