Admin Password Reset

Hello everyone,

I’m having a bit of an issue with a restored Dolibarr backup file. I restored the backup using Docker, but now I’m unable to log in as “Admin”. I’ve tried changing the password using the method described in the forum How to reset the password in dolibar admin account but it doesn’t seem to work.

Here’s what I’ve done so far:

  1. I located the 'pass' and 'pass_crypted' fields in the backup file.
  2. I changed the values to 'NEWPASSWORD' and '' respectively.
  3. I attempted to log in using the new password, but I was still unable to access the system.

Additional information:

  • LDAP was enabled on the system before I created the backup, but I disabled it before restoring the backup.
  • I’ve tested the new password without LDAP enabled, and it works fine.
  • I’m also unable to log in using other user accounts and their respective passwords.

I’m at a loss here. Any help or suggestions would be greatly appreciated.

Thank you,

@zunami did you re-enable LDAP?

no i have not reactivated it and it will not be activated again.

but i just discovered in the backup file that its kind of ldap connection can still be there. i had a yunohost server before

(54,'LDAP_GROUP_DN',1,'ou=groups,dc=example,dc=com','chaine',0,NULL,'2022-03-22 18:53:09'),
(56,'LDAP_FIELD_LOGIN',1,'uid','chaine',0,NULL,'2022-03-22 18:53:09'),
(57,'LDAP_FIELD_FULLNAME',1,'cn','chaine',0,NULL,'2022-03-22 18:53:09'),
(58,'LDAP_FIELD_NAME',1,'sn','chaine',0,NULL,'2022-03-22 18:53:09'),
(59,'LDAP_FIELD_FIRSTNAME',1,'givenname','chaine',0,NULL,'2022-03-22 18:53:09'),
(60,'LDAP_FIELD_MAIL',1,'mail','chaine',0,NULL,'2022-03-22 18:53:09'),
(61,'LDAP_FIELD_PHONE',1,'telephonenumber','chaine',0,NULL,'2022-03-22 18:53:09'),
(62,'LDAP_FIELD_FAX',1,'facsimiletelephonenumber','chaine',0,NULL,'2022-03-22 18:53:09'),
(63,'LDAP_FIELD_MOBILE',1,'mobile','chaine',0,NULL,'2022-03-22 18:53:09'),
(64,'LDAP_GROUP_FILTER',1,'&(objectClass=groupOfNames)','chaine',0,NULL,'2022-03-22 18:53:09'),
(66,'LDAP_SERVER_TYPE',1,'openldap','chaine',1,NULL,'2022-03-22 18:53:09'),
(67,'LDAP_SERVER_PROTOCOLVERSION',1,'3','chaine',1,NULL,'2022-03-22 18:53:09'),
(68,'LDAP_SERVER_HOST',1,'localhost','chaine',1,NULL,'2022-03-22 18:53:09'),
(69,'LDAP_SERVER_PORT',1,'389','chaine',1,NULL,'2022-03-22 18:53:09'),
(70,'LDAP_SERVER_DN',1,'ou=users,dc=yunohost,dc=org','chaine',1,NULL,'2022-03-22 18:53:09'),
(71,'LDAP_USER_DN',1,'ou=users,dc=yunohost,dc=org','chaine',1,NULL,'2022-03-22 18:53:09'),
(72,'LDAP_USER_OBJECT_CLASS',1,'organizationalUnit,top','chaine',1,NULL,'2022-03-22 18:53:09'),
(73,'LDAP_FILTER_CONNECTION',1,'&(objectClass=posixAccount)','chaine',1,NULL,'2022-03-22 18:53:09'),
(74,'LDAP_SYNCHRO_ACTIVE',1,'ldap2dolibarr','chaine',1,NULL,'2022-03-22 18:53:09'),

what should be in there if i don’t want to connect anymore?

@zunami do you have an API key that works?

Maybe you can create a new user using the API key

@zunami I am also thinking that if you create another dolibarr installation, and then you look in that’s database for the pass and pass_crypted and insert that into your broken dolibarr?

Or you go the other way and replace everything else from the old backup except for the users table?

I don’t understand what you mean by that?

i have now tried to restore the backup file again, but this time i have turned everything from 1 to 0

(70,‘LDAP_SERVER_DN’,0,‘ou=users,dc=yunohost,dc=org’,‘chaine’,1,NULL,‘2022-03-22 18:53:09’),

now I get this message in the console because I changed the password in the backupfile

here was ‘pass’ before
ERROR 1054 (42S22) at line 12710: Unknown column ‘NEWPASSWORD’ in ‘field list’

good, write pass again and let the the corresponding field be empty aka ‘’ or “” or ||, …

i’m desperate because it’s such a riddle. i’ve tried all possible variations now. i’ve written pass again with spaces. i always get ‘ ERROR 1054 (42S22) at line 12710: Unknown column “ ” in “field list” ’. what do i have to do to reset the admin password. is there really no better solution?

Maybe use a database editor too to view the contents?

Here is a picture from my development dolibarr installation. I redacted the pass and pass_crypted values.

My guess is that if you put stuff inside the pass column for the matching username, then you can log in, but perhaps you have to clean out the pass_crypted column.

databasefields

@jonbendtsen i would like to thank you very much, you have put me on the right track. i have been trying to change the password in the backup file all the time, but it won’t work.

SOLUTION:

  1. i changed the backupfile LDAP disabled as described from 1 to 0.
  2. I have restored the backupfile.
  3. I installed phpMyAdmin on docker and created a bridge to the dolibarr database.
  4. logged in with root.
  5. searched for llx_user
  6. I deleted what was in pass_crypted NULL (wherever this strange password comes from???)
  7. new password typed into pass
  8. rebooted dolibarr + dolibarr-db
  9. login works

THANK YOU THANK YOU THANK YOU @jonbendtsen

1 Like

@zunami I am glad it worked out for you and that you wrote such a detailed step by step guide should anyone else end up in the same situation.

It even made me think of a method to do this even if you can not install phpMyAdmin on the server where you run your Dolibarr.

  1. use the above method somewhere you can install phpMyAdmin
  2. get the new password working
  3. take a new backup that works.
  4. Build a new fresh Dolibarr installation where you could not install phpMyAdmin
  5. restore the backup to that place