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

Backup/Recovery of Test Runs


I run TestRail on a local server. We presently support 29 projects. Not long ago, a user mistakenly deleted a test suite. Although the database is backed up nightly, it was nevertheless cumbersome to recover the test suite; I restored the database to the test server, exported the target test suite to XML, re-imported the XML, and manually re-linked the attachments to the test suite.

While the test suite was recovered, the test runs were not, as there does not appear to be a way of importing test RUN XML data. How can this data be restored to the production server?

Is there a backup/restore strategy that targets both the test suites and test runs for a single project? This is preferable to a full database backup, as it does not interfere with data from other projects.



Hi Phil,

Thanks for your post! An XML or CSV import would just import test cases, and wouldn’t allow any test runs/results/history to be imported as well. In this case, it would be recommended to perform a full database restore as you would be able to restore the test runs/results, however this would override all other changes on all projects that have been made since the backup was taken. The only alternative would be to use TestRail’s API to add runs/results after re-importing the test cases via XML, although this would take a bit of development work to script this, and timestamps wouldn’t be historically accurate to when they were previously added. In general, we would typically recommend limiting the delete permissions to a very small subset of users, or only enabling it temporarily when a delete action is approved, to avoid any accidental data deletion going forward.

Hope this helps!