Developer
News and Updates
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Last updated Nov 11, 2026

Identify enabled managed exports

Overview

When your cloud app declares a migration:managedExports module (see Onboarding to SAM), Atlassian exports that data for you during the migration. As a result, your Data Center (DC) app no longer needs to migrate it.

Your DC app can check at runtime which managed exports are enabled for the current migration. Use this to skip any part of your own migration code that Atlassian now covers, so the same data isn't migrated twice. For example, you can stop sending your own custom field values or attachments when Atlassian exports them.

The configuration comes from the cloud app installed on the destination site for that migration. It reflects the migration:managedExports module of the cloud app version and environment being migrated to as well as what is available within the migrating DC server.

Choose the API for the part of your app making the call:

CallerAPIResult
Data Center migration listener (Forge or Connect destination)gateway.getManagedExports()Java ManagedExports interfaces with isEnabled() and detail methods.
Forge cloud backendmigration.getSamFeatures(transferId)Exporter configurations with enabled flags and arrays.
Connect cloud backendNot publicly documented. Contact Atlassian for informationExporter configurations with enabled flags and arrays.

The APIs report configuration, not processing progress. An enabled exporter does not mean that its files have arrived or been processed. Your cloud app still needs to consume event notifications and file listings, commit processing results and acknowledge files.

Data Center requirements

  • Your DC app must use atlassian-app-cloud-migration-listener version 1.8.9 or later.
  • SAM must be enabled for your app and the destination site. See the note in Onboarding to SAM. If SAM isn't enabled, every exporter reports isEnabled() == false.
  • The JCMA version running on the DC is at least version 1.27.0
1
2
3
4
5
6
<dependency>
  <groupId>com.atlassian</groupId>
  <artifactId>atlassian-app-cloud-migration-listener</artifactId>
  <version>1.8.9</version>
</dependency>

Getting the managed exports configuration

Call getManagedExports() on the migration gateway that your listener receives. The method is available on both gateway types:

Listener typeGatewayMethod
DiscoverableForgeListener (Forge)AppCloudForgeMigrationGatewayManagedExports getManagedExports()
DiscoverableListener (Connect)AppCloudMigrationGatewayManagedExports getManagedExports()

The result is scoped to the current migration (transfer). Call it during the migration, for example from onStartAppMigration, rather than caching it across migrations.

Older JCMA and CCMA versions don't implement getManagedExports() and throw an UnsupportedOperationException. Always wrap the call in a try/catch. If it throws, treat every managed export as disabled and fall back to your existing migration code.

The ManagedExports interface

com.atlassian.migration.app.gateway.ManagedExports gives you one exporter per managed export type. Each exporter has an isEnabled() method, plus a method that tells you exactly what Atlassian will export.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public interface ManagedExports {
    MappingExporter getMappingExporter();
    BinaryExporter getBinaryExporter();
    DatabaseExporter getDatabaseExporter();
    CustomFieldValuesExporter getCustomFieldValuesExporter();

    interface MappingExporter {
        boolean isEnabled();
        List<String> getEntityTypes();
    }

    interface BinaryExporter {
        boolean isEnabled();
        List<String> getDirectories();
    }

    interface DatabaseExporter {
        boolean isEnabled();
        List<String> getTables();
    }

    interface CustomFieldValuesExporter {
        boolean isEnabled();
        List<String> getCustomFieldTypes();
        List<String> getCustomFieldNames();
    }
}

Managed export types

An exporter counts as enabled only when SAM is enabled for the migration and the export type is configured and available for your app. Mapping, binary and custom field values exports use the cloud app's manifest configuration; AO table exports require Early Access onboarding. If an exporter is disabled, its detail methods return an empty list.

ExporterManifest entryisEnabled() returns true when…Detail methodReturned value
MappingExportermapping → entityTypesAtlassian will export at least one entity type.getEntityTypes()The entity types whose mappings will be exported, for example jira:issue. Returns ["*"] if all entity types are exported.
BinaryExporterbinary → directoryPrefixAtlassian will export at least one directory.getDirectories()The directory prefixes, relative to the product home directory, whose files will be exported as binary data. Returns ["/"] if the whole home directory is exported.
DatabaseExporterAO tables (Early Access)Atlassian will export at least one table.getTables()The AO tables that will be exported (see the AO File Specification). Returns ["*"] if all your app's tables are exported.
CustomFieldValuesExportercustomFieldValues → fieldsAt least one fields entry declares a server.typeKey.getCustomFieldTypes()The distinct DC custom field type keys (server.typeKey) whose values JCMA will export. See Custom Field Values.

The values "*" (mappings and database) and "/" (binary) mean "export everything". Check for them before you compare individual entries.

Example

The following example uses a Forge listener. For a Connect listener, call getManagedExports() on the AppCloudMigrationGateway passed to onStartAppMigration in the same way.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@Override
public void onStartAppMigration(AppCloudForgeMigrationGateway gateway, MigrationDetailsV1 migrationDetails) {
    ManagedExports managedExports = null;
    try {
        managedExports = gateway.getManagedExports();
    } catch (UnsupportedOperationException e) {
        // JCMA/CCMA is too old to support managed exports. Fall back to migrating everything yourself.
        log.info("Managed exports are not supported by this version of JCMA/CCMA", e);
    }

    // Mappings
    boolean mappingsManaged = managedExports != null && managedExports.getMappingExporter().isEnabled();
    List<String> managedEntityTypes = mappingsManaged
            ? managedExports.getMappingExporter().getEntityTypes()
            : Collections.emptyList();

    // Binary data (attachments and other files)
    boolean binaryManaged = managedExports != null && managedExports.getBinaryExporter().isEnabled();
    List<String> managedDirectories = binaryManaged
            ? managedExports.getBinaryExporter().getDirectories()
            : Collections.emptyList();

    // AO tables
    boolean databaseManaged = managedExports != null && managedExports.getDatabaseExporter().isEnabled();
    List<String> managedTables = databaseManaged
            ? managedExports.getDatabaseExporter().getTables()
            : Collections.emptyList();

    // Custom field values
    boolean customFieldValuesManaged = managedExports != null
            && managedExports.getCustomFieldValuesExporter().isEnabled();
    List<String> managedCustomFieldTypes = customFieldValuesManaged
            ? managedExports.getCustomFieldValuesExporter().getCustomFieldTypes()
            : Collections.emptyList();

    if (!managedCustomFieldTypes.contains("com.vendor.my-app:my-custom-field-type")) {
        migrateCustomFieldValues(gateway);
    }

    if (!binaryManaged) {
        uploadAttachments(gateway);
    } else if (!managedDirectories.contains("/")) {
        // Upload only the files outside the directories Atlassian exports as defined by your cloud app.
        uploadAttachmentsExcluding(gateway, managedDirectories);
    }

    // ...apply the same approach to mappings and AO tables.
}

Checking from a Forge cloud app

Use migration.getSamFeatures(transferId) to retrieve the enabled exporters from your Forge backend. Unlike the Data Center Java API, its response uses enabled fields and configuration arrays. It does not enable exporters, download data or complete a migration.

Forge requirements

  • Use @forge/migrations version 3.3.0 or later in your Forge app:

    1
    2
    npm install @forge/migrations@^3.3.0
    
  • Configure your app for SAM, and deploy and install the intended app version/environment on the destination site.

  • Call the method from a Forge backend handling the app's migration. Use that migration notification's transferId.

Method

1
2
migration.getSamFeatures(transferId: string): Promise<SamFeaturesResponse>
ParameterTypeDescription
transferIdstringThe app migration transfer whose enabled exporters you want to retrieve.

The SDK makes an authenticated app request to GET /app/migration/forge/v1/sam/{transferId}/features. Use the SDK method in Forge; you do not need to build the request or supply your own authorization token.

Response

The promise resolves to an object with four exporter configurations:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
interface SamFeaturesResponse {
  mappingExporter: {
    enabled: boolean;
    entityTypes: string[];
  };
  binaryExporter: {
    enabled: boolean;
    directories: string[];
  };
  databaseExporter: {
    enabled: boolean;
    tables: string[];
  };
  customFieldValuesExporter: {
    enabled: boolean;
    customFieldTypes: string[];
    customFieldNames: string[];
  };
}
ExporterConfigurationHow to use it
mappingExporterentityTypesCheck enabled before expecting mapping exports; the array identifies their entity types.
binaryExporterdirectoriesIdentifies the directory prefixes covered by the binary exporter.
databaseExportertablesIdentifies the AO tables covered by the database exporter. AO exports require Early Access onboarding.
customFieldValuesExportercustomFieldTypes, customFieldNamesIdentifies the configured custom field values exports.

Check each exporter's enabled flag before using its configuration. These are configurations for the requested transfer, not a global capability list. Do not reuse one transfer's response to decide how to process another transfer.

An enabled exporter does not mean its files have arrived or been processed. Continue to consume event notifications and file listings, commit processing results, and acknowledge event files. This method does not download data, acknowledge files or complete the migration.

Example: inspect exporters when a migration starts

This backend handler logs the enabled exporters. Add your own durable processing logic separately; this example does not process or acknowledge event files.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { migration, MigrationAPIError } from '@forge/migrations';

export async function onMigrationStarted(event) {
  if (!event.transferId) {
    throw new Error('Migration notification is missing transferId');
  }

  try {
    const features = await migration.getSamFeatures(event.transferId);
    const exporters = [
      ['MAPPINGS', features.mappingExporter.enabled],
      ['BINARY', features.binaryExporter.enabled],
      ['DATABASE', features.databaseExporter.enabled],
      ['CUSTOM_FIELD_VALUES', features.customFieldValuesExporter.enabled],
    ];

    console.log({
      transferId: event.transferId,
      enabledExporters: exporters.filter(([, enabled]) => enabled).map(([label]) => label),
    });

    if (features.mappingExporter.enabled) {
      console.log({ entityTypes: features.mappingExporter.entityTypes });
    }
  } catch (error) {
    console.error('Unable to retrieve SAM features', {
      transferId: event.transferId,
      status: error instanceof MigrationAPIError ? error.status : undefined,
      message: error instanceof Error ? error.message : String(error),
    });
    throw error;
  }
}

Wire onMigrationStarted to your existing avi:ecosystem.migration:triggered:listener trigger. This identifier is an event name in modules.trigger.events, not an OAuth scope in permissions.scopes. The SDK uses Forge's authenticated app transport for the request. See the quick start for migration trigger configuration.

Forge errors

The SDK expects HTTP 200 with a JSON response. It rejects the promise for other HTTP statuses or when the response body cannot be parsed as JSON. The SDK publicly exports MigrationAPIError (an alias of its internal APIError class); HTTP failures expose the HTTP status through its status field when available.

  • If getSamFeatures is not a function, check the installed @forge/migrations version, update the dependency and redeploy the app.
  • If a request fails, confirm the transfer belongs to the current app migration and check the destination installation/environment and SAM onboarding. Preserve the error for investigation or a controlled retry; do not treat a failed request as evidence that every exporter is disabled.

Troubleshooting

Every exporter is disabled, but my manifest declares migration:managedExports.

  • Check that SAM has been enabled for your app and test site. See Onboarding to SAM.
  • Check that the cloud app version with the migration:managedExports module is deployed to the Forge environment and installed on the destination site you're migrating to.
  • Check that the DC app is linked to the correct cloud app. A DiscoverableForgeListener uses its Forge app ID and environment; a DiscoverableListener uses its cloud app key.

getManagedExports() throws UnsupportedOperationException.

The JCMA or CCMA version running the migration doesn't support managed exports. Upgrade the migration assistant or handle the exception as shown in the example.

Rate this page: