question

JovenPinca-1646 avatar image
0 Votes"
JovenPinca-1646 asked JovenPinca-1646 commented

Duplicated folders after migration SharePoint Migration Tools

Hello,

I have migrated some files and folders from a windows server to SharePoint online site using SharePoint Migration Tool. When I go to site>documents to check, I saw the migrated files, but I have noticed that there are duplicate folder which is also the primary folder I just moved. I cannot just delete it because I don't know which one has complete files.

Also, does it really creates another folder with the name same with the site name then that is where the migrate files were being stored? Some of the migrated files on other site the data was just stored under Documents not like on a Folder with same site name under Documents.

I'd like to know what is the cause of multiple file duplication after it migrates to target site also how to get the size of each folder aside from total storage consumption on Active Sites of admin page, it will help me to identify which folder should I delete.

Hope someone can answer my questions above.

Thanks,

office-sharepoint-onlineoffice-sharepoint-server-administration
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

CaseyYangMSFT-4714 avatar image
0 Votes"
CaseyYangMSFT-4714 answered JovenPinca-1646 commented

Hi @JovenPinca-1646

Per my test, I didn’t find out why SharePoint Migration Tool creates multiple duplicated folders. But you can check folder size in Storage Metrics.

Please follow the steps below:
Site Information > View all site settings > Site Collection Administration > Storage Metrics
99434-1.png

And you can use PowerShell to check folder size.
PowerShell codes:

 #Function to Get the size of a Folder in SharePoint Online
 Function Get-SPOFolderSize([Microsoft.SharePoint.Client.Folder]$Folder)
 { 
      Try
      {
         #Get all Files and Subfolders from the folder
         $Ctx.Load($Folder.Files)
         $Ctx.Load($Folder.Folders)
         $Ctx.ExecuteQuery()
    
         $FolderSize = 0
         ForEach($File in $Folder.Files | Where {-Not($_.Name.EndsWith(".aspx"))})
         {
             #Get File versions
             $Ctx.Load($File.Versions)
             $Ctx.ExecuteQuery()
             $VersionSize=0
             If($File.Versions.Count -ge 1)
             {
                 #Calculate Version Size
                 $VersionSize = $File.Versions | Measure-Object -Property Size -Sum | Select-Object -expand Sum                                
             }
             $FileSize =  [Math]::Round((($File.Length) + $VersionSize)/1KB, 2)
             If($FileSize -gt 0)
             {
                 Write-host "`tSize of the File '$($File.Name)' "$FileSize
             }
    
             #Get File Size
             $FolderSize += $FileSize
         }
    
         If($FolderSize -gt 0)
         {
             Write-host -f Yellow "Total Size of the Folder '$($Folder.ServerRelativeUrl)' (KB): " -NoNewline
             $FolderSize= [Math]::Round($FolderSize/1KB, 2)
             Write-host $FolderSize
         }
         #Process all Sub Folders
         ForEach($Folder in $Folder.Folders | Where {-Not($_.Name.StartsWith("_") -or $_.Name -eq "Forms")})
         {
             #Call the function recursively
             Get-SPOFolderSize $Folder
         }
     }
     Catch [System.Exception]
     {
         Write-Host -f Red "Error:"$_.Exception.Message
     }
 }
       
 #parameters
 $SiteURL = "https://tenant-admin.sharepoint.com/"
    
 #Get credentials to connect to SharePoint Online Admin Center
 $Cred = Get-Credential
       
 #Set up the context
 $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
 $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
         
 #Get the Web
 $Web = $Ctx.Web
 $RootFolder = $Web.RootFolder
 $Ctx.Load($RootFolder)
 $Ctx.ExecuteQuery()
      
 #Call the function to get Subsite size
 Get-SPOFolderSize -Folder $RootFolder

For Reference:
https://www.sharepointdiary.com/2018/06/sharepoint-online-get-folder-size-using-powershell.html
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.



If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.




1.png (25.3 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello, @CaseyYangMSFT-4714

Probably we have mistakenly chosen another folder destination because the first migration job was from the source server but we continued it on a Windows 10 PC. We are now running other migration job smoothly.

Another question is that some .avi file is not playable directly from the site, an error appears saying something unsupported bit rate. Tried to play the sample .avi file with 30 seconds duration got from the web and it is working.

Do you have any idea on this?

Regards,
Jovs

0 Votes 0 ·