-
Notifications
You must be signed in to change notification settings - Fork 4
Add Export-CrmData function #1
base: master
Are you sure you want to change the base?
Conversation
…rosoft.Xrm.DevOps.Data.PowerShell module functions.
Hi @ScottColson, This should be useful! Please update the sample files to incorporate this functionality, as they are very important to using this module. This includes the Full.ps1 export settings file and the Export.ps1 script that the export is initiated from. I will review again afterwards and provide any further relevant feedback. Thanks, Alan |
…tionMigration for data export.
PR is updated to use Microsoft.Xrm.Tooling.ConfigurationMigration PowerShell module. Updated Advanced example to show usage. |
samples/Advanced/Export.ps1
Outdated
@@ -12,7 +12,7 @@ | |||
$ExportSettings, | |||
|
|||
# The available actions to perform during the export | |||
[ValidateSet('All','Solutions','Export-CrmSolutions','Expand-CrmSolutions','Edit-CrmSchemaFile','Expand-CrmData')] | |||
[ValidateSet('All','Solutions','Data','Export-CrmSolutions','Expand-CrmSolutions','Edit-CrmSchemaFile','Expand-CrmData')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Export-CrmData
needs to be added to this list.
@@ -73,6 +73,14 @@ $projectRoot = Split-Path -Parent $scriptsRoot | |||
account = {$_ -in 'accountid','parentaccountid'} # only export accountid and parentaccountid fields | |||
} | |||
} | |||
|
|||
# ExportData is used by export.ps1. Defines configuration data schema file to use for export and the zip file to put the data in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation is not consistent, is sometimes using spaces and other times is using tabs. Please use spaces since the existing code already uses them.
@@ -35,7 +35,8 @@ ProcessorArchitecture = 'None' | |||
|
|||
# Modules that must be imported into the global environment prior to importing this module | |||
RequiredModules = @( | |||
@{ModuleName='Microsoft.Xrm.Data.Powershell'; ModuleVersion='2.8.0'; Guid='7df9c140-65c3-4862-b3bc-73fad633aae4'} | |||
@{ModuleName='Microsoft.Xrm.Data.Powershell'; ModuleVersion='2.8.0'; Guid='7df9c140-65c3-4862-b3bc-73fad633aae4'}, | |||
@{ModuleName='Microsoft.Xrm.Tooling.ConfigurationMigration'; ModuleVersion='1.0.0.44'; Guid='162392C2-EDE9-4754-B5A3-7DE42E5C768C'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make spacing consistent per other comments.
@ScottColson it seems your branch was not based on the latest version of code from the master branch. Please resolve the merge conflicts, then I will be able to start some testing. |
Sigh... Apparently I need to do this more often. Fixed. I opted not to update the docs since it looks like you might be doing that automatically from code comments. |
I had forgot about the docs. I believe I used this script as a starting point to generate the markdown file. If you could make the doc that would be helpful. |
I updated readme.md and added docs\functions\Export-CrmData.md. |
Checking in to verify i'm not blocking you on this. Let me know if you need anything else from me. |
@amervitz Checking in to verify that I'm not blocking you on this. Let me know if you need anything else from me. |
@ScottColson I need to find the time to test this. Have you tested data export in the Export.ps1 script that performs all the export actions? |
@amervitz I've not tested the full export.ps1 script. I have tested the data export function in a personal project that is similar to the sample export. |
Added reference to Microsoft.Xrm.DevOps.Data.PowerShell module and created Export-CrmData function to use Microsoft.Xrm.DevOps.Data.PowerShell to export data from the target database and export it as a zip file. Zip file is compatible with existing function to Expand and Compress data.