43.10.1smileutil: Clear Migration Lock

 

The clear-migration-lock command clears stale database migration locks. A database migration lock ends up in the database specifically when a migration is interrupted and cannot cleanly shut down. This migration lock will prevent future attempts to migrate, until it is removed.

When a migration begins, a log message will indicate the UUID of the lock. It is this same UUID which should be passed to the clear-migration-lock command. In addition to this lock parameter, you must also pass the mode parameter, indicating whether this is a cluster manager migration, or a persistence migration.

43.10.2Example

 

Upon migration, consider the below log line that can be found:

Migration Lock Row added. [uuid={13e7f9c6-a735-11ed-afa1-0242ac120002}]

Note the above UUID. To remove that migration lock on the Cluster Manager, you can call the following command

bin/smileutil clear-migration-lock -d H2_EMBEDDED -m CLUSTERMGR -u "jdbc:h2:file:./database/h2_clustermgr" --username "SA" --password "SA" --lock-uuid 13e7f9c6-a735-11ed-afa1-0242ac120002 

43.10.3Options

 
  • -d [driver] (or --driver [driver]) – This argument tells the tool which database dialect to use. The values used here are identical to the values used in the Smile CDR configuration properties file.
  • -n [username] (or --username [username]) – The database username.
  • -p [password] (or --password [password]) – The database password.
  • -u [url] (or --url [url]) – The JDBC database URL.
  • -m [mode] (or --mode [mode]) – Specifies whether the cluster manager (CLUSTERMGR), FHIR Storage (PERSISTENCE) or Audit Events (AUDIT) module tables should be migrated.
  • -l [uuid] (or --lock-uuid [uuid]) – Specifies the UUID of the lock you wish to remove. This can be found in the migration log files. Alternatively, you may manually inspect your database's migration table to find this entry.
  • --debug – Enable debug mode.

Note that many of the options above require an argument from a list of possible values (such as the Database Driver and the Smile CDR Version. You can see a list of possible options by using the following command:

bin/smileutil help clear-migration-lock