Fix update_repo to avoid nesting backup
When updating repo, we should not have nexsted repo

This fix should also try to "repair" existing database.
We have a mix and match of repos.
- /repos
- Duplicate entries
- Nested repos
Let create an update repo that repair all of it.
Edited by Patrik Dufresne