Transferring User’s Password between Sitecore Instances


Today I am going to share a method provided by Sitecore for transferring the user’s password between Sitecore instances.

Recently we are migrating from Sitecore XP to Sitecore XM where there are very few changes in Core DB, but the users count is very high. So instead of using the XP Core DB backup, we decided to move all the users to XM Core DB.

You can transfer the user's account either by using Sitecore packages or by serializing the user's accounts on one instance and de-serializing them on another instance.

However, after performing these actions, all the transferred users will have their passwords set either to a random value (when using Sitecore packages), or to the default value "b" (when using the serialization process).

The reason behind this is that Sitecore stores user passwords in the hashed format and their original values cannot be retrieved from the database via the standard membership API. Hence, they cannot be properly moved to another storage when generating Sitecore packages or performing the serialization process.

Therefore, after moving the user's account, it might be required to manually reset the user’s password. When transferring a large number of users, this approach could be tedious and unacceptable because user passwords must remain unchanged.

So, for this reason, Sitecore provides a solution for transferring the user’s password.

It is possible to migrate passwords of the previously transferred user accounts using a solution provided below:

Note: IMPORTANT! Back up your databases in case anything goes wrong.

Step 1: Copy the TransferUserPasswords.aspx file to the \sitecore\admin folder of your Sitecore Instance. The link to download the TransferUserPasswords file is https://support.sitecore.com/sys_attachment.do?sys_id=cbcde25b1b3aa0d0e55241dde54bcbe2

Step 2: After copying the file request the .aspx page using the URL <hostname>/sitecore/admin/TransferUserPasswords.aspx


Step 3: Enter the connection strings of the source and target Core DB using appropriate text boxes.

Step 4: Click the “Refresh” button to get the list of users that exist in both Core DBs.

Step 5: Use the <<< and >>> buttons to select or deselect users for password transferring.

Step 6: Click the "Transfer" button after choosing the users whose passwords you want to transmit.

After performing all these steps, the passwords of the selected users will be transferred to the target Core DB.

Note: This solution applies only to the default SQL Membership Provider provided used by Sitecore.

References

Chirag Goel

I am a developer, likes to work on different future technologies.

Post a Comment (0)
Previous Post Next Post