[ENG-10489](https://linear.app/comm/issue/ENG-10489/copy-tables-instead-of-replacing-entire-database).
This code is not possible to read because of amount of directives, and is likely to change in future because of [Run the migrations during backup restoration](https://linear.app/comm/project/run-the-migrations-during-backup-restoration-52bf6617d3e2/overview).
For now, I am standarizing this to follow web approach, to make testing easier.
Depends on D14517