Data migration


This document describes how to export and import Countly data using data migration plugin. Before moving further, please check whether data migration plugin is enabled under section plugins or not. You can find link to data migration plugin under Management > Plugins.

Data Migration plugin can do the following:

  1. Export all data, including configurations and application data.
  2. Import this data to another server.

Currently it is not possible to migrate dashboard users using data migration plugin.

Exporting and importing can be done directly from server to server (via direct communication), or one export can be downloaded and then uploaded to the new server. It is up to you to choose which method you may want to go with.

There are multiple sections in this plugin. In tabs above the screen, you can view migration processes:

  • My exports: There is list of your exports, e.g data you have exported from Countly database.
  • My imports: There is list of your imports

"Export or import data" button opens a dropdown where you can choose to import or export data.

My exports

This tab includes detailed information about your current and past exports. Each line describes one export. If you export the same apps multiple times, system will record only the last export.

Each record consists of:

  • Applications: A list of application names.
  • Step: One of Exporting, Packing, Sending, Importing to other server.
  • Status: It can be either Finished, Progress or Failed.
  • Last update: You can see the last action done here, which can be exported data or packed data or received information about import status on other Countly server. If Export is in exporting step and given time in last update doesn't changes for a while, it might indicate, that there is a problem with export.
  • Action button.

Clicking on action button can do the following:

  • Download log: Downloads export log. If export status changes to failed or exporting is not completed correctly, you can review this log file. If you have access to server you can also view log file on your Countly server. It is saved in log folder under name dm-export_[your export ID].log.
  • Download export: Downloads exported files. Button might not be available if there are no exported files.
  • Stop export: Stops export process. Available if export process is not finished yet.
  • Send export: This button is only available if there is an exported file on server. It allows you to send this file to other Countly server.
  • Delete export: Deletes exported data, log file and record in database about this export.

My imports

This tab includes relevant information about your imports. If you have imported same applications multiple times, there will be a record only for last import. If there are still archives or folders with exported data on this server and there is attempt to import data, then there will be error. You have to delete this export in "My imports" section to start new import.

Each record consists of:

  • A list of application names
  • Status: Finished, Progress or Failed.
  • Last update: You can see the action done here. If import is not finished yet or it is stuck, it may indicate that there is problem with this import. Looking at log file will provide you more information.
  • Action button.

Clicking on action button will do any of the following:

  • Download log: Downloads import log. If export status changes to failed or exporting is not happening correctly, you can review log file. If you have access to server you can also view log file on your Countly server. It is saved in log folder under name dm-imort_[export id].log
  • Delete export: Deletes archive, which was uploaded on server for data import and log files.

Exporting and downloading data

This section shows how to export data. In order to export data which has been collected on your Countly server, click on "Export or import data" button and then click "Export data" button in drop down menu.

Below we explain how to export and download data. Next section explains how to export and send data to another server. Even if you don't want to download export, please read also through this section, because some of steps are the same and are not explained in "Exporting data and importing to a server" section below.

  1. In drop-down, choose applications which you want to export.
  2. Copy path where you want to save export. If you don't have a specific folder, leave as is.
  3. Chose Export and download data option.
  4. If you don't have symbolication data, or don't collect crashes, leave this part empty. If you are not sure what symbolication means visit Crash symbolication documentation. Even if you have symbolication data you might want to leave this empty because symbolication data doesn't contain any information associated with your apps and user behavior in them.
  5. As we are downloading export, we won't be redirecting traffic. About traffic redirection you can read here.
  6. Click export data to export data.

After clicking on Export data button, drawer should close and you should see new record appear, in My Exports tab. Your record status will update automatically after 10 seconds. When it reaches step "exporting" with status "finished", you should be able to download your export. In order download export, choose action button (3 dots) and then chose "Download export".

After export you can upload export to other server or send it directly.

Exporting data and importing to a server

Please also read "Exporting data" section above.

If you want to send data to other server without downloading it, select your applications and export path like described above (points 1 and 2), but as export type choose: "Export and transfer data to other Countly server".

Two fields will appear, shown below:

Server address and token should be provided by target server administrator. Getting address and token is explained here.

After you fill both fields button test connection will appear. Clicking on Test connection button doesn't start export, it only validates if it will be possible to import data to a remote Countly server.

If you are transferring data because you want to move to other server, you might want to enable redirection.

After pressing button, form will close and you will see record in My exports tab. If export fails in sending state you can try to resend it.

Redirecting traffic to other Countly server

When you are sending export or creating new export, it is possible to enable traffic redirection to other server after successful import. It means - each time your current server receives sdk request, it gets sent to this other server.

Traffic redirection is enabled only after there is conformation about successful request. You can see in system (audit) logs record about enabled redirect.

Also if you switch to app, which is redirected, you get notification in top right corner:

To disable this feature, you have to go to Management > Applications. If app is redirected there will be redirect URL set. Choose Edit for this application, check "Remove redirect" and save changes.

Sending exported data

Sometimes you might have valid export on your server and you would like to send it. In order to do this, look for your export in My exports list, press action button (three dots) and then click on Send export button. After clicking, export form will open and you will see that applications will be already chosen. If you have tried to send this export already, export token and address fields will be filled. If you are resending export because of invalid target server data - change address and token to right values.

Please read Exporting data II for more information.

Importing data

Below is explained how to import data, which is previously exported and downloaded. If you want to allow import data remotely you have to create a token, provide your token and address to server administrator, and export will be done following directions here.

To import press button in to right corner Export or import data and choose Import data. A form to import data will open.

Here, do the following:

  1. Make sure Import previously generated file is selected.
  2. Drag and drop exported files in upload box or browse.
  3. Press Import data.

Import tab should close and you should be switched to My Imports tab. There should be one visible record about import. It will be updated automatically after 10 seconds. When status changes to finished, data is imported.

You can also refresh page to see imported apps in your app dropdown.

Creating token for data import

If you want to allow data to be imported remotely, you have to provide server token and your server address to the server admin.

To import press button in to right corner Export or import data and choose Import data.

  1. Chose second option Import data from other server.
  2. Here you can see your server address. Click on it and then you can paste it later.
  3. Press Create token.

In this view you can see two new blocks: server address and token. You can also copy this information to clipboard. If you try to close it without copying, you will get a warning message.

Note that after closing this window you won't be able to see it again. If you have made mistake by closing it - you can just generate new token or you can switch to /managment/DBViewer look for last inserted token in countly.auth_tokens.

Token validity

Exported token is valid only for 7 days.

Was this article helpful?
0 out of 0 found this helpful

Looking for help?