In this article:
Introduction
The Import and Export module can be used for moving customizations or other blob files with a zip-file download/upload, as well as moving an entire Wizdom installation with all its data and configurations.
1) The first use case is moving customizations or other blob files with a zip-file download/upload.
2) The second use case is moving an entire Wizdom installation with all data and all configuration.
- Endpoints in the module requires Enterprise admin permissions.
- A user without required permissions will see empty pages.
- The export page display a full overview of both the public and the private blob.
- Selecting folders or files in the overview will enable the download button. A zip file is then created and downloaded.
- The import page lets the user select a zip file using the “browse” functionality. This enables the upload button which will send the zip file to Wizdom.
- The zip file is then extracted and all of its content is displayed in the blob. The content will be extracted to a structure matching the folder structure of the zip file
____________________________________________________________________________________________________________________
Import and Export Scenarios
Move an entire Enterprise install with data and configurations
The migration/move of an entire Wizdom installation is done by following these steps one by one.
If step 1 and 2 are completed without step 3. The installation will be in a state where it is not possible to upgrade or install
1. Backup-Restore of Wizdom SQL Database
This is done by standard Microsoft tools. Example Microsoft SQL Management Studio.
2. Copy Wizdom blob storage
AzCopy is a tool to upload, download and synchronize Azure blob containers.
2.1 Requirements
- Download Microsoft Azure Storage Tools here: http://aka.ms/downloadazcopy
- Aquire the Url for blobA and blobB on the container menu item under the storage container.
- Acquire storage keys for BlobA and blobB on the dashboard for each storage container.
2.2 Copy Enterprise blob files from BlobA to BlobB using powershell
$azPath = “C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy”
Set-Location $azPath
# Storage account keys
$SourceKey = “”
$DestKey = “”
# Blob url ex. https://…../wizdom365secure
$SourcePrivate = “”
$DestPrivate = “”
# Blob url ex. https://…../wizdom365public
$SourcePublic = “”
$DestPublic = “”
# folder to temporary store licensefile
$TempFileLocation = “D:\TempWizdomLicense”
#Temporary download license file
$Result = .\AzCopy /Source:$DestPrivate /SourceKey:$DestKey /Dest:$TempFileLocation /s /y /Pattern:”License”
$Result
#Copy entire blob
$Result = .\AzCopy /Source:$SourcePrivate /SourceKey:$SourceKey /Dest:$DestPrivate /DestKey:$DestKey /s /y
$Result
$Result = .\AzCopy /Source:$SourcePublic /SourceKey:$SourceKey /Dest:$DestPublic /DestKey:$DestKey /s /y
$Result
#Upload license file
$Result = .\AzCopy /Source:$TempFileLocation /Dest:$DestPrivate /DestKey:$DestKey /s /y
$Result
- /s to include folder structure
- /y to overwrite files
- /XO to only copy files where the source file is newer than the destination file.
2.4 Resources
- https://blogs.technet.microsoft.com/canitpro/2015/12/28/step-by-step-using-azcopy-to-transfer-files-to-azure/
- https://azure.microsoft.com/en-us/documentation/articles/storage-use-azcopy/
____________________________________________________________________________________________________________________
Invoke Enterprise change mappings endpoint
This can be invoked in two ways. Through Wizdom administration on the page “Change mappings” in the Export and Import module, or through code with a http post request.
If the mappings are typed into the page in the Wizdom administration it is possible to preview the post request. And then use this request to invoke the endpoint through code.
Permissions
The endpoint is available to all with Wizdom admin permissions or to everyone as long as the database is in a migrated state. Every time the endpoint is called the database change to active state. So after a database is migrated this endpoint is available to be invoked one time and one time only without Wizdom admin permissions.
Invoke from Wizdom Admininstration
This functionality can be invoked from the Wizdom administration module “Export and import” under “Modules”. The page “Change mappings” will display a list of “From” and “To” values. Most of the “From” values will be provided by the application when the page is displayed. The “To” values are for the user to provide. If nothings is typed into the “To” value, that mapping set will be ignored. So the user do not need to provide “To” values for all the mappings that should not be changed. The new mappings a applied to Wizdom when the user click the “Apply mappings” button.
Invoke with Powershell
Requires a trusted app registered in the domain.
- Create a Native client application in the Azure AD
- Minimal required permissions are
- Windows Azure Active Directory : Sign in and read user profile
- Office 365 SharePoint Online : Read items in all site collections
- Minimal required permissions are
- Download and install ADAL for PowerShell here: https://github.com/kenakamu/Microsoft.ADAL.PowerShell
- Run this PowerShell:
# Import Micrsoft.ADAL.Powershell module
Import-Module Microsoft.ADAL.Powershell
#ADAL – Creadentials
$user = “###”
$pass = “###”
#ADAL – authority ie. wizdom.onmicrosoft.com
$authority = “###”
#ADAL – clientId (guid)
$clientId = “###”
#ADAL – resourceId ie. https://wizdom.sharepoint.com/
$resourceId = “###”
#ADAL – accessToken
$accessToken = Get-ADALAccessToken -AuthorityName $authority -ClientId $clientId -ResourceId $resourceId -UserName $user -Password $pass
#Request
#The root of your Wizdom website ie. https://wizdom.azurewebsites.net
$wizdomHost = “###”
#A SharePoint sitecollection url ie. https://wizdom.sharepoint.com/sites/intranet
$sharepointHostUrl = “###”
$url = $wizdomHost + “/api/wizdom/exportimport/1/mappings” + “?sphosturl=” + $sharepointHostUrl
$headers = @{}
$headers[“Bearer”] = $accessToken
$headers[“x-wizdom-rest”] = “true”
#Request body – A json mapping schema
$postRequest = @”
{
“urls”: [
{
“from”: “”,
“to”: “”
},
{
“from”: “”,
“to”: “”
}
],
“domains”: [
{
“from”: “”,
“to”: “”
},
{
“from”: “”,
“to”: “”
}
],
“users”: [
{
“from”: “”,
“to”: “”
}
],
“clearAdminPermissions”: false
}
“@
Invoke-WebRequest -Uri $url -Method Post -Body $postRequest -ContentType “application/json” -Headers $headers
Comments
0 comments
Please sign in to leave a comment.