2 Replies Latest reply on Oct 21, 2015 1:39 AM by ravi.ranjan

    Test 2 Live Failed because of 3rd party in Live Database

    ravi.ranjan Rookie

      Hi All LANDesk Experts,

      Need guidance. Here is all the scenario that happened with my Test 2 Live:

      1. We have got 4 new 3rd party created in Live database and four contacts also got created to link with these four new 3rd parties.

      2. These new 3rd parties are not there in DEV environment from where we will be doing Test 2 Live.

      3. I did design transfer for these 4 new 3rd party into our DEV environment and while import LANDesk asked me to provide the contact names which are linked with these 4 new 3rd parties.

      4. The contacts can't be exported or imported in DEV environment so, I manually created the contacts same as LIVE into our DEV environment and mapped them with 3rd parties in the same fashion in console.

      4. Started with Test 2 Live and it failed saying that contact already exists in the LIVE environment.

      5. I deleted the new contacts from LIVE environment but after that when I did Test 2 Live again then it failed with the same error.

      6. I need to delete these contacts from database (hard deletion) and used below query:

       

      BEGIN TRANSACTION

       

      declare @usertype uniqueidentifier

       

      set @usertype = (select tps_guid from tps_user_type where tps_name = 'Contact')

       

      update tps_password set tps_deleted=2

       

         where tps_guid in (select tps_password_id from tps_user where tps_user_type_guid = @userType and tps_name = 'Kevin Murray')

       

      update tps_user set tps_password_id = null where tps_user_type_guid = @userType and tps_name = 'Kevin Murray'

       

      delete from tps_password where tps_deleted=2

       

         IF @@ERROR <> 0

       

         BEGIN

       

         RAISERROR('Error on: delete tps_password', 16, 1)

       

         ROLLBACK

       

         END

       

      delete from tps_user_role where tps_user_id in (select tps_guid from tps_user where tps_user_type_guid = @usertype and tps_name = 'Kevin Murray')

       

      delete from tps_user_group where tps_user_id in (select tps_guid from tps_user where tps_user_type_guid = @usertype  and tps_name = 'Kevin Murray')

       

      delete from tps_user_message_recipient where tps_user_guid in (select tps_guid from tps_user where tps_user_type_guid = @userType and tps_name = 'Kevin Murray')

       

      delete from cf_user_config_item   where cf_user_guid in (select tps_guid from tps_user where tps_user_type_guid = @userType and tps_name = 'Kevin Murray')

       

      delete from tps_application_user_setting where tps_user_guid in (select tps_guid from tps_user where tps_user_type_guid = @userType and tps_name = 'Kevin Murray')

       

      delete from tps_application_mru where tps_user_guid in (select tps_guid from tps_user where tps_user_type_guid = @userType and tps_name = 'Kevin Murray')

       

      delete from tps_user_query where tps_user_guid in (select tps_guid from tps_user where tps_user_type_guid = @userType and tps_name = 'Kevin Murray')

       

      delete from tps_user_network_login where tps_user_guid in (select tps_guid from tps_user where tps_user_type_guid = @userType and tps_name = 'Kevin Murray')

       

      delete from tps_contact where tps_guid in (select tps_guid from tps_user where tps_user_type_guid = @userType and tps_name = 'Kevin Murray')

       

         IF @@ERROR <> 0

       

         BEGIN

       

         RAISERROR('Error on: delete tps_contact', 16, 1)

       

         ROLLBACK

       

         END

       

      delete from tps_user where tps_user_type_guid = @usertype and tps_name = 'Kevin Murray'

       

         IF @@ERROR <> 0

       

         BEGIN

       

         RAISERROR('Error on: delete tps_user', 16, 1)

       

         ROLLBACK

       

         END

       

      delete from tps_audit_trail where tps_class_type_id =

       

         (select md_guid from md_class_type where md_client_class = 'Touchpaper.ClientClasses.SystemManagement.Contact') and tps_creation_user in (select tps_guid from tps_user where tps_user_type_guid = @userType and tps_name = 'Kevin Murray')

       

      COMMIT TRANSACTION

       

         IF @@ERROR <> 0

       

         BEGIN

       

         Print '--See previous errors--'

       

         END

      But still I see errors there and it is not deleting the contacts.

      Please can someone suggest a way out to complete test 2 live.

      Also some 3 incidents are linked with these new 3rd parties and these incidents are in open state.

      I have attached Test 2 Live log file and SQL file got generated after failure.

      Also error message after running the above script.