The Data Migration feature is available in both Countly Lite and Countly Enterprise.
This article describes how to export and import Countly data using the Data Migration feature.
Getting Started
The Data Migration feature can do the following:
- Export all data, including configurations and application data.
- Import this data to another server.
Currently, it is not possible to migrate dashboard users using the Data Migration feature.
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.
Using Data Migration
To work with Data Manager, first make sure the Data Migration plugin is enabled. To do so, in the main Countly Dashboard, go to Management > Feature Management and enable the Data Migration toggle.
Then, you will find it in Management > Data Migration.
In the tabs on the top of this View, you can see the migration processes, listed as:
- Exports: the list of your exports, e.g., data you have exported from the Countly database.
- Imports: the list of your imports
Then, the Export or Import Data button in the top-right opens a dropdown menu where you can choose to import or export data.
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, the 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.
To the right of each record, the 3-dot ellipsis menu has the following options:
-
Download log: Downloads the export log. If the export status changes to failed or exporting is not completed correctly, you can review this log file. If you have access to the server, you can also view the log file on your Countly server. It is saved in the log folder under the name
dm-export_[your export ID].log
. - Download export: Downloads the exported files. This button might not be available if there are no exported files.
- Stop export: Stops the export process. Available if the export process is not finished yet.
- Send export: This button is only available if there is an exported file on the server. It allows you to send this file to another Countly server.
- Delete export: Deletes the exported data, log file, and record in the database about this export.
Imports
This tab includes all the relevant information about your imports. If you have imported the same applications multiple times, there will be a record only for the last import. If there are still files or folders with exported data on this server and there is an attempt to import data, then there will be error. You have to delete this export in the Imports tab to start new import.
Each record consists of:
- A list of application names
- Status: Finished, Progress, or Failed.
- Last update: You can see the last action done here. If the import is not finished yet or it is stuck, it may indicate that there is problem with this import. Looking at the log file will provide you more information.
To the right of each record, the 3-dot ellipsis menu has the following options:
-
Download log: Downloads the import log. If the export status changes to failed or exporting is not happening correctly, you can review the log file. If you have access to the server you can also view the log file on your Countly server. It is saved in the log folder under the name
dm-import_[import_id].log
- Delete export: Deletes the file uploaded on the server for the data import and the log files.
Exporting and Downloading Data
In order to export data which has been collected on your Countly server, click on the Export or Import Data button and then click the Export Data button in the 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 do not want to download export, please read also through this section, because some of steps are the same and are not explained in the "Exporting data and importing to a server" section below.
You will see this drawer with the steps below:
- In the drop-down, choose applications that you want to export.
- Copy the path where you want to save the export. If you do not have a specific folder, leave this field empty.
- Chose the Export and download data option.
- If you do not have symbolication data or do not collect crashes, leave this part empty. Even if you have symbolication data you might want to leave this empty because symbolication data does not contain any information associated with your apps and user behavior in them.
After clicking on the Export data button, the drawer should close and you should see the new record appear in the Exports tab. Your record status will update automatically after 10 seconds. When it reaches the step exporting with status finished, you should be able to download your export. In order to download the export, click on the 3-dot ellipsis button and chose Download export.
After exporting, you can upload the export to other server or send it directly.
Exporting Data and Importing to a Server
If you want to send data to another server without downloading it, select your applications and export path like described above (step 1 and 2), but as Export Type (step 3) choose Export and transfer data to another Countly server.
Two fields will appear, shown below:
Server address and Server token should be provided by the target server administrator. Getting such an address and token is explained here.
If you are transferring data because you want to move to another server, you might want to enable redirection.
After pressing the button, the drawer will close and you will see the record in the Exports tab. If the export fails in the sending state you can try to resend it.
Redirecting Traffic to Other Countly Server
When you are sending an export or creating a new export, it is possible to enable traffic redirection to other server after a successful import. This means that each time your current server receives an SDK request, it gets sent to this other server.
Traffic redirection is enabled only after there is confirmation of a successful request. You can see in the System (Audit) logs recorded about an enabled redirection.
Also if you switch to your app, which is redirected, you will get this notification in the bottom-right corner:
To disable this feature, you have to go to Management > Applications. If the app is redirected, there will be a redirect URL set. Choose Edit for this application, check Remove redirect, and save changes.
Sending Exported Data
Sometimes you might have a valid export on your server, and you would like to send it. In order to do this, look for your export in the My exports list, press the 3-dot ellipsis menu, and then click on the Send Export button. After clicking, the export form will open and you will see that applications will be already chosen. If you have tried to send this export already, the export token and address fields will be filled. If you are resending the export because of invalid target server data, change the address and token to the right values.
Please read here for more information.
Importing Data
Below is explained how to import data, which has been previously exported and downloaded. If you want to allow imported data remotely you have to create a token, provide your token and address to the server administrator, and then follow the directions below.
To import, press Export or Import Data in the top-right corner and choose Import data. You will see this drawer with the steps below:
- Make sure Import previously generated file is selected.
- Drag and drop exported files in the upload box or browse.
The drawer should close and you should be switched to the Imports tab. There a record should be shown as being imported. It will be updated automatically after 10 seconds. When the status changes to finished, the data is imported.
You can also refresh the page to see imported apps in your app dropdown.
Creating a Token for Data Import
If you want to allow data to be imported remotely, you have to provide a server token and your server address to the server admin.
To import, press the Export or import data button in the top-right corner and choose Import data.
- Chose the option Import data from another server.
- Click Create token.
In this View you can see two new blocks: Server address and Token. You can also copy this information to your clipboard. If you try to close it without copying, you will get a warning message.
Note that after closing this window you will not be able to see it again. If you have closed it by mistake, you can just generate a new token or you can switch to /management/DBViewer look for last inserted token in countly.auth_tokens.
Token validity
An exported token is valid only for 7 days.