Can not Login after Restoring Backup

You’ve restored your WordPress backup into another WordPress site, and now you notice that you can not log in to the new site any longer.

There was a bug in WP STAGING | PRO v4.0.2 which sometimes caused login issues when the target WordPress site had a different table prefix than the original source site the backup was made from.

This has been fixed in WP STAGING | PRO v4.0.2, but it required the creation of a new backup.

If you imported an older backup created with v4.0.2 you can easily fix the issue even after restoring your website from that backup by doing a minor modification in the database with adminer or PHPMyAdmin.

If you need help in doing this, please get in touch with us and provide us with full access credentials to your website, including FTP.

First, find out the table prefixes of your production site.

When you experience this login issue, it’s likely both prefixes are different.
You can open WP STAGING > System Info on both websites and can find the table prefix in the list of variables:

WordPress Table Prefix
WordPress Table Prefix

Alternatively, you can find the table prefix in the wp-config.php of both websites. This is the configuration file in the root path of your WordPress installation.

For this example:

  • Our source website has the prefix wp_
  • Our destination website has the prefix wpnew_.

Open PhpMyAdmin and access the database of your destination website where you have login issues.

Usually, all prefixes of wp_  in the WordPress core tables should have been replaced by wpnew_ during the backup restore process but this failed due to the mentioned bug.

So to fix it, simply search for the term wp_ and replace it with the correct value wpnew_.

The most important term you need to look for is wp_capabilities in the table wpnew_usermeta:

This wrong value is the reason you can not log in to your website.

Click on Edit and you will be able to change the value:

Rename it to wpnew_capabilities.

That’s it. You are done and can log in to your new website, now.




Updated on July 22, 2021