Skip to content
This repository was archived by the owner on Jan 24, 2021. It is now read-only.

Add Export-CrmData function #1

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

ScottColson
Copy link

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.

…rosoft.Xrm.DevOps.Data.PowerShell module functions.
@amervitz
Copy link
Contributor

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

@ScottColson
Copy link
Author

PR is updated to use Microsoft.Xrm.Tooling.ConfigurationMigration PowerShell module. Updated Advanced example to show usage.

@@ -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')]
Copy link
Contributor

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.
Copy link
Contributor

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'}
Copy link
Contributor

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.

@amervitz
Copy link
Contributor

@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.

@ScottColson
Copy link
Author

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.

@amervitz
Copy link
Contributor

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.

@ScottColson
Copy link
Author

I updated readme.md and added docs\functions\Export-CrmData.md.

@ScottColson
Copy link
Author

Checking in to verify i'm not blocking you on this. Let me know if you need anything else from me.

@ScottColson
Copy link
Author

@amervitz Checking in to verify that I'm not blocking you on this. Let me know if you need anything else from me.

@amervitz
Copy link
Contributor

@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?

@ScottColson
Copy link
Author

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants