Migrating changes by using copy and paste operations

When you know the exact changes that you want to move from one database to another, you can use the copy and paste operations in the Object List view to move the changes. You can move objects and data.

Before you begin

Connections must exist to the database from which you want to move changes and for the database that you want to move the changes to.

Procedure

To migrate changes from one database to another, complete the following steps:

  1. Find and copy the objects that you want to migrate.
    1. In the Administration Explorer, expand the database from which you want to migrate changes.
    2. Click the folder for the type of object that you want to migrate.
    3. In the Object List view, find the object to migrate. Right-click the object, and click Copy. You can select multiple objects of the same type, for example, all schemas or all tables.
  2. Paste the objects to the database that you want to migrate them. Right-click the database in the Administration Explorer and click Paste. When you paste at the database level, the objects are pasted into the schemas from which they came. If the schemas do not exist, they are created.

    You can paste into a schema in the Object List. Pasting into a schema is not recommended unless you want to change schema names for an object.

    The Paste Database Objects wizard starts.
  3. Complete the steps in the Paste Database Objects wizard. Use the wizard to specify whether to migrate only objects, only data, or both objects and data. A new change management script is created, and the change management script is displayed in the Change Management Script Editor.

    A data design project is automatically created in the Data Project Explorer. The name of the data design project is the name of the database connection. If a data design project with the name of the database connection exists, the name of the new data design project is the database connection name with a numeric suffix. The data design project contains and manages the resources that are necessary to implement the changes to the actual database.

  4. Optional: To migrate any other changes to the target database, drag and drop the object from the Object List that is associated with the source database to the Change Management Script Editor. The object must not exist in the target database. Only the structural definition of the object is migrated; the data in the object is not migrated.
    Tip: To drag and drop an object, you must be able to see both the Object List and the Change Management Script Editor. To display them side by side, click the title bar of the Change Management Script Editor, and drag the title bar to the right until the mouse pointer becomes a drop cursor, then release the left mouse button.
  5. In the Change Management Script Editor, assess any other objects that might be impacted by migrating the changes to the target database.
    1. In the Objects to be Changed list, click each object. Objects that are affected by the objects that are being migrated are displayed in the Impacted Objects list.
    2. Include impacted objects in the change management script. Use the Alter and Drop buttons to move the impacted objects to the Objects to be Changed list. If you use the Alter button to move an impacted object, you can click the object and make any necessary changes to the object in the Properties view.
  6. Click Preview Commands to display the generated commands in the Commands section and review the commands.

    To review a summary of the changes that will be made to the database, click View Change Report.

  7. Click Data Options to start the Customize Data Preservation wizard and complete the steps in the wizard. You might want to customize commands when changes to a table require that the table be dropped and then re-created for any of the following reasons:
    • To modify the location of the data files
    • To change the load and reload methods
    • To redefine the query for unloading the data
    • To correct mismatches between the data types of unload and reload columns
    • To remap how the data is loaded

    You can also specify which DB2 maintenance commands are generated.

  8. Review the regenerated commands.
  9. Click Run to start the Deploy Change Commands wizard.
  10. Review the change commands and click Finish to deploy the changes to the actual database catalog.

Results

You have migrated changes from one database environment to another.

Feedback