How to restore the data related to Two Factor Authentication for Bitbucket after database migration

Though the Atlassian Database Migration Wizard migrates the Bitbucket server data, it does not involve app related data. This article explains the steps to be taken to restore the application data in the new database after the database migration.


  1. After Bitbucket instance is re-platformed with the new database, install the Two-factor Authentication for Bitbucket app in the Bitbucket server. This automatically creates the following nine tables in the new database:
    • AO_41E961_AUTH_TRACKER
    • AO_41E961_ITEM_ENABLE
    • AO_41E961_PHRASE
    • AO_41E961_RULE
    • AO_41E961_USER_CONFIG
  2. Go to your source database and export the data, from each of the tables in the list, in the CSV format.
  3. Go to your target database and import the CSV data into each of the corresponding tables in the database.

If the application related tables are not available in the new database after the database migration, reinstall the app. This action recreates the tables and perform step #3 again.

  • It is always recommended to perform these actions in the presence of your database administrator.
  • It is strongly recommended to try this in a non-production instance before implementing in production.