organizationsetup - All DataSet
DataSet Value: All
The All DataSet option performs a complete environment setup, copying all reference data, system configuration, and master data from a template environment to a target environment. This is the most comprehensive configuration option, performing 40+ individual operations.
When to Use
Use the All DataSet when:
✅ Setting up a brand new Navigator environment from scratch
✅ Establishing a new development, test, or production environment
✅ Performing complete environment configuration after initial deployment
✅ Restoring all reference data after a major environment change
✅ Creating a new environment that needs all standard Navigator configuration
Do not use when:
❌ Only updating specific configuration areas (use targeted DataSet options instead)
❌ Target environment already has customised reference data you want to preserve (use specific DataSet with caution)
❌ You only need outcomes framework (use OutcomesFramework instead)
Command Syntax
.\WhanauTahi.Xpm.Tooling.exe organizationsetup `
--MasterDataUrl "https://masterdata.crm6.dynamics.com" `
--EnvironmentUrl "https://target.crm6.dynamics.com" `
--ClientId "12345678-1234-1234-1234-123456789abc" `
--DataSet "All"
How It Works
Operation Sequence
The All DataSet executes operations in a specific order to handle dependencies correctly:
1. Access & Identity Setup
├── Enable AutoCreateAccessTeams on entities
├── Create team templates (3 templates)
└── Create standard teams (Intake Team)
2. System Configuration
├── Copy system configuration records
└── Copy autonumber configuration
3. Reference Data - Basic
├── Assessment tools
├── Age groups
├── Ethnicities
├── Tribes and sub-tribes
├── Gathering places
├── Education levels
├── Consent types
├── Employment statuses
├── Autotexts
├── Activity groups
└── Exit reason mappings
4. PRIMHD Configuration
├── PRIMHD settings
├── PRIMHD activities
├── PRIMHD referral codes
└── PRIMHD teams
5. Contract & Service Setup
├── Contract grouping (2-pass operation)
├── Funding contract types
├── Funding contracts
├── Contract services
└── Service eligibility rules
6. Outcomes Framework
├── Outcome domains
├── Domain indicators
├── Outcome areas
├── Outcome categories
├── Domain-area relationships
├── Area-category relationships
├── Predefined outcomes
└── Predefined outcome activities
Access Team Configuration
The command configures access teams on three core entities:
Entities Modified:
contact- Individual recordsmag_familygroup- Family group recordsmag_plan- Plan records
Action: Enables AutoCreateAccessTeams metadata property
Team Templates Created:
| Template Name | GUID | Purpose |
|---|---|---|
| Individual Team Template | 8F1D681D-B770-E711-810F-000C2975F09B |
Auto-created teams for contact records |
| Family Group Team Template | 1EFF884E-C070-E711-810F-000C2975F09B |
Auto-created teams for family group records |
| Plan Team Template | 7D42E7A9-5568-E711-8108-000C2975F09B |
Auto-created teams for plan records |
Settings:
defaultaccessrightsmask: 262167 (Read, Write, Append, Append To)- Metadata changes trigger customisation publish
⚠️ CRITICAL: These GUIDs are hard-coded in the Navigator codebase and must never be changed. Modifying them will break team functionality across the platform.
Standard Team Creation
Team Created:
- Name: "Intake Team"
- GUID:
C030632C-D4D4-4F3C-9E3F-7452D834834A⚠️ DO NOT CHANGE - Type: Owner team (teamtype = 0)
- Administrator: Set to current user (from WhoAmI)
- Business Unit: Set to current user's business unit
System Configuration Records
Table: mag_sysconfig
Purpose: System-wide configuration settings controlling Navigator behavior
Fields Copied:
mag_name- Configuration key name (primary identifier)mag_value- Configuration valuemag_key- Additional key fieldmag_description- Configuration descriptionmag_image- Binary image data (if present)
Special Handling:
- GUIDs are not preserved (name-based uniqueness)
addToExistingData = true- Allows adding new configuration values- Can include binary data in
mag_imagefield
Autonumber Records
Table: wtl_autonumber
Purpose: Defines automatic numbering sequences for entities
Fields Copied:
wtl_name- Autonumber configuration namewtl_autonumbertype- Type of numberingwtl_entityschemaname- Target entity schema namewtl_fieldschemaname- Target field schema namewtl_staticprefix- Static prefix for generated numberswtl_numberlength- Length of numeric portionwtl_overwriteenabled- Allow overwriting existing valueswtl_concantenateschemanames- Schema names to concatenatewtl_format- Custom format stringwtl_formatparameters- Format parameterswtl_limitto- Limit numbering to specific recordswtl_primaryfield- Primary field reference
Special Handling:
wtl_currentpositionis always set to 0 in target (never copied)- GUIDs are not preserved (name-based uniqueness)
addToExistingData = true- Allows adding new autonumber configurations
⚠️ WARNING: Current position reset prevents number conflicts but means numbering starts at 0 in target environment.
Assessment Tools
Table: mag_assessmenttype
Purpose: Defines assessment types available in Navigator
Fields Copied:
mag_name- Assessment tool namemag_datacollectionmethod- Collection method (e.g., form-based, external)mag_entitylogicalname- Entity storing assessment datamag_prefix- Prefix for assessment recordsmag_formname- Form used for data entry
State Fields:
- When creating new:
statecode = 1(Inactive),statuscode = 809730000 - When updating: Copies state from source
⚠️ CRITICAL: Assessment tools are intentionally created inactive. Users must manually activate each assessment tool, which triggers the creation of required plugin steps. Do not modify this behavior.
Best Practice: After running organizationsetup, review and manually activate only the assessment tools required for the target environment.
Reference Data Tables
The following reference data tables are copied with standard processing:
Age Groups
Table: mag_agegroup
Fields:
mag_agegroupid- Preserved GUIDmag_name- Age group namemag_minimumage- Minimum age in rangemag_maximumage- Maximum age in range
Ethnicities
Table: mag_ethnicity
Fields:
mag_name- Ethnicity namemag_ethnicitycode- Official ethnicity codemag_priority- Display prioritymag_level- Hierarchical levelmag_visible- Visibility flag
Tribes and Sub-Tribes
Table: mag_tribe, mag_subtribe
Tribe Fields:
mag_tribeid- Preserved GUIDmag_name- Tribe namemag_iwicode- Official iwi codestatecode,statuscode- State information
Sub-Tribe Fields:
mag_subtribeid- Preserved GUIDmag_name- Sub-tribe namemag_subtribecode- Sub-tribe codemag_tribe- Parent tribe reference (resolved by name)statecode,statuscode- State information
Special Handling: Sub-tribes resolve parent tribe references by looking up tribe name in target environment.
Gathering Places
Table: mag_gatheringplace
Fields:
mag_gatheringplaceid- Preserved GUIDmag_name- Place namemag_address_street1/2/3- Street address linesmag_address_city- Citymag_address_country- Countrymag_address_postcode- Postal code
Education Levels
Table: mag_levelofeducation
Fields:
mag_levelofeducationid- Preserved GUIDmag_name- Education level namemag_description- Level description
Consent Types
Table: mag_consenttype
Fields:
mag_name- Consent type namemag_subtype- Consent subtype optionstatecode,statuscode- State information
Special Handling:
- Includes verbose console logging showing source/target counts
addToExistingDatacontrolled by command flag
Employment Statuses
Table: mag_employmentstatus
Fields:
mag_name- Employment status namestatecode,statuscode- State information
Autotexts
Table: mag_autotext
Purpose: Pre-defined text snippets for rapid data entry
Fields:
mag_name- Autotext name/triggermag_text- Expanded text contentstatecode,statuscode- State information
Special Handling: addToExistingData = true - Allows adding new autotexts to existing sets
Activity Groups
Table: mag_activitygroup
Fields:
mag_name- Activity group namemag_search1/2/3- Search/filter keywordsmag_description- Group descriptionstatecode,statuscode- State information
Exit Reason Mappings
Table: mag_exitreasonmapping
Purpose: Maps internal exit reasons to external reporting codes
Fields:
mag_name- Mapping namemag_wtnexitreason- Whānau Tahi Navigator exit reason code
PRIMHD Configuration
PRIMHD (Primary Mental Health and Addiction Data) configuration tables support mental health and addiction service reporting in New Zealand.
PRIMHD Settings
Table: mag_primhdsetting
Fields:
mag_primhdsettingid- Preserved GUIDmag_name- Setting namemag_code- PRIMHD codemag_codename- Code display namemag_description- Setting descriptionmag_codevalidfrom- Code valid from datemag_codevalidto- Code valid to datemag_localcode- Local code flag
PRIMHD Activities
Table: mag_primhdactivity
Fields:
mag_primhdactivityid- Preserved GUIDmag_name- Activity namemag_code- PRIMHD activity codemag_codename- Code display namemag_description- Activity descriptionmag_codevalidfrom- Code valid from datemag_codevalidto- Code valid to datemag_localcode- Local code flagmag_familyinvolved- Family involvement option
PRIMHD Referral Codes
Table: mag_referralcode
Primary Field: mag_code (unique identifier)
Fields:
mag_referralcodeid- Preserved GUIDmag_code- Primary code identifiermag_referralcode- Referral code valuemag_referralcodetypecode- Code type optionmag_referralcodename- Code display namemag_description- Code descriptionmag_codevalidfrom- Code valid from datemag_codevalidto- Code valid to date
PRIMHD Teams
Table: mag_primhdteam
Fields:
mag_primhdteamid- Preserved GUIDmag_name- Team namemag_teamname- Team display namemag_primhdteamcode- PRIMHD team codemag_description- Team description
Contract & Service Configuration
Contract Grouping
Table: mag_grouping
Purpose: Hierarchical grouping structure for organising contracts
Fields:
mag_name- Group namemag_grouptypecode- Group type optionmag_displayorder- Sort ordermag_parentgroupingid- Parent group reference
Special Handling - Two-Pass Processing:
First Pass:
- Creates all group records without parent references
- Console: "First pass - Creating groups..."
- Allows hierarchy to be established
Second Pass:
- Updates parent references after all groups exist
- Console: "Second pass - Setting parent references..."
- Resolves parent group references by name lookup
- Always uses
updateExisting = truefor second pass
Console Output:
U= Parent reference updated-= No parent reference to set
This two-pass approach ensures hierarchical data is created correctly even when parent groups are defined after children in the source data.
Funding Contract Types
Table: mag_contracttype
Fields:
mag_name- Contract type namemag_description- Type descriptionstatecode,statuscode- State information
Special Handling: addToExistingData = true - Allows new contract types to be added
Funding Contracts
Table: mag_fundingcontract
Fields:
mag_name- Contract namemag_agreementnumber- Agreement/contract numbermag_shortname- Short namemag_riskstatuscode- Risk status optionmag_providerid- Provider identifier- Date fields:
mag_startdate,mag_enddate,mag_signeddate,mag_exitclausedate mag_description- Contract description
EntityReference Fields (Resolved):
mag_contracttypeid- Contract type (bymag_name)mag_collectiveorgroupid- Collective/group (bymag_name)mag_parentfundingcontractid- Parent contract (bymag_name)mag_relationshipcontact- Relationship contact (byfullname)mag_financecontact- Finance contact (byfullname)mag_reportingcontact- Reporting contact (byfullname)mag_contractmanagerid- Contract manager (byfullname)mag_servicemanagerid- Service manager (byfullname)
Date Validation:
- Dates before January 1, 1850 are set to
null - Prevents invalid/corrupted dates from being copied
Contract Services
Table: mag_contractservice
Fields:
mag_name- Service namemag_shortname- Short name- Service configuration:
mag_allowoneclicksendaccept,mag_budgetedhours,mag_duplicatereferrals,mag_maximumreferrallimit,mag_ishardlimit - Eligibility:
mag_eligibilityrequirement,mag_ageeligibilitybasis,mag_othereligibility,mag_eligibility,mag_exclusion - Assessment flags:
mag_requirepartialadom,mag_requirefreeformmentalstateexamination - Reporting:
mag_primhdreportingrequired,mag_iris,mag_vinah,mag_vaed - Tracking:
mag_timetracking,mag_traveltimetracking - Dates:
mag_startdate,mag_enddate - Text:
mag_description,mag_staffingrequirements
EntityReference Fields (Resolved):
mag_contractid- Parent funding contract (bymag_name)mag_contractservicesite- Service site (bymag_name)mag_contractservicetypeid- Service type (bymag_name)mag_approvalsmanager- Approvals manager (byfullname)mag_servicecoordinatorid- Service coordinator (byfullname)mag_groupcollectiveid- Group/collective (bymag_name)
Date Validation: Same as funding contracts (dates before 1850 set to null)
Service Eligibility Rules
Table: mag_eligibilityrule
Purpose: Defines who is eligible for specific contract services
Primary Key: Composite key of mag_eligibilityrulename + mag_contractserviceid
Fields:
mag_eligibilityruleid- Preserved GUID (when not updating)mag_eligibilityrulename- Rule namemag_requirementlevel- Requirement level option- Age criteria:
mag_minimumage,mag_maximumage - Demographics:
mag_gender,mag_ethnicity,mag_tribe - Geographic:
mag_areablock - Other:
mag_cscscheck- CSCS check required flag
EntityReference Fields (Resolved):
mag_contractserviceid- Contract service (bymag_name)mag_ethnicity- Ethnicity requirement (bymag_name)mag_tribe- Tribe requirement (bymag_name)mag_areablock- Area block (bymag_areablock)
⚠️ SPECIAL HANDLING: This table uses a composite key. Multiple rules can have the same name if they're associated with different contract services. The command's special logic in EntityHelper.CreateIfNew handles this correctly.
Console Output:
- Verbose logging shows contract service name resolution
- "Checking eligibility rule with name: [name] and contract service ID: [id]"
- "Creating new eligibility rule" or "Updating existing eligibility rule"
Outcomes Framework
Outcome Domains
Table: mag_domain
Purpose: Top-level categorisation of outcomes (e.g., Health, Education, Employment)
Fields:
mag_name- Domain namemag_outcomemap- Outcome mapping optionstatecode,statuscode- State information
Domain Indicators
Table: mag_outcomedomainindicator
Purpose: Measurable indicators within outcome domains
Fields:
mag_name- Indicator namemag_indicatorcode- Indicator codemag_outcomedomain- Parent domain reference (resolved bymag_name)statecode,statuscode- State information
Special Handling:
- Resolves parent domain by name
- Console: "Could not resolve domain reference for indicator: [name]" if parent not found
- Returns
falseif parent domain cannot be resolved
Outcome Areas
Table: mag_outcomearea
Purpose: Specific outcome areas within domains
Fields:
mag_name- Area namestatecode,statuscode- State information
Outcome Categories
Table: mag_outcomecategory
Purpose: Detailed categorisation within outcome areas
Fields:
mag_name- Category namestatecode,statuscode- State information
Domain-Area Relationships
Table: mag_mag_outcomearea_mag_domain
Purpose: Many-to-many relationships between domains and areas
Primary Field: mag_mag_outcomearea_mag_domainid (relationship record ID)
Fields:
mag_domainid- Domain EntityReferencemag_outcomeareaid- Outcome area EntityReference
Processing Logic:
- Retrieves source domain and area GUIDs from relationship record
- Looks up domain and area names in template environment
- Finds matching domain and area in target by name
- Creates new relationship using target EntityReferences
Console Output:
- "Source: Domain '[name]' - Area '[name]'"
- "Creating relationship in target between [domain] and [area]"
- Error messages if resolution fails
Special Handling: Verbose logging helps troubleshoot relationship creation issues.
Area-Category Relationships
Table: mag_mag_outcomecategory_mag_outcomearea
Purpose: Many-to-many relationships between areas and categories
Primary Field: mag_mag_outcomecategory_mag_outcomeareaid (relationship record ID)
Fields:
mag_outcomeareaid- Outcome area EntityReferencemag_outcomecategoryid- Outcome category EntityReference
Processing Logic: Same pattern as domain-area relationships
Console Output:
- "Source IDs - Area: [id], Category: [id]"
- "Source: Area '[name]' - Category '[name]'"
- "Target IDs - Area: [id], Category: [id]"
- "Creating relationship in target between [area] and [category]"
Predefined Outcomes
Table: mag_predefinedoutcome
Purpose: Template outcomes that can be added to plans
Fields:
mag_predefinedoutcomeid- Preserved GUIDmag_name- Outcome namemag_outcomename- Display namemag_pdbnumber- PDB numbermag_description- Outcome description- Duration:
mag_duration,mag_stdduration mag_createfromreferral- Auto-create flag
EntityReference Fields (Resolved by mag_name):
mag_activitydefaultservice- Default servicemag_service- Associated servicemag_analysis1,mag_analysis2,mag_analysis3- Analysis fieldsmag_domain1,mag_domain2,mag_domain3- Associated domainsmag_outcomearea1,mag_outcomearea2,mag_outcomearea3- Associated areasmag_outcomecategory1,mag_outcomecategory2,mag_outcomecategory3- Associated categories
Special Handling: Custom PredefinedOutcomeWriter handles multiple domain/area/category references.
Predefined Outcome Activities
Table: mag_predefinedactivity
Purpose: Template activities linked to predefined outcomes
Primary Key: Composite key of mag_name + mag_service
Fields:
mag_name- Activity namemag_summary- Activity summarymag_pdanumber- PDA numbermag_message- User message- Boolean flags:
mag_familygroupactivity,mag_createbackdatedactivity,mag_requiredforenrolment,mag_enrolment,mag_clientfacing,mag_globalenrolment - Options:
mag_activitytype,mag_assessmenttype,mag_who,mag_startafterfrom,mag_startaftertype,mag_dueaftertype,mag_startat,mag_referralstagetogenerate - Timing:
mag_startafter,mag_dueafter
EntityReference Fields (Resolved by mag_name):
mag_service- Associated contract servicemag_predefinedoutcome- Parent predefined outcomemag_assessmenttool- Associated assessment toolmag_consenttype- Required consent typemag_dynamicassessmenttemplate- Assessment templatemag_activitygroup1a,mag_activitygroup2a,mag_activitygroup3a- Activity groups
⚠️ SPECIAL HANDLING: Uses composite key (name + service). Multiple activities can have the same name if associated with different services. Custom logic in EntityHelper.CreateIfNew handles this.
Console Output:
- "Checking predefined activity with name: [name] and service ID: [id]"
- "Retrieved mag_name: [service name]"
- "Creating new predefined activity" or "Updating existing predefined activity"
Contract Service Types and Sites
These tables support the ServiceTransfer DataSet but are also used in All:
Contract Service Types
Table: mag_contractservicetype
Fields:
mag_name- Service type name
Note: Simple lookup table with minimal fields
Contract Service Sites
Table: mag_contractservicesite
Fields:
mag_name- Site namemag_code- Site codestatecode,statuscode- State information
Real-World Scenarios
Scenario 1: New Production Environment
Context: Deploying Navigator to a new production environment for the first time.
.\WhanauTahi.Xpm.Tooling.exe organizationsetup `
--MasterDataUrl "https://masterdata.crm6.dynamics.com" `
--EnvironmentUrl "https://newprod.crm6.dynamics.com" `
--ClientId "12345678-1234-1234-1234-123456789abc" `
--Secret "your-secret-here" `
--DataSet "All"
Expected Console Output:
Navigator environment prepration tool
Master Data: Whānau Tahi Master Data
Target System: Production Environment
Access teams ... done
Standard teams ... done
System config records ...+++++... done
Autonumber records ...+++... done
Assessment tools ...++++++... done
Age Groups ...+++++... done
Ethnicities ...++++++++++... done
...
Environment preparation completed
Post-Setup Tasks:
- Review and activate required assessment tools
- Verify team templates created correctly
- Confirm access teams enabled on core entities
- Test autonumber sequences
Scenario 2: Development Environment Refresh
Context: After refreshing dev from production, need to restore dev-specific reference data.
.\WhanauTahi.Xpm.Tooling.exe organizationsetup `
--MasterDataUrl "https://devmasterdata.crm6.dynamics.com" `
--EnvironmentUrl "https://refresheddev.crm6.dynamics.com" `
--ClientId "12345678-1234-1234-1234-123456789abc" `
--DataSet "All" `
--AddToExistingData `
--UpdateExisting
Why this works:
AddToExistingDataallows operations even though production data existsUpdateExistingupdates records to match dev master data values- Dev-specific assessment tools, autotexts, and test data restored
Console Output:
...
System config records ...UUU++U... done
Autonumber records ...UUU... done
...
U= Records updated to dev values+= New dev-specific records added-= Records unchanged
Scenario 3: Complete Environment Rebuild
Context: Environment corruption requires complete configuration rebuild.
Steps:
Back up business data (contacts, referrals, plans - not reference data)
Delete all reference data from target environment (or use fresh environment)
Run organizationsetup:
.\WhanauTahi.Xpm.Tooling.exe organizationsetup `
--MasterDataUrl "https://masterdata.crm6.dynamics.com" `
--EnvironmentUrl "https://cleanenv.crm6.dynamics.com" `
--ClientId "12345678-1234-1234-1234-123456789abc" `
--DataSet "All"
Verify configuration:
- Check team templates GUIDs match expected values
- Confirm assessment tools are inactive
- Review autonumber starting positions (should be 0)
Restore business data if needed
Scenario 4: Synchronised Multi-Environment Setup
Context: Need dev, test, and UAT environments with identical reference data.
Strategy: Use same master data environment for all targets
# Configure Dev
.\WhanauTahi.Xpm.Tooling.exe organizationsetup `
--MasterDataUrl "https://masterdata.crm6.dynamics.com" `
--EnvironmentUrl "https://dev.crm6.dynamics.com" `
--ClientId "12345678-1234-1234-1234-123456789abc" `
--DataSet "All"
# Configure Test
.\WhanauTahi.Xpm.Tooling.exe organizationsetup `
--MasterDataUrl "https://masterdata.crm6.dynamics.com" `
--EnvironmentUrl "https://test.crm6.dynamics.com" `
--ClientId "12345678-1234-1234-1234-123456789abc" `
--DataSet "All"
# Configure UAT
.\WhanauTahi.Xpm.Tooling.exe organizationsetup `
--MasterDataUrl "https://masterdata.crm6.dynamics.com" `
--EnvironmentUrl "https://uat.crm6.dynamics.com" `
--ClientId "12345678-1234-1234-1234-123456789abc" `
--DataSet "All"
Result: All three environments have identical reference data, reducing environment-specific issues during promotion.
Performance Considerations
Typical Execution Time
Complete All DataSet: 5-10 minutes
Breakdown by phase:
- Access & Identity: 10-30 seconds
- System Configuration: 30-60 seconds
- Reference Data: 2-3 minutes
- PRIMHD Configuration: 1-2 minutes
- Contract & Services: 1-2 minutes
- Outcomes Framework: 1-2 minutes
Factors affecting duration:
- Network latency between environments
- Volume of master data (contracts, services, outcomes)
- Target environment database performance
- Use of
UpdateExistingflag (slower than create-only)
Optimisation Tips
For faster execution:
- Run during off-peak hours (less database contention)
- Ensure good network connectivity between environments
- Use
AddToExistingData=falsewhen possible (skips early) - Consider targeted DataSet options if only partial config needed
For large master data sets:
- Monitor console output for progress
- Look for operations taking unusually long (may indicate issues)
- Break into smaller operations if command times out
Troubleshooting
Access Team Configuration Fails
Problem: "Could not enable AutoCreateAccessTeams on [entity]"
Cause: Permissions issue or entity doesn't support access teams
Solution:
- Verify ClientId has "System Administrator" role in target
- Check entity supports access teams (contact, mag_familygroup, mag_plan should)
- Review any customisation errors in environment
Team Template GUID Mismatch
Problem: Team template created with different GUID than expected
Cause: Code or configuration attempting to modify hard-coded GUIDs
Solution:
- DO NOT modify the hard-coded GUIDs in source code
- Delete incorrectly created team templates
- Re-run organizationsetup with unmodified code
- Verify GUIDs match expected values after completion
Assessment Tools Not Appearing
Problem: Assessment tools copied but not visible in environment
Cause: Assessment tools created in inactive state (by design)
Solution:
- Navigate to assessment tools in target environment
- Manually activate required assessment tools
- Activation triggers plugin step registration
- This is expected behavior - not a bug
Autonumber Conflicts
Problem: Autonumber sequences conflict with existing records
Cause: wtl_currentposition reset to 0, existing records have higher numbers
Solution:
- Manually set
wtl_currentpositionto max existing value + 1 - Or delete existing autonumber records before running organizationsetup
- Or allow system to auto-increment past existing records
Contract Service Eligibility Rules Duplicated
Problem: Multiple eligibility rules with same name created
Cause: Composite key allows same name with different contract services (intended behavior)
Solution:
- This is expected for rules applying to multiple services
- Review rule names and associated services
- If truly duplicate (same name + same service), investigate source data
Date Fields Set to Null
Problem: Contract/service dates showing as null after copy
Cause: Source dates were before January 1, 1850 (invalid data)
Solution:
- Check source data for invalid dates
- Correct invalid dates in master data environment
- Re-run organizationsetup with
UpdateExistingflag - Dates after 1850 will copy correctly
Relationship Creation Fails
Problem: "Could not resolve [entity] reference" during relationship creation
Cause: Parent entities don't exist in target
Solution:
- Ensure prerequisite operations completed successfully
- Check that domains exist before creating domain-area relationships
- Check that areas exist before creating area-category relationships
- Review console output for errors in earlier operations
- Run
AllDataSet to ensure correct operation order
Grouping Parent References Missing
Problem: Contract groups created but parent references not set
Cause: Second pass of grouping operation failed
Solution:
- Check console output for second pass errors
- Verify parent groups exist in target
- Confirm parent groups exist in master data
- Re-run with
UpdateExistingto retry parent reference updates
Tables Affected
The All DataSet affects the following 50+ tables:
Access & Identity
contact(metadata only - AutoCreateAccessTeams enabled)mag_familygroup(metadata only - AutoCreateAccessTeams enabled)mag_plan(metadata only - AutoCreateAccessTeams enabled)teamtemplate(3 records created)team(1 record created)
System Configuration
mag_sysconfigwtl_autonumber
Reference Data
mag_assessmenttypemag_agegroupmag_ethnicitymag_tribemag_subtribemag_gatheringplacemag_levelofeducationmag_consenttypemag_employmentstatusmag_autotextmag_activitygroupmag_exitreasonmapping
PRIMHD
mag_primhdsettingmag_primhdactivitymag_referralcodemag_primhdteam
Contracts & Services
mag_groupingmag_contracttypemag_fundingcontractmag_contractservicemag_contractservicetypemag_contractservicesitemag_eligibilityrule
Outcomes Framework
mag_domainmag_outcomedomainindicatormag_outcomeareamag_outcomecategorymag_mag_outcomearea_mag_domain(relationship table)mag_mag_outcomecategory_mag_outcomearea(relationship table)mag_predefinedoutcomemag_predefinedactivity
Total: 35+ tables plus 3 metadata-only entity modifications
Best Practices
Master Data Environment Management
Establish a master data environment:
- Create dedicated environment for reference data templates
- Document all reference data values
- Use change control process for updates
- Version control configuration changes
- Test changes before propagating to other environments
Master data content:
- Approved ethnicities, tribes, education levels
- Standard outcomes framework
- Template contracts and services (if using ServiceTransfer)
- Assessment tool configurations
- System configuration values
Update workflow:
- Make changes to master data environment
- Document changes (what, why, when)
- Test in dev environment first
- Propagate to test/UAT using organizationsetup
- Schedule production update during maintenance window
Pre-Flight Checklist
Before running All DataSet:
✅ Verify both environments accessible
✅ Confirm ClientId has System Administrator role in both environments
✅ Back up target environment (if using UpdateExisting)
✅ Document current state of target environment
✅ Verify master data environment contains approved values
✅ Review assessment tools to be copied (which should be activated?)
✅ Check for active users in target environment (coordinate timing)
✅ Plan for manual steps (activate assessment tools, verify GUIDs)
Post-Setup Verification
After running All DataSet:
Immediate checks:
✅ Review console output for errors or warnings
✅ Verify team template GUIDs match expected values
✅ Check access teams enabled on contact, family group, plan entities
✅ Confirm Intake Team created with correct GUID
Assessment tools:
✅ Navigate to assessment tools in target environment
✅ Identify which tools are required for this environment
✅ Manually activate required assessment tools
✅ Test assessment tool functionality
Autonumber sequences:
✅ Review autonumber configurations
✅ Verify starting positions (should be 0 for new environments)
✅ Test number generation on sample records
Reference data spot checks:
✅ Verify key ethnicities, tribes present
✅ Check age group ranges
✅ Review gathering places (if used)
✅ Confirm consent types available
Outcomes framework:
✅ Verify outcome domains present
✅ Check domain-area relationships exist
✅ Review predefined outcomes
✅ Test creating plan with predefined outcome
Contracts & services (if applicable):
✅ Verify funding contracts copied
✅ Check contract services present
✅ Review eligibility rules
✅ Test referral creation to contract service
Incremental Updates Strategy
For ongoing reference data maintenance:
Don't use
Allfor updates - Use targeted DataSet options:- Outcomes changes: Use
OutcomesFramework - Service changes: Use
ServiceTransfer - Specific table changes: Consider datamanipulation commands
- Outcomes changes: Use
Use UpdateExisting flag selectively:
- Only when intentionally updating existing records
- Test in dev first
- Document which records will change
Coordinate with users:
- Schedule updates during low-usage periods
- Communicate reference data changes
- Provide training if values change significantly
Environment-Specific Considerations
Development environments:
- Use
AddToExistingDatafreely for testing - Update frequently from master data
- May include test-specific reference values
Test/UAT environments:
- Keep synchronized with master data
- Update less frequently than dev
- Match production reference data closely
Production environments:
- Change control required for updates
- Schedule during maintenance windows
- Full backup before updates
- Use
UpdateExistingonly when necessary
Disaster Recovery
Include organizationsetup in DR plan:
Document master data environment:
- URL and access credentials
- Last update date
- Known customisations
Store organizationsetup command:
- Save complete command with parameters
- Document DataSet option used
- Note any special flags (AddToExistingData, UpdateExisting)
Test recovery process:
- Periodically restore to test environment
- Verify all reference data restored correctly
- Update DR documentation with lessons learned
Recovery sequence:
- Restore Dataverse environment from backup
- Run organizationsetup to restore reference data
- Activate assessment tools
- Verify critical GUIDs (team templates, Intake Team)
- Resume normal operations