Canceling the migration process

You can cancel the db_migrate script when the migration is running, but there are a few important considerations that you need to be aware of.

About this task

When the db_migrate script runs, it starts many subordinate processes. The migration does not run as one large transaction where everything is migrated or nothing is migrated. Rather, each table is migrated separately. If multiple threads are used, then each thread is a separate, independent transaction. If you force stop a migration, note the following important considerations:
  • Any tables that were copied before you stopped the command are on the target host.
  • A table that was being copied will be in an indeterminate state.
  • For threads that have already finished, the data is committed and exists in the target table.
  • For threads that were running when you stopped the process, their data is rolled back (discarded), and the discarded rows might be consuming space in the target table.
To stop the migration process, use one of the following options:

Procedure

  • Press Control C.
  • Issue the following kill statement:
    kill -- -NNN
    where NNN is the process ID of the db_migrate script. Since many processes are associated with the migration, the relevant PID number is listed in the db_migrate output and is also a part of the directory/log file names. For example:
    
    Data Format   : ascii 
    Log Directory : /tmp/db_migrate.20100101_120000.37554
    Log File      : /tmp/db_migrate.20100101_120000.37554/db_migrate.output
    Top Level PID : 37554
    

What to do next

Before restarting the migration for the same table, you might want to TRUNCATE the target table or use the -TruncateTargetTable TRUE option when invoking db_migrate.