Migrating data from SQL Server to Db2

You can migrate data from SQL Server to Db2® and configure Publishing Document Builder to use the new database.

Procedure

  1. Create a database in Db2 by running the following command in Db2 command window:
    db2 CREATE DATABASE DESTDB2 AUTOMATIC STORAGE Yes USING CODESET UTF-8 TERRITORY US COLLATE USING SYSTEM PAGESIZE 16384
  2. Configure the server.xml file to point to your Db2 database.
  3. Start the Publishing Document Builder server to create the schemas or tables for Publishing Document Builder.
  4. Stop the Publishing Document Builder server.
  5. Connect to the Db2 database by running the following command in the Db2 command window:
    db2 connect to DESTDB2
  6. Run the following command to grant the SECADM right to one or more relevant users:
    db2 GRANT DBADM ON DATABASE TO USER db2admin
    .
  7. Use a data migration utility, such as ESF Database Migration Toolkit, to migrate data from the SQL Server database to the Db2 database. The following steps show how to download and use the ESF Database Migration Toolkit for the data migration process:
    1. Download ESF Database Migration Toolkit from https://www.dbsofts.com and run it.
    2. Click Settings. On General tab, update the following fields and click Save.
      • Set the If Table Exists: field to Append Data.
      • Clear the Copy Structure Only checkbox.
      • Clear the Transfer Auto-Increment checkbox.
      • Clear the Copy Indexes checkbox.
      • Clear the Copy Foreign Keys checkbox.
      • Clear the Make Relation Name Unique checkbox.
      • Clear the Merge Schemas checkbox.
    3. Select Microsoft SQL Server as the source and click Next
    4. In the Destination field, select a location to store the Db2 database and click Next
    5. Select the source tables and click Next.
    6. Click Submit to complete the migration process.
  8. After the data is migrated, confirm that the data is copied without any errors.
  9. Start the Publishing Document Builder server. All resources, results, schedules, and other items that were created earlier are shown.