Skip to main content

Data Migration - Report Import Status

Endpoint

/i/datamigration/report_import

Overview

Receives import status updates from the target server and updates the originating export job state.

Authentication

Request authorization for this endpoint is based on token matching rather than API user authentication. Access is controlled by matching:

  • exportid and
  • token (server_token stored in migration record).

Permissions

No user role permission check is required for this callback endpoint.

Request Parameters

ParameterTypeRequiredDescription
exportidStringYesExport job ID in countly.data_migrations.
tokenStringYesServer token that must match migration record server_token.
statusStringYesImport status value from target server (for example finished, failed).
messageStringNoAdditional status reason/message.
argsJSON String (Object)NoOptional JSON-stringified helper arguments.

Response

Success Response

{
"result": "ok"
}

Response Fields

FieldTypeDescription
resultStringStatus key/message.

Error Responses

  • 404
{
"result": "data-migration.exportid_not_provided"
}
  • 404
{
"result": "data-migration.token_missing"
}
  • 404
{
"result": "data-migration.export_not_found"
}
  • 404
{
"result": "data-migration.status-missing"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Finalized import callbackstatus=finished and valid token/exportUpdates migration progress to finished, optionally applies app redirect URLs.Wrapped { "result": "ok" }
Non-finished callbackstatus present but not finishedUpdates migration progress state using provided status/message.No success payload in this branch
Invalid callbackMissing/invalid exportid, token, or statusStops and returns error key.Wrapped error key in result

Impact on Other Data

  • Updates migration state fields in countly.data_migrations.
  • If redirect is enabled on completed import, updates countly.apps.redirect_url for exported apps.

Audit & System Logs

ActionTriggerPayload
app_redirectedCompleted import with redirect enabled{ app_id, redirect_url }
export_finished / export_failedMigration progress reaches terminal state through progress updater{ app_ids, status, message }

Database Collections

CollectionUsed forData touched by this endpoint
countly.data_migrationsExport/import state trackingReads migration by _id and server_token; updates status/step/progress fields.
countly.appsOptional redirect handoffUpdates redirect_url for exported app IDs after successful import.
countly.systemlogsAudit trailWrites redirect and terminal export status actions.

Examples

Report successful remote import

/i/datamigration/report_import?
exportid=f9b35d90be5f2240eafced7c6bfdf130856cd0a7&
token=4f04966859f6eaec2f7164ca0a33ecb4&
status=finished&
message=Import complete

Operational Considerations

  • This endpoint is part of asynchronous cross-server migration workflow; it updates status but does not block on full import pipeline operations.

Limitations

  • For non-finished status values, the handler updates progress but does not send an explicit success body.

Last Updated

2026-02-17