Skip to main content

Data Migration - Delete All Migration Files

Endpoint

/i/datamigration/delete_all

Overview

Deletes all local export and import file directories for the Data Migration feature.

Authentication

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

Permissions

Requires data_migration Delete permission.

Request Parameters

ParameterTypeRequiredDescription
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

Delete all migration import/export files

/i/datamigration/delete_all

Response

Success Response

{
"result": "ok"
}

Response Fields

FieldTypeDescription
resultStringOperation result key.

Error Responses

  • 404
{
"result": "Unable to remove directory"
}

Behavior

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Cleanup successFilesystem remove operations succeedRemoves export and import directories if present.Wrapped { "result": "ok" }
Cleanup failureFilesystem remove operation failsStops and returns cleanup error text.Wrapped error text

Impact on Other Data

  • Deletes local migration files/folders in plugin workspace.
  • Does not remove existing migration records from countly.data_migrations.

Limitations

  • This endpoint only cleans file system artifacts; database status records remain unless removed by other endpoints.
Implementation details

Database Collections

This endpoint does not read or write database collections directly.