Help! How to re-active okmAdmin account?

OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
lotwan
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Wed Aug 28, 2019 9:41 am

Help! How to re-active okmAdmin account?

Post by lotwan » Thu Aug 29, 2019 12:58 am

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.

jllort
Moderator
Moderator
Posts: 10907
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

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

Post by jllort » Sat Aug 31, 2019 9:27 am

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.

lotwan
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Wed Aug 28, 2019 9:41 am

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

Post by lotwan » Wed Sep 04, 2019 1:19 am

Thanks very much, I'll try.

lotwan
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Wed Aug 28, 2019 9:41 am

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

Post by lotwan » Sat Sep 07, 2019 10:18 am

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

jllort
Moderator
Moderator
Posts: 10907
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

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

Post by jllort » Sat Sep 07, 2019 10:27 am

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.

lotwan
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: Wed Aug 28, 2019 9:41 am

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

Post by lotwan » Wed Sep 11, 2019 9:42 am

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.

jllort
Moderator
Moderator
Posts: 10907
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

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

Post by jllort » Thu Sep 12, 2019 6:52 am

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>

Post Reply