AnsweredAssumed Answered

Export a single tenant and import into another environment

Question asked by J_W on Nov 8, 2018
Latest reply on Dec 6, 2018 by J_W

SDM 14.1.x, 17.1.x

 

Background:  We are in a MSP organization and are developing procedures to onboard new tenants.  The current situation requires separation of duties between DEV and PROD; so we have to hand off all procedures and files during development to the PROD team - who do not have access to DEV or QA.

 

We gather core information from the client to load into DEV; export the tenant and related tables using the pdm command tools; and load those into QA for validation.  All new tenants are 1 level down sub-tenants to the service provider and do not have sub-tenants themselves.

 

The process starts with manually creating the tenant using the web UI in order to have the system-maintained tenant groups created.  At this point, I have the IDs of the service provider tenant, the new tenant, and the related tenant groups and I can pdm_load tables for the new tenant's support groups, categories, etc..

 

Issue:  Exporting the data works for the tenant, tenant groups, service groups, etc., but does not for the ca_tenant_group_member table.  If I check the data in SQL, it is complete; but when I try to extract it using pdm_extract, the service provider rows are not returned.

 

Example:

   SQL:

 

SELECT
    *
FROM
    ca_tenant_group_member
WHERE
    tenant_group IN
    (SELECT id FROM ca_tenant_group WHERE name LIKE 'new_tenant%')

returns 5 rows - which matches that there are 2 entries each for the 'new_tenant'_relatedtenants and 'new_tenant'_supertenants and 1 for the 'new_tenant'_subtenant - as seen in the web interface.

SQL_tenant_group_members

  However, pdm_extract:

pdm_extract -f "SELECT * FROM ca_tenant_group_member WHERE tenant_group IN (SELECT id FROM ca_tenant_group WHERE name LIKE 'new_tenant%') "

returns:

 

D:\working folder>pdm_extract -f "SELECT * FROM ca_tenant_group_member WHERE tenant_group IN (SELECT id FROM ca_tenant_group WHERE name LIKE 'new_tenant%') "
TABLE ca_tenant_group
        creation_date creation_user description id inactive last_update_date last_update_user
        name readonly tenant version_number
        { "10/31/2018 12:56:52" ,"servicedesk" ,"",
        "0882564DF245924985EA08BB1241AF5A" ,"0" ,"10/31/2018 12:56:52",
        "servicedesk" ,"new_tenant_supertenants" ,"1",
        "432847A5A766134BB6B60F9CCA2F1118" ,"1" }
        { "10/31/2018 12:56:52" ,"servicedesk" ,"",
        "DD7893F2C6C10B4296648065956ADB63" ,"0" ,"10/31/2018 12:56:52",
        "servicedesk" ,"new_tenant_relatedtenants" ,"1",
        "432847A5A766134BB6B60F9CCA2F1118" ,"1" }
        { "10/31/2018 12:56:52" ,"servicedesk" ,"",
        "EAF7D24DA3E74848A56D29AFE678413C" ,"0" ,"10/31/2018 12:56:52",
        "servicedesk" ,"new_tenant_subtenants" ,"1",
        "432847A5A766134BB6B60F9CCA2F1118" ,"1" }
ca_tenant_group
        rows:3

which is missing the service provider tenant in the _relatedtenants and _supertenants

 

I see there has been an Idea posted for single tenant migration which is currently Not Planned:  Single Tenant Migration Procedure

 

I have never used the pdm_tenant_extract utility referenced at:  pdm_tenant_extract -- Extracting Tenant Data - but could not get it to work for even an initial phase in order to review the output (Not to mention that it says the initial export has to be imported into a system never used by CA SDM).

 

Please let me know If anyone seems something wrong with this approach or anything obvious I am missing.  All ideas are welcome.

 

TIA,

 

J.W.

Outcomes