It's so arduous to do this manually. It takes a thousand clicks. Just the checkboxes alone on the reset page is killing me. Is it possible to import roles via the command line? I tried moosh but I cannot even restore a course with moosh because of errors with the roles not being able to be mapped. So I'm trying to find a good way to import the roles.
Is https://docs.moodle.org/311/en/Role_export_and_import what you are looking for?