No access as administrator

Good morning, I migrated an installation of OJS 2.4.8 to a new server, using backup files from the main directory and the SQL database.
The site works but the passwords do not, I cannot access my administrator account, the function “forgot your password” does not work either.
How can I recover access?

Hi @gtovar,

Quite a challenge. If you have access to the DB you can modify the administrator password directly ini the DB.

Regards, Primož

Thanks Primož! if you know how to do it, could you tell me the steps to do it?
I have access to the database, I guess it will be in the access_keys table.

Hi @gtovar,

What I have done is to copy password hash from an OJS copy I knew the password to the OJS copy I have had problems with unknown password.

Regards, Primož

Thanks Primož, if I find a solution to this I will add it here in case someone has the same problem.

Hi @gtovar,

To reset a user’s password, follow these steps:

  • Determine the user ID.
    • A user ID can be fetched from the database using one of the following SQL statements:
      • If you have an email address for the user (e.g. pkpsupport@sfu.ca): SELECT user_id FROM users WHERE email = ‘pkp-support@sfu.ca’;
      • If you have a username (e.g. admin): SELECT user_id FROM users WHERE username = ‘admin’;
  • Determine the password encryption method. See the encryption setting in the [security] section of the config.inc.php configuration file. This will be sha1 or md5.
  • Execute the following SQL to reset the password. For example, for user ID 15 with md5 encryption, to reset the password to “newPasswordHere”: UPDATE users SET password=MD5(CONCAT(username, ‘newPasswordHere’)) WHERE user_id = 15;

Kind Regards,
Patricia M.
Public Knowledge Project Team

Thanks Patricia, is it possible that the problem is with the database connection?
Should all passwords work when restoring the database?