Client Web Fragment Plugin Modules

Data Center Migration Plugin Module


Data Center Migration provides two plugin points that can be used by plugin developer to integrate into the migration process


Registered export modules are called when the export process encounters one of three top level "scopes"

  1. Project
  2. PullRequest
  3. Repository

Export Context

In addition to the entity being exported an ExportContext is also supplied to the relevant method. The export context can be used to add data to the export archive, add errors, warnings and entity mappings to the export job.


When the import process encounters an entry that is the responsibility of an [Importer] ( either the onArchiveEntry or onEntry will be called depending on the type of entry encountered. This will allow the importer to access the content of the entry and perform the import.

Import Context

An ImportContext is used to add errors, warnings and provide entity mappings to the import job.

Entity Mappings

Bitbucket provides no guarantee the ID's of entities being imported and exported will be stable across instances. This is a problem because entities need to refer to each other e.g. a PullRequest references a Repository. The solution: ExportContext provides the concept of a MigrationEntityType that is supplied to getEntityMapping which provides a mapping between the original id of an entity on the source instance and the id of the entity on the target instance.


The root element for the Data Center Migration plugin module is <migration-handler/>. It allows the following configuration attributes:


keyYesThe identifier of the plugin module. This key must be unique within the plugin where it is defined.
exporterYes An exporter definition containing a fully qualified class name This class must implement Exporter
importerYes An importer definition containing a fully qualified class name. This class must implement Importer
weightThe (integer) weight of the plugin module. Migration handlers with a higher weight will be processed later. Third party plugins must use a weight greater than 100


Here is an example for a custom Data Center Migration handler


<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${}" plugins-version="2">
        <vendor name="${}" url="${project.organization.url}" />

    <migration-handler key="ExampleMigrationHandler" weight="101">
        <exporter class=""/>
        <importer class=""/>



Third party plugins must use a plugin weight greater than 100

Rate this page: