Recover admin password and email Odoo server
Asked Answered
M

2

9

Months ago, I installed an Odoo server and it worked perfectly !

Problem is that I forgot the identification (email/pass) for the admin, wich is real bad. After uninstalling the server and reinstalling it I found out that the database was not wiped. So it didn't change at all !

Please, can anyone help me finding the admin's email and password ?

I'm not very familiar with progresql but res_users displays empty passwords:

enter image description here

Modulation answered 18/12, 2014 at 23:1 Comment(0)
A
13

You may change admin password using progresql from the terminal. You just need to do like these

odoo@odedra:~$ psql testing_db
psql (9.1.14)
Type "help" for help.

testing_db=# UPDATE res_users SET password='new_password' WHERE login = 'admin';
UPDATE 1

where testing_db is database name.

Now login with new password and change user details whatever you want.

Alleras answered 19/12, 2014 at 6:10 Comment(2)
password column becomes empty when we install auth_crypt module also. so updating password with new_password will not workCalcutta
You need to update the password_crypt filed in the database with the crypt of the password. Just updateding the plaintext password field won't workAmphora
E
7

You need to generate password with pbkdf2_sha512 hashing algorithm. Then update the record id = 1 with password_crypt field not password.

For example:

  • Generating hash from python code:

    from passlib.context import CryptContext

    print CryptContext(['pbkdf2_sha512']).encrypt('<PASSOWORD>')

  • Then:

    update res_users set password='' ,password_crypt='<HASH>' where id = <ID>;

Replace , with the generated output from the script and designated id.

Eyestrain answered 28/3, 2016 at 19:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.