Page 1 of 1

Help! How to re-active okmAdmin account?

Posted: Thu Aug 29, 2019 12:58 am
by lotwan
I made a catastrophic mistake, de-active all users include okmAdmin. So can not login anymore, :(
It is embeded database HSQL, How to re-active okmAdmin or add a new ROLE_ADMIN user.
Any one could help me. Thanks very much!!
Version openKM 6.3.1.

Re: Help! How to re-active okmAdmin account?

Posted: Sat Aug 31, 2019 9:27 am
by jllort
I encourage you to export all the repository into a standard database like MySQL it is a very bad idea having into an embedded one like HSQL ( If the hardware shutdown incorrectly, might damage the database and then you will discover is not possible to recover anything ).

Well, let's go with the steps to recovering. First understanding HSQL only allow a single connection, that means when you have OpenKM started and connected to HSQL you are not allowed to set another connection. Than means, OpenKM must be stopped.
1- stop OpenKM
2- in the conf/server.xml you have the JDBC URL connection data
3- use a database client to connect with database
Like datastudio ( http://www.aquafold.com/aquadatastudio.html ) or into your tomcatXXX/lib folder you have the file name hsqldb.jar go ( open a terminal, and from the command line execute "java -jar hsqldb.jar" -> will be shown the client.

When you succeed on it, you might be interested in updating the OKM_USERS table.

Finally, that is a good time for planning migration to MySQL.

Re: Help! How to re-active okmAdmin account?

Posted: Wed Sep 04, 2019 1:19 am
by lotwan
Thanks very much, I'll try.

Re: Help! How to re-active okmAdmin account?

Posted: Sat Sep 07, 2019 10:18 am
by lotwan
Dear Jllort,
need you help.
after java -jar hsqldb.jar, open the client, but don't how to do next.
Could you teach me step by step? Thanks a lot.
1.png
2
2.png
1

Re: Help! How to re-active okmAdmin account?

Posted: Sat Sep 07, 2019 10:27 am
by jllort
HSQL Engine sure is not in memory must be a file system location. Change the option to set the file system location.

I suggest a backup before continuing to lose data prevention.

Re: Help! How to re-active okmAdmin account?

Posted: Wed Sep 11, 2019 9:42 am
by lotwan
Dear Jllort,
I use another clicent SQL Workbench open the table OKM_USER.
Then modify the USR_ACTIVE from F to T. And also add a new user wan.
1.png
2.png
But can not work.
3.png
I test these step at another PC with a new openKM server, it can work normaly, can login in.
Could giev some tip? What should I do next?
Thanks again.

Re: Help! How to re-active okmAdmin account?

Posted: Thu Sep 12, 2019 6:52 am
by jllort
If you updated the column active to "T" in the OKM_USERS TABLE should not be any reason why you are not able to login, if this is the only think you have changed.

Default okmAdmin password in database is "21232f297a57a5a743894a0e4a801fc3" what seems is your case, ensure you do not have extra spaces etc...

Your OpenKM.xml should have:

Code: Select all

<!-- Security configuration -->
  <security:authentication-manager alias="authenticationManager">
    <security:authentication-provider>
      <security:password-encoder hash="md5"/>
      <security:jdbc-user-service 
        data-source-ref="dataSource"
        users-by-username-query="select usr_id, usr_password, 1 from OKM_USER where usr_id=? and usr_active='T'"
        authorities-by-username-query="select ur_user, ur_role from OKM_USER_ROLE where ur_user=?"/>
    </security:authentication-provider>
  </security:authentication-manager>