CMS Application - Information - How to split schema with multiple applications to one schema for one application


Purpose

This page provides information about how to split the schema containing multiple applications into schemas with one application each.


Applicable in CAST Version

Release

Yes/No

8.3.x (tick) 


Applicable RDBMS


RDBMS

Yes/No

Oracle Server(tick)
Microsoft SQL Server(tick)
CSS2(tick)
CSS1(tick)
Details

When your schema triplet contains more than one application and you have to split the applications into individual schemas separately, follow the below steps:

(Backup the schema triplet with multiple applications)

We will elaborate on the following process to split a triplet containing N applications into N triplets containing a single application:

  1. Duplicate the schemas of the initial triplet under the name of the first remaining application and restore it using only CAST Storage Service Maintenance activities not directly through PGAdmin.
  2. Synchronize the new triplet so that its schemas do not share any references with the initial triplet (site IDs, schema references, ....) and you can synchronize the triplets using How to synchronize CAST databases triplet

                a.   SYS_SITE update

                    First, we will update the site_id of the new triplet,

                    for local and central you can do it through CMS,

                    and for mngt base you have to edit it manually in the back end using the below query on the mngt base.

     update sys_site set site_id=<new_site_id which is other than the one for initial triplet>, site_name='<mngt_name of restored base>'

                b. In the central database update the below tables:                      

                      In the below-highlighted queries, site_id will be updated after generating a new site_id through CMS.

                      Run a Select Query on those tables and update them accordingly using the I_newSiteId instead of L_oldSiteId                  

                           

   /* update central name  */
                                update DSS_SITES 

                                set site_NAME = 'newCBName', 

                                LOCAL_DSS_NAME = 'newCBName'

                                where SITE_ID = 0; 

                            


   /* update kb name and kb site_id */
                                update viewer_sites   

                                set ID = I_newSiteId,

                                 NAME = 'newKBName',

                                DESCRIPTION = 'newKBName'

                                where ID = L_oldSiteId; 



                                update DSS_SITES 

                                set SITE_ID = I_newSiteId,

                                 NAME = 'newKBName', 

                                LOCAL_DSS_NAME = 'newKBName'

                                where SITE_ID = L_oldSiteId; 



                                udpate DSS_TRANSLATION_TABLE 

                                set SITE_ID = I_newSiteId

                                where SITE_ID = L_oldSiteId; 



                                update DSS_CODE_BOOKMARKS

                                set LOCAL_SITE_ID = I_newSiteId

                                where LOCAL_SITE_ID = L_oldSiteId; 



                                update DSS_CODE_PATHS

                                set LOCAL_SITE_ID = I_newSiteId

                                where LOCAL_SITE_ID = L_oldSiteId; 



                                update DSS_SOURCE_POSITIONS

                                set LOCAL_SITE_ID = I_newSiteId

                                where LOCAL_SITE_ID = L_oldSiteId; 



                                update DSS_SOURCE_TEXTS

                                set LOCAL_SITE_ID = I_newSiteId

                                where LOCAL_SITE_ID = L_oldSiteId; 

                   c. Now stop managing the additional applications from the new triplet, so that it contains only one application and while removing the Applications make sure the option “Delete deployed source code” is unchecked.

                   d. Stop managing the first remaining application from the initial triplet.

2. Rename the initial triplet under the name of the last Application and then you should synchronize the triplets using How to synchronize CAST databases triplet (this step has to be done only once).

3. Repeat this process till you have only the Last Application in the Initial triplet.

4. Once you have only one Application per triplet at the end in your delivery folder, under the data folder, edit the index.xml file and update the <UUID>_mngtId">SITE_ID</entry> with appropriate site_id for all applications and make sure the site_id has to be unique for each of the triplets.

You can find the site_id for each of the application from their respective mngt base in the below table.

select * from <mngt_base>.sys_site


Notes/comments

AIPCORE-1023