Backing up the DB2 database on the new server

Before restoring your data, back up the new DB2 database on the new server and then drop it. You can roll it back if the side-by-side migration fails.

About this task

Use the BACKUP DATABASE command to take a copy of the database data and store it on a different medium. You can back up an entire database, database partition, or only selected table spaces. The database can be local or remote. The backup image remains on the database server, unless you are using a storage management product such as Tivoli Storage Manager (TSM) or DB2 Advanced Copy Services (ACS).

Use the RESTORE DATABASE command to recover a database or table space. If you have backed up your database or individual table spaces, you can recreate them if they become damaged or corrupted. The database can be local or remote. When restoring to an existing database, do not be connected to the database that is to be restored since the restore utility automatically establishes a connection to the specified database, and this connection is terminated at the completion of the restoring operation.
Note: We use DB2 10.5 as an example. For other versions, see the DB2 online product documentation.

Procedure

  1. Back up the 2.0 database. To invoke the backup utility:
    1. Issue the BACKUP DATABASE command in the command line processor (CLP).
    2. Run the ADMIN_CMD procedure with theBACKUP DATABASE parameter.
    3. Use the db2Backup application programming interface (API).
    4. Open the task assistant in IBM Data Studio for the BACKUP DATABASE command.
    Following is an example of the BACKUP DATABASE command issued through the CLP:
    db2 backup database CONCORD to D:\DB2Backups
    Note: For more details, see Backup overview in the DB2 10.5 online product documentation.
  2. Drop the 2.0 database. Use the dropDb script in theSetupDB\db2 directory, where you extract the 2.0 installation package.
  3. If the side-by-side migration fails, roll back the db2 database . To invoke the restore utility:
    1. Issue theRESTORE DATABASE command.
    2. Call the db2Restore API.
    3. Open the task assistant in IBM Data Studio for the RESTORE DATABASE command.
    Following is an example of the RESTORE DATABASE command issued through the CLP:
    db2 restore db CONCORD from D:\DB2Backups taken at 20160419134523
    Note: For more details, see Using restore in the DB2 10.5 online product documentation.