Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Migration from one test trail account to another

We are in process of migrating existing Test Trail repo to an existing Test Trail repo.

Do you have any topic link that can help us to migrate ?

I was able to Migrate through XML export and but Test Runs and results are not migrated,How can I migrate results and attachments?

Hello Venu,

Thank you for posting! Currently, you would only be able to export your test cases and sections via XML export/import. Tthe test results/plans/history wouldn’t be brought over. Any attachments, custom fields, users, and settings would need to be added to the TestRail instance manually as we currently don’t have a migration option for those entities. So you would either need to manually re-enter results and add attachments into the desired test run, or use TestRail’s API to retrieve the results from one test run and then re-add them to the correct run.

How you decide to proceed with this would likely depend on the number of test results you need to migrate and the experience your team has with TestRail’s API:

I hope this helps!


Hello John ,
Thanks for the response,
Our team doesn’t have much experience working with TestRail API.
Does Gurock have any automated scripts that can migrate test results from source instance of Test Trail to Target Instance?

If you have this scripts,that would save a lot of our time to migrate this manually.

Please let me know.

Hi @Venu,

We do not have any example automated scripts for this type of data migration. If you would like to automate the migration of your results, you can utilize our API for this, and the process would likely be as follows:

  1. Map your source test case IDs to the new case IDs after the XML import
  2. Use the ‘get_runs’, ‘get_plans’, ‘get_tests’, and ‘get_results’ API methods to collect your test run details from your source instance. The ‘get_tests’ API method will provide you with the test case IDs to help you map the old results to your new test cases.
  3. Use ‘add_run’ and ‘add_plan’ to recreate your test runs.
  4. Then use ‘add_results_for_cases’ to submit the collected results to the test runs you recreated. The ‘add_results_for_cases’ method is recommended for this approach since you would not need to collect new test_ids for each run, but instead can use your case_ids which are already known.

Please keep in mind that this type of migration would not preserve timestamps and user information associated with the results. Any newly created results will have timestamps and user information for the API account used to migrate the data.

Additionally, you should be sure the result_ids and other fields correlate to the destination instance, otherwise additional value mapping may be needed.

If this automated process cannot be implemented by your team, then you would need to manually migrate the results or simply export the result data from your previous instance and store this for reference.

Hope this helps,

Hi Jon,

One more question,

I am getting 404 -
“Unknown method ‘get_attachments_for_case’”

Error when I run test from Postman.



Hi @Venu,

The error message you are receiving would indicate your TestRail version does not have this API method available. The attachments endpoints were made available with TestRail 5.7, so any installations using a previous version would need to be updated before attempting to access attachments via the API.

Hope this helps,

Hi Jon,

Hope you are doing good.

One more question related to Test Plans and Test runs,How can I move existing test runs to Test pla/n?