Problems Accessing WordPress Admin After Moving

If after moving WordPress to a new hosting or server you cannot access the admin area and get this message:

You do not have sufficient permissions to access this page.

All you have to do is correct some database values.

If for example the old table prefix configured in wp-config.php is:

$table_prefix  = 'wp_';

and the new is:

$table_prefix  = 'new_wp_';

then you have to change the following:

In new_wp_usermeta you have to change all occurrences of wp_capabilities, wp_user_level, and wp_autosave_draft_ids to new_wp_capabilities, new_wp_user_level and new_wp_autosave_draft_ids

Then in table new_wp_options change wp_user_roles to new_wp_user_roles

This should resolve the problem.