Cannot login to site after migrating a wordpress.com site to Cloudron
-
I figured I'd try to use these MySQL instructions to adding a new user directly into the database:
https://wp-qa.com/wordpress-cannot-login-after-migrating-with-all-in-one-wp-migration
But even though I can get into MySQL using the Terminal, I can't use those commands as I don't know the db name and password.
-
Using wp cli I can see all the users are there, but none of them can login
/app/code# wp user list +-----------+---------------+---------------+----------------------------------+---------------------+---------------+ | ID | user_login | display_name | user_email | user_registered | roles | +-----------+---------------+---------------+----------------------------------+---------------------+---------------+ | 217402542 | gooplearn | gooplearn | xxx@xxx.xxx | 2022-02-18 22:11:09 | administrator | | 217402544 | jdaviescoates | jdaviescoates | josef@xxx.xxx | 2022-08-09 16:00:53 | administrator | | 217402543 | josef | josef | josef@xxx.xxx | 2022-08-09 15:59:24 | administrator | +-----------+---------------+---------------+----------------------------------+---------------------+---------------+
But none of the credentials for those users work.
What's going on?!?
-
@jdaviescoates Could it be because the app was installed with LDAP enabled?
-
WP CLI to the rescue!
Solved it by opening the app web terminal and doing this:
wp cache flush
Then I could login again!
Now to start again with a clean slate in case my tinkering has left a mess
Edit: turns out it wasn't just flushing the cache that that fixed it! Seems I had to use the reset password tool first and then flush the cache and then login using that new login in a private browsing tab, and then I could login and then I was away.
So, basically what resolved this was:
- using the resetpass.php tool to reset the admin user pw to
servmask
- flushing the cache using wp cli i.e. type
wp cache flush
into the app web terminal - login in an incognito/ private tab using the credentials from the resetpass.php tool
- editing/ updating the passwords of other users (even after getting access none of the old pw worked before anymore)
- delete the resetpass.php tool
(but perhaps the suggestion by @micmc would've worked too. Edit: nope, that wouldn't have helped - the wpconfig.php files before and after migration were identical.)
- using the resetpass.php tool to reset the admin user pw to
-
-
-
@jdaviescoates You might have overwritten the wp-config.php file created by cloudron install, with the wp-config.php file in your migration file.
There's nothing to prevent you from redoing the process since you already have the migration file on hand.
So, simply scrap this install. Reinstall WordPress with Cloudron and make a backup of the wp-config.php file before migrating. Then upload and overwrite the wp-config.php file with the one created with cloudron that you've just backed up.
All should work as normally now.
-
@jdaviescoates said in Cannot login to site after migrating a wordpress.com site to Cloudron:
@micmc thanks, that might well have done it too, who knows?
Perhaps I'll give that a try at some point!
Edit: nope, that wouldn't have helped - the wpconfig.php files before and after migration were identical.
Perhaps I'll give that a try at some point!
Edit: nope, that wouldn't have helped - the wpconfig.php files before and after migration were identical.
Huh? That's just impossible mate.
You see, wp-config files holds database credentials. So when you migrate form another server, the wp migration file will carry the wp-config file with db connect credentials from that server.Now, you need to install a fresh WordPress before migrating the site, so how can the cloudron install provide the sames db connect credential as the other site had? Might have you mixed the wp-config files?
-
@micmc said in Cannot login to site after migrating a wordpress.com site to Cloudron:
That's just impossible mate.
Nah, it's simple really. Evidently the migration plugin doesn't overwrite the wpconfig.php file when it does the migration (which makes sense as like you say, that would mess with the db connection and break everything)
Anyways, I've sorted my issue by using the resetpass.php tool, using wp cli to flush the cache then logging in in a private/ incognito tab, then changing the passwords of the other users and changing the one that was changed by resetpass.php back to what it was before, then deleting the resetpass.php tool
Seems the issue is somehow the migration plugin borked all the passwords.
-
-
I think I had that issue a long time ago and it was something to do with the Auth-LDAP plugin not saving the passwords in the database, and so if that plugin gets disabled then we can't login 'offline'. The WP CLI will be the best way to work around it I think, as it seems you did already also with the password reset tool too!