Using AZCopy to copy data

We recommend using the AZCopy utility to copy data files from the source system to the target system in the cloud. The utility is optimized for performance and can restart and recover from a failed data transfer.

Note: The layout of information in the Microsoft Azure portal will change as Microsoft releases updates. Use the search field to find buttons or fields that have moved.

Create a storage account in Azure

  1. Log into your Microsoft Azure Portal.
  2. Create a new storage account:
    1. If necessary, select your subscription.
    2. Under Azure services, click Storage accounts.

      List of Azure services with Storage accounts button circled

      Note: If you don't see the Storage accounts button, type Storage accounts in the search field.

    3. Click New or, if you already have another storage account, click Add.

      Storage accounts New button

    4. Under the Resource group field, click Create new and enter a name for the resource group.

      Popup window to create new resource group

    5. Enter a storage account name.
    6. Select any location.
    7. Click Next: Networking.
    8. In the Connectivity method area, select the Public endpoint (all networks) option.

      Connectivity method area with Public endpoint option selected

    9. Click Review + Create.
    10. When you see the "Validation passed" message, click Create.

      Screen showing Validation passed message with Create button

  3. When you receive the message letting you know that the deployment was successful, click Go to resource.

    Go to resource button

  4. Grant access to the storage account by setting up a shared access signature (SAS):
    1. On the left side of the screen, click Shared access signature.
    2. Under Allowed services, select the following check boxes:
      • Blob
      • File

      Shared access signature storage

    3. Under Allowed resource types, select the Container check box.
    4. Under Allowed permissions, select the Write check box and any other permissions that you want to allow.
    5. Under Start and expiry date/time, in the End field, enter an expiration date for the access key. For security purposes be sure the date is no further in the future than what is needed to complete the migration.
    6. Under Allowed protocols, select the HTTPS only option.
    7. Click Generate SAS and connection string.
    8. Copy the SAS token to a Notepad file or other location for later use.

      Important! You must make note of the SAS token before leaving the setup page; otherwise, you will have to generate a new one.

Create a container in the storage account

This container will be used for the file transfer.

  1. On the left side of the screen, click Overview to return to the storage account information page.
  2. Click the Containers tile.
  3. Click the New containers button. New container button
  4. Enter a name for the container and then click Create.

Upload the source MAS90 folder into the Azure storage account

  1. On the computer where your source MAS90 folder is located, download AzCopy V10 from the Microsoft website.
  2. Create a new folder: C:\Sage\utils
  3. Extract the file in the utils folder created in the previous step.
  4. Open a text editor, such as Notepad, and copy the following text into the file. (You'll then replace the sections that are highlighted in the next step.)

    @REM =========================================================================

    @REM Location of AzCopy v10

    @set AZCOPY="<Path-to-AZCOPY-V10>"

    @REM =========================================================================

    @REM lowercase letter and numbers only

    @set AZAccount="<StorageAccount>"

    @REM **** The SAS Token - make sure to add % before each % so you end up with %%

    @set SASToken="<SAS-Token>"

    @REM =========================================================================

     

    @REM -------------------------------------------------------------------------

    @set sourceDir="<SourceFolder>"

    @REM lowercase letter and numbers only

    @set AZContainer="<BLOB-Container>"

    @REM -------------------------------------------------------------------------

     

    @echo Copy Folder Contents to Azure Blob Storage

    @echo Source folder: %sourceDir%

    @echo Azure Storage Account: %AZAccount%

    @echo Azure Storage Container: %AZContainer%

     

    %AZCOPY% copy %sourceDir% https://%AZAccount%.blob.core.windows.net/%AZContainer%/%SASToken% --recursive --from-to=LocalBlob

     

    :DONE

    ECHO Done.

    PAUSE

    exit 0

  5. Replace the highlighted values:
    • <Path-to-AZCOPY-V10>: Replace with the full path to the azcopy.exe file.

      Example: C:\Sage\utils\azcopy-10.9.0\azcopy.exe

    • <StorageAccount>: Replace with the name of the storage account that you setup in Azure.
    • <SAS-Token>: Replace with the SAS token generated when you set up the storage account in Azure.

      After copying the SAS token, add a percent symbol (%) before each existing percent symbol. For example: %%sastoken%%

    • <SourceFolder>: Replace with the full path to the source MAS90 folder that you are migrating data from.
    • <Blob-Container>: Relace with the name of the container created in Azure Blob storage. This container is where the MAS90 files will be copied.
  6. Save the file using a batch (.bat) file extension. For example: filename.bat
  7. Run the .bat file that you created.

The MAS90 folder is uploaded to the Azure Blob storage.

Download the MAS90 folder from the storage account to site

  1. Go to the Sage Partner Cloud site that you provisioned and connect using the Virtual Machine Access option.
  2. Download the latest version of AzCopy version 10 from the Microsoft website.
  3. Create a new folder: C:\Sage\utils
  4. Extract the file in the utils folder created in the previous step.
  5. Open Notepad and copy the following text into the file. (You'll then replace the sections that are highlighted in the next step.)

    @REM =========================================================================

    @REM Location of AzCopy v10

    @set AZCOPY="<Path-to-AZCOPY-V10>"

    @REM

    @REM Adjust TRANSFER CAP for slower internet connections (in megabits per second); 0 for no cap

    @set AZCAP="0"

    @REM =========================================================================

     

    @REM =========================================================================

    @REM lowercase letter and numbers only

    @set AZAccount="<StorageAccount>"

    @REM **** The SAS Token - make sure to add % before each % so you end up with %%

    @set SASToken="<SAS-Token>"

    @REM =========================================================================

     

    @REM Change location to local folder for the build downloads

    @REM -------------------------------------------------------------------------

     

    @set LocalDestFolder="<DestinationFolder>"

    @REM lowercase letter and numbers only

    @set AZContainer="<BLOB-Container>"

    @REM -------------------------------------------------------------------------

    @echo Download from Azure Blob Storage to Local Folder

    @echo Destination folder: %LocalDestFolder%

    @echo Azure Storage Account: %AZAccount%

    @echo Azure Storage Container: %AZContainer%

     

    @%AZCOPY% cp https://%AZAccount%.blob.core.windows.net/%AZContainer%/*%SASToken% %LocalDestFolder% --recursive=true --cap-mbps %AZCAP%

     

    @REM Pause is here to see the results of the copy in the command window

    @PAUSE

  6. Replace the highlighted values:
    • <Path-to-AZCOPY-V10>: Replace with the full path to the location of the the AZcopy file.

      Example: C:\Sage\utils\azcopy-10.9.0\azcopy.exe

    • <StorageAccount>: Replace with the name of the storage account that you setup in Azure.
    • <SAS-Token>: Replace with the SAS token generated after setting up the storage account in Azure.

      After copying the SAS token, add a percent symbol (%) before each existing percent symbol. For example: %%sastoken%%

    • <DestinationFolder>: Replace with the path to the folder in which the data will be saved.
    • <BLOB-Container>: Replace with the name of the container in Azure Blob storage, which should now contain the data.
  7. Save the file with a batch (.bat) file extension. For example: filename.bat
  8. Run the .bat file that you created.

The MAS90 folder is downloaded from Azure to the Sage Partner Cloud site.