Migrating Oracle content side-by-side

Transfer Oracle data from your IBM® Connections 5.0 or 5.5 databases to the new 5.0 or 5.5 databases as part of migrating to version 6.0.

About this task

Transfer data from your 5.0 or 5.5 databases, described here as the source databases, to the new 5.0 or 5.5 databases, described here as the target databases. When the data transfer is complete and you validate the new databases, you can update them to version 6.0.
Important: You can continue to use your 5.0 or 5.5 databases until you are ready to move to IBM® Connections 6.0. Any data that you generate after the database update is not migrated to the new environment.
Note: Run the predbxferxx.sql and postdbxferxx.sql that are in the 6.0 GA build and not the 5.0 or 5.5 build. Depending on which database version you are migrating from, xx might be:
  • 50
  • 50CRx
  • 55
  • 55CRx

To update the databases, complete the following steps:

Procedure

  1. Using the IBM® Connections 5.0 or 5.5 database wizard, create target databases on a separate system from your source databases. The new databases host your data for migration to the 6.0 deployment.

    The procedure is described in the IBM® Connections 5.0 Knowledge Center topic: Creating Oracle databases

    Or the IBM® Connections 5.5 Knowledge Center: Creating Oracle databases

    Note: If the 5.0 or 5.5 database wizard is not on the system that hosts the target databases, copy it from the system that hosts IBM® Connections 5.0 or 5.5.
    Note: Take the following steps if you are migrating from 5.0 or 5.0 CR only. 5.5 already has the necessary unlimited grants. If you do not modify the createDb.sql script before running createDb.sql, it might not complete successfully and you cannot move data into the empty target databases.
    1. (Files only) Update the existing 5.0 or 5.5 createdb.sql to insert GRANT UNLIMITED TABLESPACE TO FILES:
      1. Start in the folder you unzipped the 5.0 or 5.5 database wizard package to, navigate to createDb.sql under connections.sql as follows:

        Windows:

        \Wizards\connections.sql\files\oracle\

        Linux/Unix:

        /Wizards/connections.sql/files/oracle/
      2. Manually edit the Files createDb.sql.
      3. Near the beginning of the file, locate the GRANT section and add the "GRANT UNLIMITED TABLESPACE" line:
        
        GRANT CONNECT, RESOURCE TO FILES;   
        GRANT UNLIMITED TABLESPACE TO FILES;    
        GRANT ALTER TABLESPACE TO FILES; 
      4. Run createDb.sql as follows:

        Windows:

        .\Wizards\connections.sql\files\oracle\createDb.sql

        Linux/Unix:

        ./Wizards/connections.sql/files/oracle/createDb.sql
    2. (Wikis only) Update the existing 5.0 or 5.5 createdb.sql to insert GRANT UNLIMITED TABLESPACE TO WIKIS:
      1. Start in the folder you unzipped the 5.0 or 5.5 database wizard package to, navigate to createDb.sql under connections.sql as follows:

        Windows:

        \Wizards\connections.sql\wikis\oracle\ 

        Linux/Unix:

        /Wizards/connections.sql/wikis/oracle/
      2. Manually edit the Wikis createDb.sql.
      3. Near the beginning of the file, locate the GRANT section and add the "GRANT UNLIMITED TABLESPACE" line:
        GRANT CONNECT, RESOURCE TO WIKIS;   
        GRANT UNLIMITED TABLESPACE TO WIKIS;    
        GRANT ALTER TABLESPACE TO WIKIS; 
      4. Run createDb.sql as follows:

        Windows:

        .\Wizards\connections.sql\wikis\oracle\createDb.sql

        Linux/Unix:

        ./Wizards/connections.sql/wikis/oracle/createDb.sql
    3. (Metrics only) Update the existing 5.0 or 5.5 createdb.sql to insert GRANT UNLIMITED TABLESPACE TO METRICS:
      1. Start in the folder you unzipped the 5.0 or 5.5 database wizard package to, navigate to createDb.sql under connections.sql as follows:

        Windows:

        \Wizards\connections.sql\metrics\oracle\ 

        Linux/Unix:

        /Wizards/connections.sql/metrics/oracle/
      2. Manually edit the Metrics createDb.sql.
      3. Near the beginning of the file, locate the GRANT section and add the "GRANT UNLIMITED TABLESPACE" line:
        
        GRANT CONNECT, RESOURCE TO METRICS;   
        GRANT UNLIMITED TABLESPACE TO METRICS;    
        GRANT ALTER TABLESPACE TO METRICS; 
      4. Run createDb.sql as follows:

        Windows:

        .\Wizards\connections.sql\metrics\oracle\createDb.sql

        Linux/Unix:

        ./Wizards/connections.sql/metrics/oracle/createDb.sql
  2. Bring the target Databases up to the latest Cumulative Refresh (CR) level for the code stream as described in the IBM® Connections 5.0 Knowledge Center: Creating Oracle databases

    Or the IBM® Connections 5.5 Knowledge Center: Updating 4.5 and 5.0 Oracle databases manually

  3. Prepare the target databases to accept data from the source databases. Remove constraints from the target databases by running the following SQL scripts from the IBM® Connections 6.0 package:
    Notes:
    • Run these SQL scripts before you transfer data to the target database.
    • Run each script from the same directory that you use to create the target database.
    • IBM® Connections uses the ojdbc6.jar database libraries, which are already on the target database server:
    Repeat the following procedures for each application that you are migrating:
    1. For each application, change to the directory that contains the relevant SQL file.
    2. Enter the following commands:
      1. sqlplus /NOLOG
      2. conn system/password@SID
      3. @SQL_script.sql
      Where
      • password is the password for the user system.
      • SID is the Oracle System Identifier for IBM® Connections.
      • SQL_script refers to a SQL script from the following table.
    3. Note: Run the predbxferxx.sql commands that are in the 6.0 GA build and not the 5.0 or 5.5 build, wherexx might be:
      • 50
      • 50CRx
      • 55
      • 55CRx
    Table 1. Oracle commands for removing constraints
    Application and directory Oracle commands
    Activities: /connections.sql/activities/oracle If you are at:
    • 5.0 or a 5.0 CR run @predbxfer50.sql
    • 5.5 or a 5.5 CR run @predbxfer55.sql
    Blogs: /connections.sql/blogs/oracle If you are at:
    • 5.0 or a 5.0 CR run @predbxfer50.sql
    • 5.5 or a 5.5 CR run @predbxfer55.sql
    Bookmarks: /connections.sql/dogear/oracle If you are at:
    • 5.0 or a 5.0 CR run @predbxfer50.sql
    • 5.5 or a 5.5 CR run @predbxfer55.sql
    Communities: /connections.sql/communities/oracle If you are at:
    • 5.0 or 5.0 CR1 run @predbxfer50.sql
    • 5.0 CR2 or above run @predbxfer50CR2.sql
    • 5.5 or a 5.5 CR run @predbxfer55.sql
    Communities - calendar: /connections.sql/communities/oracle If you are at:
    • 5.0 or a 5.0 CR run @calendar-predbxfer50.sql
    • 5.5 or a 5.5 CR run @calendar-predbxfer55.sql
    Files: /connections.sql/files/oracle If you are at:
    • 5.5 or 5.5 CR1 run @predbxfer55.sql
    • 5.5 CR2 or above run @predbxfer55CR2.sql
    Forums: /connections.sql/forum/oracle If you are at:
    • 5.0 run @predbxfer50.sql
    • 5.0 CR1 or above run @predbxfer50CR1.sql
    • 5.5 or a 5.5 CR run @predbxfer55.sql
    Home page: /connections.sql/homepage/oracle If you are at:
    • 5.0 run @predbxfer50.sql
    • 5.0 CR1 run @predbxfer50CR1.sql
    • 5.0 CR2 run @predbxfer50CR2.sql
    • 5.0 CR3 run @predbxfer50CR3.sql
    • 5.0 CR4 run @predbxfer50CR4.sql
    • 5.5 run @predbxfer55.sql
    • 5.5 CR1 run @predbxfer55CR1.sql
    • 5.5 CR2 run @predbxfer55CR2.sql
    Metrics: /connections.sql/metrics/oracle If you are at:
    • 5.0 or a 5.0 CR run @predbxfer50.sql
    • 5.5 or a 5.5 CR run @predbxfer55.sql
    Mobile: /connections.sql/mobile/oracle If you are at:
    • 5.0 or a 5.0 CR run @predbxfer50.sql
    • 5.5 or a 5.5 CR run @predbxfer55.sql
    Profiles: /connections.sql/profiles/oracle If you are at:
    • 5.0 or a 5.0 CR run @predbxfer50.sql
    • 5.5 or a 5.5 CR run @predbxfer55.sql
    Wikis: /connections.sql/wikis/oracle If you are at:
    • 5.5 or 5.5 CR1 run @predbxfer55.sql
    • 5.5 CR2 or above run @predbxfer55CR2.sql
    Push notification: /connections.sql/pushnotification/oracle

    If you are at 5.5 or a 5.5 CR, run @predbxfer55.sql

  4. Using the IBM® Connections database transfer tool, transfer data to the target databases:
    1. Create the directory DBT_HOME on the target database server. This directory temporarily stores transferred data.
    2. Be sure to use the new version of the dbt.jar file and copy it from the connections_root\ConfigEngine\lib directory to the DBT_HOME directory on the target database server.
      Note: You must ensure the server is installed so that the dbt.jar file is in place before migrating the database.
    3. Create an XML configuration file for each component database to be transferred under the DBT_HOME directory and add the following content:
      <dbTransfer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <database role="source" 
      driver="JDBC_driver" 
      url="JDBC_url" 
      userId="database_admin
      schema="application_db_schema_name"
      dbType="dbType"/>
      <database role="target"
      driver="JDBC_driver"
      url="JDBC_url"
      userId="database_admin" 
      schema="application_db_schema_name" 
      dbType="dbType"/>
      <table sourceName="TABLE_TO_SKIP" exclude="true"/> <!-- optional argument used to have dbtransfer skip a table -->
      </dbTransfer>
      
      Note: Any <table sourceName="TABLE_TO_SKIP" exclude="true entries go directly before </dbTransfer>.

      Where

      JDBC_driver is the following type:
      • oracle.jdbc.driver.OracleDriver
      JDBC_url is the following types
      • jdbc:oracle:thin:@host_IP:port:SID
      Note: Where
      • host_IP is the IP address of the database server.
      • port is the port number of the server.
      • SID is the Oracle System Identifier for IBM® Connections

      database_admin is the user ID of the database administrator.

      application_db_schema_name is one of the following values:
      • Activities: ACTIVITIES
      • Blogs: BLOGS
      • Communities: SNCOMM and CALENDAR
        Note: To migrate Communities data, the dbt command needs to be run twice; the first time for the SNCOMM schema, and the second time for the CALENDAR schema.
      • Bookmarks: DOGEAR
      • Files: FILES
      • Forum: FORUM
      • Home page: HOMEPAGE
      • Metrics: METRICS
      • Mobile: MOBILE
      • Profiles: EMPINST
        Note: If you use the TDI-related table EMP_UPDATE_TIMESTAMP, it does not need to be transferred. Add the instruction: <table sourceName="EMP_UPDATE_TIMESTAMP" exclude="true"/>.
      • Wikis: WIKIS
      • Push notification: PNS
        Note: For Connections 5 the push notification database name is FILES, for Connections 6 the push notification database name is PNS.
      dbType is the following value:
      • oracle
      The optional entry <table sourceName="TABLE_TO_SKIP" exclude="true"/> instructs dbtransfer to skip a named table.
      Note: take the following into consideration when using "TABLE_TO_SKIP"
      • Skip those tables that transferred fully.
      • If you get an error when transferring a table, then clear the table's contents on the target, do not skip it and run dbTransfer again.
      • If you need to re-run dbTransfer, the tables might execute in a different order.
    4. Prepare the JDBC driver of the target databases:
      • Use the JDBC driver on the target database server.
      • Ensure that the Oracle driver on your system has the same version number as your Oracle database server. IBM® Connections does not support the Oracle 10.2.0.1 JDBC driver.
    5. To transfer the data, run the dbt.jar file. Do not add spaces in a series of file names:
      • Linux:

        JAVA_HOME/bin/java

        -cp DBT_HOME/dbt.jar:

        ORACLE_HOME/jdbc/lib/ojdbc6.jar

        com.ibm.wps.config.db.transfer.CmdLineTransfer

        -logDir DBT_HOME/logs

        -xmlfile DBT_HOME/dbt_config_file_name

        -sourcepassword source_db_password

        -targetpassword target_db_password

        Where
        • JAVA_HOME is the path to the Java JDK.
        • dbt_config_file_name is the name of the XML configuration file you created for the dbt.jar file
        • logs is the directory where log files are stored. Create the logs directory before you run this file
        • ORACLE_HOME is the path to the Oracle installation directory.
        Run the command on a single line; do not add extra spaces. For example, multiple file names are entered as filename.jar:filename.jar without a space between the file names. The command looks similar to the following when run as a single command (edited to your specific configuration):
        JAVA_HOME/bin/java -cp DBT_HOME/dbt.jar:ORACLE_HOME/jdbc/lib/ojdbc6.jar com.ibm.wps.config.db.transfer.CmdLineTransfer -logDir DBT_HOME/logs -xmlfile DBT_HOME/dbt_config_file_name -sourcepassword password -targetpassword password
      • Windows:

        JAVA_HOME\bin\java

        -cp DBT_HOME\dbt.jar;

        ORACLE_HOME\jdbc\lib\ojdbc6.jar

        com.ibm.wps.config.db.transfer.CmdLineTransfer

        -logDir DBT_HOME\logs

        -xmlfile DBT_HOME\dbt_config_file_name

        -sourcepassword source_db_password

        -targetpassword target_db_password

      Run the command on a single line; do not add extra spaces. For example, multiple file names are entered as filename.jar;filename.jar without a space between the file names. The command looks similar to the following when run as a single command (edited to your specific configuration):
      JAVA_HOME\bin\java -cp c:\DBT_HOME\dbt.jar;ORACLE_HOME\jdbc\lib\ojdbc6.jar com.ibm.wps.config.db.transfer.CmdLineTransfer -logDir c:\DBT_HOME\logs -xmlfile c:\DBT_HOME\dbt_config_file_name -sourcepassword password -targetpassword password

      When the transfer is complete, you can restart your 5.0 or 5.5 deployment to minimize service downtime.

      Note: Data that is generated after you restart the 5.0 or 5.5 environment is not migrated.
  5. Reapply constraints to the target databases:
    1. For each application, change to the directory that contains the relevant SQL file.
    2. Enter the following commands:
      1. sqlplus /NOLOG
      2. conn system/password@SID
      3. @SQL_script.sql

        Where

        • password is the password for the user system.
        • SID is the Oracle System Identifier for IBM® Connections.
        • SQL_script refers to a SQL script from the following table:
    3. Note: Run the postdbxferxx.sql commands that are in the 6.0 GA build and not the 5.0 or 5.5 build, wherexx might be:
      • 50
      • 50CRx
      • 55
      • 55CRx
    Table 2. Oracle commands for reapplying constraints
    Application and directory Oracle commands
    Activities: /connections.sql/activities/oracle If you are at:
    • 5.0 or a 5.0 CR run @postdbxfer50.sql
    • 5.5 or a 5.5 CR run @postdbxfer55.sql
    • Run @clearScheduler.sql
    Blogs: /connections.sql/blogs/oracle If you are at:
    • 5.0 or a 5.0 CR run @postdbxfer50.sql
    • 5.5 or a 5.5 CR run @postdbxfer55.sql
    Bookmarks: /connections.sql/dogear/oracle If you are at:
    • 5.0 or a 5.0 CR run @postdbxfer50.sql
    • 5.5 or a 5.5 CR run @postdbxfer55.sql
    Communities: /connections.sql/communities/oracle If you are at:
    • 5.0 or 5.0 CR1 run @postdbxfer50.sql
    • 5.0 CR2 or above run @postdbxfer50CR2.sql
    • 5.5 or a 5.5 CR run @postdbxfer55.sql
    • Run @clearScheduler.sql
    Communities - calendar: /connections.sql/communities/oracle If you are at:
    • 5.0 or a 5.0 CR run @calendar-postdbxfer50.sql
    • 5.5 or a 5.5 CR run @calendar-postdbxfer55.sql
    Files: /connections.sql/files/oracle If you are at:
    • 5.5 or 5.5 CR1 run @postdbxfer55.sql
    • 5.5 CR2 or above run @postdbxfer55CR2.sql
    • Run @clearScheduler.sql
    Forums: /connections.sql/forum/oracle If you are at:
    • 5.0 run @postdbxfer50.sql
    • 5.0 CR1 or above run @postdbxfer50CR1.sql
    • 5.5 or a 5.5 CR run @postdbxfer55.sql
    • Run @clearScheduler.sql
    Home page: /connections.sql/homepage/oracle If you are at:
    • 5.0 run @postdbxfer50.sql
    • 5.0 CR1 run @postdbxfer50CR1.sql
    • 5.0 CR2 run @postdbxfer50CR2.sql
    • 5.0 CR3 run @postdbxfer50CR3.sql
    • 5.0 CR4 run @postdbxfer50CR4.sql
    • 5.5 run @postdbxfer55.sql
    • 5.5 CR1 run @postdbxfer55CR1.sql
    • 5.5 CR2 run @postdbxfer55CR2.sql
    • Run @clearScheduler.sql
    Metrics: /connections.sql/metrics/oracleS If you are at:
    • 5.0 or a 5.0 CR run @postdbxfer50.sql
    • 5.5 or a 5.5 CR run @postdbxfer55.sql
    • Run @clearScheduler.sql
    Mobile: /connections.sql/mobile/oracle If you are at:
    • 5.0 or a 5.0 CR run @postdbxfer50.sql
    • 5.5 or a 5.5 CR run @postdbxfer55.sql
    Profiles: /connections.sql/profiles/oracle If you are at:
    • 5.0 or a 5.0 CR run @postdbxfer50.sql
    • 5.5 or a 5.5 CR run @postdbxfer55.sql
    • Run @clearScheduler.sql
    Wikis: /connections.sql/wikis/oracle If you are at:
    • 5.5 or 5.5 CR1 run @postdbxfer55.sql
    • 5.5 CR2 or above run @postdbxfer55CR2.sql
    • Run @clearScheduler.sql
    Push Notification: /connections.sql/pushnotification/oracle
    • If you are at 5.5 or a 5.5 CR, run @postdbxfer55.sql
    • Run @clearScheduler.sql
  6. (Profiles only) Run the following commands to update the database sequence for the Oracle target databases:
    • Run the following commands on the source database:

      SELECT EMPINST.EXT_DRAFT_SEQ.NEXTVAL AS EXT_DRAFT_SEQ FROM DUAL;

      SELECT EMPINST.EMP_DRAFT_SEQ.NEXTVAL AS EMP_DRAFT_SEQ FROM DUAL;

      SELECT EMPINST.CHG_EMP_DRAFT_SEQ1.NEXTVAL AS CHG_EMP_DRAFT_SEQ1 FROM DUAL;

      SELECT EMPINST.CHG_EMP_DRAFT_SEQ2.NEXTVAL AS CHG_EMP_DRAFT_SEQ2 FROM DUAL;

      Run the following commands on the target database:

      DROP SEQUENCE EMPINST.EXT_DRAFT_SEQ;

      CREATE SEQUENCE EMPINST.EXT_DRAFT_SEQ START WITH query_result;

      DROP SEQUENCE EMPINST.EMP_DRAFT_SEQ;

      CREATE SEQUENCE EMPINST.EMP_DRAFT_SEQ START WITH query_result;

      DROP SEQUENCE EMPINST.CHG_EMP_DRAFT_SEQ1;

      CREATE SEQUENCE EMPINST.CHG_EMP_DRAFT_SEQ1 START WITH query_result;

      DROP SEQUENCE EMPINST.CHG_EMP_DRAFT_SEQ2;

      CREATE SEQUENCE EMPINST.CHG_EMP_DRAFT_SEQ2 START WITH query_result;

      Where query_result is the result of the corresponding SELECT command that you ran on the source database.

  7. (Metrics only) Run the following commands to update the database sequence for DB2®, Oracle, or SQL Server target databases:
    • Run the following command on the source database:

      SELECT METRICS.ID_VALUES.NEXTVAL AS ID_VALUES_SEQ FROM DUAL;

      Run the following commands on the target database:

      DROP SEQUENCE METRICS.ID_VALUES;

      CREATE SEQUENCE "METRICS"."ID_VALUES" START WITH query_result INCREMENT BY 1 NOMAXVALUE NOCYCLE CACHE 20;

      GRANT SELECT, ALTER ON "METRICS"."ID_VALUES" TO METRICSUSER_ROLE;

      Where query_result is the result of the corresponding SELECT command that you ran on the source database.

  8. Manually, or using the DB Wizard, update the new databases to bring them to the IBM® Connections version 5.5 level. For more information, see Migrating 5.0 and 5.5 databases to 6.0 and Updating 5.0 and 5.5 databases with the wizard.

Results

Check that all the databases are working correctly. If you find errors, resolve the problem and repeat this task.