0

I just changed the host of my personal website, which is run using WordPress. I took a backup of my MySQL database before migration and uploaded the same backup to my new database. The website displays properly, but I can't log in. It does not detect my old username and password, and when I request for a new password through the "forgot password?" section, I encounter this error:

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.

How can I fix this error? I tried the solution in this list, but none of them worked: https://wwwi.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/

I use DirectAdmin, by the way.

2
  • URL is the same? Database type AND version is the same?
    – Pat_Morita
    Commented Apr 9, 2019 at 21:44
  • URL is the same but I'm not sure about the database type and version. How can I check that? Could it be about database privileges?
    – mghaffari
    Commented Apr 9, 2019 at 22:01

1 Answer 1

0

At the place, create a database (with the same name if you wish) and give it the same credentials as the database at the old place. Create a user (with the old credentials) and assign it to the new (empty) database. Then use phpMyAdmin to import your old database into the newly created (but empty) database.

Look at the database user name to make sure all is correct (it might have a slightly different prefix to the user name or database).

Then make sure that your wp-config.php file has the proper credentials (which might be slightly different due to naming conventions at the new place).

Make sure the wp-config table has the proper URL for your new place. And make sure that DNS for your new place is set properly for your domain name. (A CMD prompt where you type in NSLOOKUP example.com should give you the IP address of the new place. If it doesn't, clear your local DNS cache with a IPCONFIG /FLUSHDNS command.)

At that point, assuming that you have copied all of your WP files (core, theme, plugins), you should be able to access. Double-check your wp-config.php file to ensure proper credentials and database names (with any variation in naming the database/user).

2
  • Thanks, Rick. The website loads properly but I still have the same problem for logging in and requesting a new password. Could it be, in any way, related to this fact that the website hosting the DirectAdmin panel and the prefix of databases has changed (I enter the new, correct credentials in the wp-config file, of course, and it seems to work properly apart from that login function, as I said)?
    – mghaffari
    Commented Apr 10, 2019 at 8:14
  • If the database prefix has changed, this article might help: wpbeginner.com/wp-tutorials/… . (Although the reason to do that is 'security by obscurity', and that isn't really security.) There are changes that need to be made in several places. You'll need access to phpMyAdmin, and make a database backup first for safety. And the process is not easy... Commented Apr 10, 2019 at 18:09

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.