[wp-trac] [WordPress Trac] #41240: Changing database table prefix confused logins
WordPress Trac
noreply at wordpress.org
Tue Jul 4 18:55:08 UTC 2017
#41240: Changing database table prefix confused logins
------------------------------+-----------------------------
Reporter: frankieandshadow | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.8
Severity: normal | Keywords:
Focuses: |
------------------------------+-----------------------------
I was moving a site from one server to another and did the following:
1. install vanilla wordpress and check it worked (it did), using prefix
tst_... in wp-config
2. mysqldump on old server,
3. edited the dump to replace all the INSERTs etc from `wp_...` to
`tst_...` and
4. deleted vanilla tables and uploaded the edited sql to the database.
5. replaced vanilla wp-content with wp-content from the old server
(I wanted to do this as the new host only has one database, and I wanted
to put a staging version and live version in the same database with
different prefixes).
I could view the site but when logging in as admin it appeared to
recognise the login and gave the usual black bar across the top with
"Howdy, ...", but always redirected back to the home page from login, and
gave "you are not allowed to access this page" when trying /wp-admin or
similar. Either jetpack or wordfence eventually blocked me, so I removed
those, but while it no longer then locked me out it still wouldn't
completely log in.
I was able to reproduce the problem on a different server using VirtualBox
from the same set of files so I don't think it was anything peculiar about
the specific host.
It was behaving as if admin were a user with no privileges. I suspect, on
very little evidence, that the old prefix is stored somewhere either in
the database (or just maybe wp-content), rather than getting it from the
config file. But whatever the cause, it doesn't seem to work to just
straightforwardly change the prefix in all the obvious places.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41240>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list