0

I have been building a WordPress-based website in my localhost (‘localhost/dzup_online/wordpress’) for a week now and I have been accessing the Dashboard several times now without fail. (Theme: Twentysixteen (default))

I installed another WordPress site for checking out other themes (‘localhost/dzup_online_4/wordpress’). (Theme: Clean Journal Child theme (user-made))

Since working on the ‘dzup_online_4’ website, I decided to make it my main website so I switched the names of their root directories (‘dzup_online’ <- -> ‘dzup_online_4’)

Of course, my website broke so I had to update wp-config.php to change ‘DB_NAME’, ‘DB_USER’ and $table_prefix (‘wp_’ -> ‘dzup_wp’) to point to the other database and database user. (The passwords for both database users are the same) (I also did the same for the other website) I also added the correct privileges for the database for each database user.

I updated ‘dzup_wp_options’ in the database for the ‘option_name’s ‘siteurl’ and ‘home’ to reflect the new root folder name for the website.

I renamed the database tables to be prefixed with the name $table_prefix (‘dzup_wp_’).

I also replaced the ‘guid’s of the posts in ‘dzup_wp_posts’ with the new root folder name.

At this point, I can access my home page quite fine and can access my Dashboard as an administrator.

I tried switching pages and found out that I had to modify my .htaccess too. This is the new content:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /dzup_online/wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /dzup_online/wordpress/index.php [L]
</IfModule>

# END WordPress

I refreshed the page and suddenly, I do not see the Dashboard menu button in the Admin Bar anymore.

I reverted back to my old .htaccess but my administrator account seems to have still lost administrator rights.

I tried adding a new user through this tutorial but the newly added user still cannot access the Dashboard.

I renamed the ‘meta_key’s in ‘dzup_wp_usermeta’ table to have the new table prefix at the start with the following values:

dzup_wp_capabilities a:1:{s:13:”administrator”;b:1;} dzup_wp_user_level 10

For both user accounts, I still do not have administrator rights.

I hope you can help me with this. Thanks!

3
  • Just in case, did you change siteurl and home entries in the dzup_options table via phpmyadmin ?
    – Benoti
    Commented Nov 24, 2016 at 11:52
  • @Benoti Hi! Yes, I did do the change through phpmyadmin Commented Nov 24, 2016 at 13:53
  • I didn't notice that you modifiied option entry wp_user_roles to dzup_wp_user_roles ?
    – Benoti
    Commented Nov 24, 2016 at 14:00

1 Answer 1

0

The {$table_prefix}user_roles entry in the options table must begin with the actual table prefix.

Your website was with a prefix of wp_ so the entry was called wp_user_roles. When modifying the table prefix you need to change it with the new one:

dzup_wp_user_roles

Hope it works !

3
  • Whew... thanks @Benoti! I can now access my Dashboard on both local sites. Commented Nov 24, 2016 at 15:15
  • That's cool ! Don't forget to mark the question as resolved ;-)
    – Benoti
    Commented Nov 24, 2016 at 15:21
  • 1
    Sorry didn't know how to before :D Commented Nov 26, 2016 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.