migrate repo from Document -> model