Skip to main content

Data Migration - Send Existing Export

Endpoint

/i/datamigration/sendexport

Overview

Sends an already-generated export package to a target Countly server.

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions

Requires data_migration Create permission.

Request Parameters

ParameterTypeRequiredDescription
exportidStringYesExisting export ID to send.
server_tokenStringYesRemote import token.
server_addressStringYesTarget server base address.
redirect_trafficNumber/StringNo1 enables post-import app redirect handoff metadata.
argsJSON String (Object)NoOptional JSON-stringified helper args.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Examples

Send existing export package

/i/datamigration/sendexport?
exportid=f9b35d90be5f2240eafced7c6bfdf130856cd0a7&
server_address=http://target-countly.example.com&
server_token=2fc9d68f6f284f9fa95b93b7d598&
redirect_traffic=1

Response

Success Response

{
"result": "Success"
}

Response Fields

FieldTypeDescription
resultStringImmediate send-initiation response.

Error Responses

  • 404
{
"result": "data-migration.invalid-exportid"
}
  • 404
{
"result": "data-migration.token_missing"
}
  • 404
{
"result": "data-migration.address_missing"
}

Behavior

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Send startValid parametersUpdates export progress metadata and triggers asynchronous send workflow.Wrapped { "result": "Success" }
Validation failureMissing export/token/addressStops before send workflow.Wrapped error key

Impact on Other Data

  • Updates export progress/state metadata in countly.data_migrations.
  • Asynchronous send flow can transition export to finished/failed states.

Operational Considerations

  • This endpoint returns immediately after scheduling send work; use status endpoint to track completion.
Implementation details

Audit & System Logs

ActionTriggerPayload
export_finished / export_failedSend/import lifecycle reaches terminal status{ app_ids, status, message }

Database Collections

CollectionUsed forData touched by this endpoint
countly.data_migrationsSend lifecycle stateUpdates send target details and progress before async dispatch.
countly.systemlogsAudit trailWrites terminal export state actions via progress updater.