Migrated a site with Snapshot – administrator locked out!

I used Snapshot to migrate a site to a new server. It almost worked well … the site looked great, I was able to log in with the administrator account BUT then when I tried to click on "Dashboard" or even the profile page for that user, I hit an error:

`You do not have sufficient permissions to access this page.

It was the only administrator account and I couldn't do anything!

In the end I solved it, but think it might be a problem with Snapshot so wanted to post here in case it's a bug. Or in case I did something wrong so I can know for next time.

Process:

1) Backed up existing site with Snapshot.

2) Downloaded the zip file with FTP

3) Installed a fresh copy of WordPress on the new server.

4) The only plugin I installed with it was Snapshot.

5) I uploaded the backup zip file to the new server in the /uploads/snapshots directory

6) I told Snapshot to scan for archives. It successfully found it.

7) I told Snapshot to restore the archive. Snapshot noted that the table prefix in the new database was different to the old database, and said it would automatically update all the tables to match the new prefix.

8) The site looked good. Correct posts, theme, etc. The administrator account could log in, but, as stated earlier, when I clicked on "Dashboard" or even the profile page for that user I received the error saying I didn't have permissions to view the page.

PROBLEM IDENTIFIED

At first I logged into the MySql server and tried to add a new administrator following these steps but that new user had exactly the same problem. Then I figured it out.

Six fields in the database had NOT been renamed with the correct table prefix. The original site had a table prefix of wp_tktb and my new site just had wp_. But it seems there are some fields that also include this prefix which is what caused all the problems.

These were the fields that hadn't be changed:

Options table (wp_options)

Field: *_user_roles

The field name was still set to wp_tktb_user_roles

I had to change it to wp_user_roles

User_meta table (wp_usermeta table)

Fields:

wp_tktb_capabilities (I changed it to wp_capabilities)

wp_tktb_user_level (I changed it to wp_user_level)

wp_tktb_dashboard_quick_press_last_post_id (I changed it to wp_dashboard…. I don't think this one was crucial, but I changed it anyway)

wp_tktb_user-settings (I changed it to wp_user-settings)

wp_tktb_user-settings-time (I changed it to wp_user-settings-time)

(I have attached a screenshot showing the old field names in the tables).

When I had made these changes, finally, the user had full permissions again and was able to use the site correctly.

I used Snapshot Version 2.4.1 for this migration. I realise it's not the most recent version, but I can't see any mention in the change log of this bug being fixed.

Perhaps I just did something wrong in the migration? Or maybe it's been fixed already in the latest version? But if not, hopefully this post helps.