Migrating SQL Server content side-by-side

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

About this task

Transfer data from your IBM Connections 4.5 or 5.0 databases, described here as the source databases, to the new 4.5 or 5.0 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 5.5.
Important: You can continue to use your 4.5 or 5.0 databases until you are ready to move to IBM Connections 5.5. Any data that you generate after the database update is not migrated to the new environment.
Note: Run the predbxferxx.sql and postdbxferxx.sql commands that are in the 5.5 GA build and not the 4.5 or 5.0 build. Depending on which database version you are migrating from, xx might be:
  • 4.5
  • 4.5CR4
  • 50

To update the databases, complete the following steps:

Procedure

  1. Create target databases on a separate system from your source databases. The new databases host your data for migration to the 5.5 deployment.

    The Connections 4.5 database wizard does not work with that version of Microsoft™ SQL 2012 EE. To create the 4.5 databases on Microsoft SQL 2012 EE, you must use the SQL scripts that are provided with IBM Connections 4.5 to create the databases manually. For more information, see the IBM Connections 4.5 IBM Knowledge Center topic: Creating SQL Server databases manually.

  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 topic: Updating SQL Server 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 5.5 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 sqljdbc4.jar database libraries, which are already on the target database server:
    Repeat the following procedures for each application that you are migrating:
    1. Log in as the database administrator.
    2. For each application, change to the directory that contains the relevant SQL file.
    3. Enter the commands that are shown in the following table:

      In these commands, password is the password for the SQL Server user sa.

      Note:

      If your database server has multiple SQL Server instances, add the following line as the first parameter to each command in the table: -S sqlserver_server_name\sqlserver_server_instance_name

      Note: Run the predbxferxx.sql commands that are in the 5.0 GA build and not the 4.5 build, wherexx might be:
      • 45
      • 45CR4
      • 50
      Table 1. SQL Server commands for removing constraints
      Application Directory SQL Server commands
      Activities /connections.sql/activities/sqlserver Run sqlcmd -U sa -P password -i "predbxfer50.sql" if you are at 5.0 or a 5.0 CR.

      Run sqlcmd -U sa -P password -i "predbxfer45.sql" if you are at 4.5 or a 4.5 CR.

      Blogs /connections.sql/blogs/sqlserver

      Run sqlcmd -U sa -P password -i "predbxfer50.sql" if you are at 5.0 or a 5.0 CR.

      Run sqlcmd -U sa -P password -i "predbxfer45.sql" if you are at 4.5 or a 4.5 CR.

      Bookmarks /connections.sql/dogear/sqlserver

      Run sqlcmd -U sa -P password -i "predbxfer50.sql" if you are at 5.0 or a 5.0 CR.

      Run sqlcmd -U sa -P password -i "predbxfer45.sql" if you are at 4.5 or a 4.5 CR.

      Communities /connections.sql/communities/sqlserver

      Run sqlcmd -U sa -P password -i "predbxfer50CR2.sql" if you are at 5.0 or a 5.0.

      Run qlcmd -U sa -P password -i "predbxfer45.sql" if you are at 4.5 or a 4.5 CR.

      Communities - calendar /connections.sql/communities/sqlserver

      Run sqlcmd -U sa -P password -i "calendar-predbxfer50.sql" if you are at 5.0 or a 5.0 CR.

      Run sqlcmd -U sa -P password -i "calendar-predbxfer45.sql" if you are on 4.5 or a 4.5 CR.

      Files /connections.sql/files/sqlserver

      Run sqlcmd -U sa -P password -i "predbxfer50.sql" if you are at 5.0 or a 5.0 CR.

      Run sqlcmd -U sa -P password -i "predbxfer45CR3.sql" if you are on 4.5 or a 4.5 CR.

      Forum /connections.sql/forum/sqlserver

      Run sqlcmd -U sa -P password -i "predbxfer50CR1.sql if you are at 5.0 or a 5.0 CR.

      run sqlcmd -U sa -P password -i "predbxfer45.sql if you are on 4.5 or a 4.5 CR.

      Home page /connections.sql/homepage/sqlserver

      Run sqlcmd -U sa -P password -i "predbxfer50CR4.sql" if you are at 5.0 or a 5.0 CR.

      Run sqlcmd -U sa -P password -i "predbxfer45CR4.sql" if you are at 4.5 or a 4.5 CR.

      Metrics /connections.sql/metrics/sqlserver

      Run sqlcmd -U sa -P password -i "predbxfer50.sql if you are at 5.0 or a 5.0 CR.

      Run sqlcmd -U sa -P password -i "predbxfer45CR2.sql if you are on 4.5 or a 4.5 CR.

      Mobile /connections.sql/mobile/sqlserver

      Run sqlcmd -U sa -P password -i "predbxfer50.sql if you are at 5.0 or a 5.0 CR

      Run sqlcmd -U sa -P password -i "predbxfer45CR4.sql if you are on 4.5 or a 4.5 CR.

      Profiles /connections.sql/profiles/sqlserver

      Run sqlcmd -U sa -P password -i "predbxfer50.sql if you are at 5.0 or a 5.0 CR.

      Run sqlcmd -U sa -P password -i "predbxfer45.sql if you are on 4.5 or a 4.5 CR.

      Wikis /connections.sql/wikis/sqlserver

      Run sqlcmd -U sa -P password -i "predbxfer50.sql if you are at 5.0 or a 5.0 CR.

      Run sqlcmd -U sa -P password -i "predbxfer45CR3.sql if you are on 4.5 or a 4.5 CR.

  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.
    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>
      

      Where

      JDBC_driver is following type:
      • com.microsoft.sqlserver.jdbc.SQLServerDriver
      JDBC_url is the following type:
      • jdbc:sqlserver://host_IP:port;databaseName=application_database_name
      Note: Where
      • host_IP is the IP address of the database server.
      • port is the port number of the server.
      • application_database_name is one of the following values:
        • Activities: OPNACT
        • Blogs: BLOGS
        • Communities: SNCOMM
        • Dogear: DOGEAR
        • Files: FILES
        • Forum: FORUM
        • Home page: HOMEPAGE
        • Metrics: METRICS
        • Mobile: MOBILE
        • Profiles: PEOPLEDB
        • Wikis: WIKIS

      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, run the dbt command twice; the first time for the SNCOMM schema, and the second time for the CALENDAR schema.
      • Dogear: 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
      dbType is the following value:
      • SQL Server: sqlserver2005
        Note: The JDBC driver, however, is SQL Server 2008 as indicated in the next step.

      The entry <table sourceName="TABLE_TO_SKIP" exclude="true"/> instructs dbtransfer to skip a table. This instruction is of limited use as most table content is expected to transfer.

    4. Prepare the JDBC driver of the target databases:
      • Download the SQL Server 2008 JDBC 2.0 driver from the Microsoft website and follow the instructions to extract the driver files.
    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:

        SQLSERVER_DRIVER_PATH/sqljdbc4.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
        • SQLSERVER_DRIVER_PATH is the path to the sqljdbc4.jar JDBC driver.
        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:SQLSERVER_DRIVER_PATH/sqljdbc4.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;

        SQLSERVER_DRIVER_PATH\sqljdbc4.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;SQLSERVER_DRIVER_PATH\sqljdbc4.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 4.5 or 5.0 deployment to minimize service downtime.

      Note: Data that is generated after you restart the 4.5 or 5.0 environment is not migrated.
  5. Reapply constraints to the target databases:
    1. Log in as the database administrator.
    2. For each application, change to the directory that contains the relevant SQL file.
    3. Enter the commands that are shown in the following table:
    In these commands, password is the password for the SQL Server user sa.
    Note: If your database server has multiple SQL Server instances, add the following line as the first parameter to each command in the table:
    -S sqlserver_server_name\sqlserver_server_instance_name
    
    Note: Run the postdbxferxx.sql commands that are in the 5.5 GA build and not the 4.5 or 5.0 build, wherexx might be:
    • 45
    • 45CR4
    • 50
    Table 2. SQL Server commands for reapplying constraints
    Application Directory SQL Server commands
    Activities /connections.sql/activities/sqlserver Run sqlcmd -U sa -P password -i "postdbxfer50.sql" if you are at 5.0 or a 5.0 CR.

    Run sqlcmd -U sa -P password -i "postdbxfer45.sql" if you are at 4.5 or a 4.5 CR.

    sqlcmd -U sa -P password -i "clearScheduler.sql"

    Blogs /connections.sql/blogs/sqlserver

    Run sqlcmd -U sa -P password -i "postdbxfer50.sql" if you are at 5.0 or a 5.0 CR.

    Run sqlcmd -U sa -P password -i "postdbxfer45.sql" if you are at 4.5 or a 4.5 CR.

    Bookmarks /connections.sql/dogear/sqlserver

    Run sqlcmd -U sa -P password -i "postdbxfer50.sql" if you are at 5.0 or a 5.0 CR.

    Run sqlcmd -U sa -P password -i "postdbxfer45.sql" if you are at 4.5 or a 4.5 CR.

    Communities /connections.sql/communities/sqlserver

    Run sqlcmd -U sa -P password -i "postdbxfer50CR2.sql" if you are at 5.0 or a 5.0.

    Run qlcmd -U sa -P password -i "postdbxfer45.sql" if you are at 4.5 or a 4.5 CR.

    sqlcmd -U sa -P password -i "clearScheduler.sql"

    Communities- calendar /connections.sql/communities/sqlserver

    Run sqlcmd -U sa -P password -i "calendar-postdbxfer50.sql" if you are at 5.0 or a 5.0 CR.

    Run sqlcmd -U sa -P password -i "calendar-postdbxfer45.sql" if you are on 4.5 or a 4.5 CR.

    sqlcmd -U sa -P password -i "clearScheduler.sql"

    Files /connections.sql/files/sqlserver

    Run sqlcmd -U sa -P password -i "postdbxfer50.sql" if you are at 5.0 or a 5.0 CR.

    Run sqlcmd -U sa -P password -i "postdbxfer45CR3.sql" if you are on 4.5 or a 4.5 CR.

    sqlcmd -U sa -P password -i "clearScheduler.sql"

    Forum /connections.sql/forum/sqlserver

    Run sqlcmd -U sa -P password -i "postdbxfer50CR1.sql if you are at 5.0 or a 5.0 CR.

    run sqlcmd -U sa -P password -i "postdbxfer45.sql if you are on 4.5 or a 4.5 CR.

    sqlcmd -U sa -P password -i "clearScheduler.sql"

    Home page /connections.sql/homepage/sqlserver

    Run sqlcmd -U sa -P password -i "postdbxfer50CR4.sql" if you are at 5.0 or a 5.0 CR.

    Run sqlcmd -U sa -P password -i "postdbxfer45CR4.sql" if you are at 4.5 or a 4.5 CR.

    sqlcmd -U sa -P password -i "clearScheduler.sql"

    Metrics /connections.sql/metrics/SQL Server

    Run sqlcmd -U sa -P password -i "postdbxfer50.sql if you are at 5.0 or a 5.0 CR.

    Run sqlcmd -U sa -P password -i "postdbxfer45CR2.sql if you are on 4.5 or a 4.5 CR.

    sqlcmd -U sa -P password -i "clearScheduler.sql"

    Mobile Wizards/connections.sql/mobile/sqlserver

    Run sqlcmd -U sa -P password -i "postdbxfer50.sql if you are at 5.0 or a 5.0 CR

    Run sqlcmd -U sa -P password -i "postdbxfer45CR4.sql if you are on 4.5 or a 4.5 CR.

    Profiles /connections.sql/profiles/sqlserver

    Run sqlcmd -U sa -P password -i "postdbxfer50.sql if you are at 5.0 or a 5.0 CR.

    Run sqlcmd -U sa -P password -i "postdbxfer45.sql if you are on 4.5 or a 4.5 CR.

    sqlcmd -U sa -P password -i "clearScheduler.sql"

    Wikis /connections.sql/wikis/sqlserver

    Run sqlcmd -U sa -P password -i "postdbxfer50.sql if you are at 5.0 or a 5.0 CR.

    Run sqlcmd -U sa -P password -i "postdbxfer45CR3.sql if you are on 4.5 or a 4.5 CR.

    sqlcmd -U sa -P password -i "clearScheduler.sql"

  6. (Metrics only.) Run the following commands to update the database sequence for SQL Server target databases:
    • Run the following command on the source database:

      exec METRICS.GETNEWSEQVAL_ID_VALUES;

      Run the following commands on the target database:

      DROP TABLE [METRICS].[ID_VALUES];

      CREATE TABLE [METRICS].[ID_VALUES]

      (

      [SEQID] [BIGINT] IDENTITY(query_result,1) NOT NULL,

      [SEQVAL] [VARCHAR](1) NULL,

      );

      ALTER TABLE [METRICS].[ID_VALUES] ADD CONSTRAINT [ID_VALUES_PK] PRIMARY KEY ([SEQID]);

      GRANT DELETE,INSERT,SELECT,UPDATE ON "METRICS"."ID_VALUES" TO METRICSUSER;

      Where query_result is the result of the corresponding EXEC command that you ran on the 4.5 or 5.0 database.

  7. 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 Updating 4.5 and 5.0 databases to 5.5 and Updating 4.5 and 5.0 databases with the wizard.

Results

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