CA Service Management

Expand all | Collapse all

Contacts replication from Prod to QA using SQL (NO PDM Command methods)

  • 1.  Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 30, 2018 02:22 PM

    Is it possible to replicate just the contact tables (ca_contact, usp_contact) from Prod to QA using SQL for CA Service Desk Manager 14.1.x release?

    I have tried exporting the data using Tasks > Generate Scripts > Select specific tables > Selecting both Data and Schema into a SQL script. Then dropped SQL constraints (reference link shown below) followed by truncate ca_contact table that fails to run due to the following error.

    Cannot truncate table 'mdb.dbo.ca_contact' because it is being referenced by a FOREIGN KEY constraint.

     

    https://docops.ca.com/ca-service-management/14-1/en/administering/configure-ca-service-desk-manager/managing-your-database/drop-and-restore-constraints



  • 2.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 30, 2018 02:45 PM

    No, this not a good idea.

     

    If you bring back the entire table your are also bringing the UUID wich may not "fit" with the other data in your MDB.

     

    The error message is generated by at least 35 billions differents tables that reference ca_contact

     

    Almost every object has a last_mod_by attribute.

     

     

    Simply configure your QA env to connect to LDAP.



  • 3.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 30, 2018 02:52 PM

    The reason for my ask is that we do a replication of entire MDB from Prod to QA then test run some custom SQL scripts to automate the contacts updates from other native source databases (HR appls), which is messing up the contacts table. In order to reduce the efforts of copying entire MDB each time, I'm looking for suggestions or ideas on how to just replicate contact tables from Prod to QA.



  • 4.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 30, 2018 03:22 PM

    And btw, contact update should be done using webservices, not sql queries.



  • 5.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 30, 2018 03:26 PM

    I guess every organization has their custom solution approach towards contacts updates and agreed, webservices is a better approach.



  • 6.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 30, 2018 03:21 PM

    Is there creation of contact or only a sync of existing contact?



  • 7.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 30, 2018 03:27 PM

    For both cases, new contacts creation and existing contact updates as well..



  • 8.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 30, 2018 03:35 PM

    You can create a linked server on your QA with an account that has readonly access to prod and type a query that insert line from PROD to QA if not present and a query that update rows that are present on both env.



  • 9.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 30, 2018 03:43 PM

    BnL, the custom automation solution works except for few edge cases which messes up the contact table, so trying to replicate the problem in QA to resolve these edge case issues and in the process, we need to restore just the contacts table back to previous good state.



  • 10.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)
    Best Answer

    Posted May 30, 2018 03:59 PM

    why not take a backup of the QA DB on a clean state?

     

    It is way faster to restore than copying Prod on QA.



  • 11.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 30, 2018 04:13 PM

    Yes, this is what I have been doing so far and need to wait on DBA's availability and other internal formalities to get the restore done, so thinking of much shorter and quickest way to just deal with couple of tables rather full restore of cleaned state of QA DB.



  • 12.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 30, 2018 04:19 PM

    If your custom script to sync contacts is modifiable, i would personnaly create a duplicate of ca_contact and usp_contact and test the script against those two tables.

     

    Select * into ca_contact2  from  ca_contact
    Select * into usp_contact2  from  usp_contact


  • 13.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 30, 2018 04:26 PM

    good idea will give it a try though custom script does include contacts sync and other bunch of contact linked reference tables. Thank you!



  • 14.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Posted May 31, 2018 04:45 AM

    Have a look at this Microsoft article and decide which replication method (between Transnational or Merge) would work best for your requirements to sync contacts from Prod to QA:

     

    Types of Replication | Microsoft Docs 

     

    ===

    Kind Regards,

    Brian



  • 15.  Re: Contacts replication from Prod to QA using SQL (NO PDM Command methods)

    Broadcom Employee
    Posted Jun 11, 2018 10:47 AM

    vchinni 

     

    Do you have any additional questions regarding this topic?

     

    If not, please mark one of the provided answers as Correct so that this thread can be closed.