How to reactivate the deleted user account from the database?

In situations, if you have mistakenly deactivated/deleted the user account from the UI and wish to reactivate the user back, follow the below steps to reactivate the user from the database.

  1. sudo su -
  2. Login to mysql docker
    • docker ps
    • docker exec -it qmetry_rds_1 bash
  3. Login to mysql and run the below query
    • mysql -uroot -p[password] 
    • USE qmetry;
    • Execute the below query by replacing the user name in the `loginId` column to reactivate the deleted user account in the UI.

      update user set isPasswordExpired =0 , isDeleted =0 , isActive = 1,
      initialPasswordChanged = 1, isPasswordReset = 0,lastPasswordUpdatedDate = null
      where loginId = 'USERNAME' limit 1;
    • \q (to exit mysql)
  4.  Type exit to exit the docker container.


Steps to follow (after reactivating the user) :

(Important) You need to follow the below steps after reactivating the deleted user account from the database :

  • In QMetry UI, go to Customization > Users > `search for the reactivated user account` > Edit 
    • You will notice the user alias, and email appears renamed with Alias[X], Email[X] in the UI. 
    • Update the Alias and Email field by removing [X] from these fields and update the details.
  • You need to assign the project/role access again for the user account to be able to login to QMetry as the project/role access gets removed upon delete.


Note :
 We recommend not to delete a user from QMetry either from the frontend or backend unless it is required. The users which are not needed can be simply deactivated from the UI. Deactivated users do not count against the license.