Steps to upgrade the build from Single Tenant to SureMDM Hub (v6.43 to the latest)


Prerequisite


On-Premise build (v6.43 or later) should have already deployed in single tenant.


To upgrade the build from single tenant to SureMDM Hub, follow these steps:

1.  Follow the steps under SureMDM Hub Configuration section.

2.  Run the below-mentioned query in SQL database to convert single tenant to SureMDM Hub instance.

     INSERT INTO userdetail (

user_id_userdetail, password_userdetail, first_name_userdetail, 

email_userdetail, phone_num_userdetail, user_type_userdetail,  

customer_id_userdetail, licenseagreementaccepted_userdetail, is_sso_userdetail) 

VALUES  (

'1_auto_generated_user', REPLACE(newid(),'-',''), 'User', 

'sso#1' , '0', '0', 

'1', '1', '0')

GO


UPDATE UD2

SET UD2.userpermissionroleid_userdetail = UD1.userpermissionroleid_userdetail,

UD2.jobpermissiontemplateid_userdetail = UD1.jobpermissiontemplateid_userdetail,

UD2.grouppermissiontemplateid_userdetail = UD1.grouppermissiontemplateid_userdetail

FROM userdetail UD1

INNER JOIN userdetail UD2 ON (UD1.customer_id_userdetail = UD2.customer_id_userdetail)

WHERE UD2.user_id_userdetail = '1_auto_generated_user' 

AND UD2.customer_id_userdetail = '1'

AND UD1.user_id_userdetail = '<UserID of Customer ID = 1>';


      Note: <UserID of Customer ID = 1> has to be replaced with the user name whose Account ID is 1. 

3.  Assign the license of SureMDM Hub key to convert single tenant to SureMDM Hub instance.