[FEATURE] Migrate query data

Implements [ticket 1983](https://www.openproject.org/issues/1983)