ezcopy from sharepoint to blob storage

Arif Usman 496 Reputation points
2023-08-23T03:18:56.5133333+00:00

folks,

Trying to use ezcopy from SPO to blob storage, it runs fine, but there are no files and folders copied.

So I mapped SPO to the network drive using

#Parameters

$LibraryPath = "https://crescent.sharepoint.com/sites/Marketing/Branding"

$UNCPath = "\\crescent.sharepoint.com@SSL\DavwwwRoot\Sites\Marketing\Branding" 

#Establish a browser session

$IE = Start-Process -file iexplore -arg $LibraryPath -PassThru -WindowStyle Hidden

Sleep 15

$IE.Kill() 

#Map a PowerShell Drive

New-PSDrive -name "R" -Root $UNCPath -PSProvider filesystem

So it mapped to R drive. Then, using ezcap copy

$source = "'R:\microsoft\*'"

$Dest   = "https://microsoft.blob.core.windows.net/redmond/subsite?sp=saskey"  azcopy copy $source $Dest --recursive

this is the message I am getting.

INFO: Scanning...

INFO: Any empty folders will not be processed, because the source and/or destination doesn't have full folder support

How can I copy all files and folders from SPO to the Azure Blob container? Files\folders in SPO are not modified or when created a situation as per solution in logic apps\automate, these are files\folders already there, just need to copy over to blob.

Thanks for your help in advance.

#Read more:https://www.sharepointdiary.com/2019/09/map-network-drive-in-sharepoint-online-using-powershell.html#ixzz8BAvQII00

Community Center Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RevelinoB 3,675 Reputation points
    2023-08-23T03:40:48.9233333+00:00

    Hi Arif,

    When I look at your post, It looks like you're trying to use PowerShell and the AzCopy utility to copy files and folders from a SharePoint Online (SPO) library to an Azure Blob container. However, the message you're encountering indicates that empty folders won't be processed, likely because AzCopy doesn't fully support empty folders in this scenario.

    To address this issue and copy all files and folders from SPO to the Azure Blob container, you might consider using Microsoft's SharePoint Migration Tool or SharePoint Online Management Shell in combination with AzCopy. Here's an alternative approach:

    SharePoint Migration Tool:

    Microsoft provides the SharePoint Migration Tool, which is designed to help migrate content from on-premises SharePoint sites and file shares to SharePoint Online and OneDrive for Business. It also supports migration from SharePoint Online to SharePoint Online.

    You can use this tool to copy the content from your SPO library to an Azure Blob container. Here's a high-level outline of the process:

    • Download and install the SharePoint Migration Tool.
    • Set up a new migration project and configure the source (SPO library) and destination (Azure Blob container).
    • Run the migration project to copy the files and folders from SPO to the Azure Blob container.

    This tool handles not just files but also folder structures and metadata. You might need to adapt it slightly for your specific case, but it's generally designed for these types of tasks.

    SharePoint Online Management Shell with AzCopy:

    You can use the SharePoint Online Management Shell to connect to your SharePoint Online environment and retrieve the files' URLs. Then, use AzCopy to copy the files from SharePoint Online to the Azure Blob container.

    Here's a rough outline of the steps:

    • Use SharePoint Online Management Shell to connect to your SharePoint Online environment.
    • Retrieve the URLs of the files you want to copy.
    • Use AzCopy to copy the files from their URLs to the Azure Blob container.

    This approach might require some scripting to automate the process, especially if you have a large number of files.

    Be aware that the exact steps and scripts you need might depend on your specific environment, permissions, and other factors. Make sure to consult Microsoft's documentation for the SharePoint Migration Tool, SharePoint Online Management Shell, and AzCopy to ensure you're using the most up-to-date and accurate information. If you have any further questions please let me know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.