Locked Out Of WordPress Admin Dashboard After Server Move

The answer was the following:

Changing the table names to the correct prefix during the migration was not enough, you have to go into the wp_options table and change wp_user_roles (option id 92) to use the correct prefix as well.

Furthermore in wp_usermeta, change the prefix for the administrator user (if not all users).

So for example roi_user_level becomes wp_user_level