Microsoft SQL Server

About this task

Recommended path for migration: 

  1. Migrate table structures to the target database
  2. Move data using Lift CLI
  3. Optional: Migrate indexes and other constraints

Procedure

Create the schema and table structures on Db2 Warehouse SaaS.

Move your data

After your table structures are in place, you can start moving your Microsoft SQL Server tables. Start by extracting a table to a CSV file. Move that file over the network, stage it in the landing zone on Db2 Warehouse SaaS, and then load it into the database.

  1. Extract the table to a CSV file by running the following lift extract command:
    % lift extract --source-schema <sqlserver-schema-name> --source-table <sqlserver-table-name> --source-database <sqlserver-database-name> --source-host <sqlserver-host-name> --source-user <sqlserver-user-name> --source-password <sqlserver-password> --source-database-port <sqlserver-database-port> --source-database-type <sqlserver> --file <path-to-csv-file>
    
  2. Move your CSV file and stage it in the landing zone of the target database by running the following lift put command:
    % lift put --file <path-to-csv-file> --target-user <target-user-name> --target-password <target-password> --target-host <target-database-host-name>
    
  3. Load your CSV file into the target engine database by running the following lift load command:
    % lift load --filename <csv-file-name> --target-schema <target-schema-name> --target-table <target-table-name> --file-origin extract-sqlserver --target-user <target-user-name> --target-password <target-password> --target-host <target-database-host-name>
    

    The --file-origin extract-sqlserver option specifies that the CSV file was extracted by using the lift extract command.

    You're done. You can now run SQL queries on your data from the database console.

    Optionally, you can move indexes and other constraints from the source database to the target database after completing the data movement.