Search code examples
phpdatabasewordpresssandbox

Wordpress - do not have sufficient permissions for cloned databases


I'm setting up a duplicate sandbox wordpress CMS for a website, and when I log into Wordpress I'm getting "You do not have sufficient permissions to access this page."

Here's what I did:

  1. Created subdomain sandbox.mysite.com
  2. Downloaded all existing WP files and uploaded them to sandbox
  3. Copied all WP database tables and renamed all prefixes new_ from wp_
  4. wp-config.php, changed $table_prefix to new_ from wp_
  5. In table new_options, I changed the rows siteurl and home to sandbox.mysite.com

Logging in here gives me the error.

Without changing the $table_prefix variable in wp-config.php, I can log in, but it's using the original database and redirects to the original wordpress. It's getting all the info from the original tables this way.

I can't find what else I need to change, not sure if it's a user permission or a pathing issue or what. Any help is great appreciated. Thanks!


Solution

  • OP here, I solved it, and I'm now up and running. I originally did everything right, but after some more research I found that I was missing an update in the table new_options. I needed to also update the column option_name. I found this by searching for all instances of the old prefix in that table using

    SELECT * FROM  `new_options` WHERE  `option_name` LIKE  '%wp_%'LIMIT 0 , 30
    

    This article helped me: https://digwp.com/2010/10/change-database-prefix/