Change KanBo user login or display name

In order to change User's login or user's display name, the following steps need to be completed.


Important!
Please back up all KanBo databases on which you perform changes before executing any queries described here (KanBo Instances, Profiles and Content databases).

Backuping KanBo databases in SQL Server Management Studio.


1. Open Microsoft SQL Server Management Studio and look for the Content Database in KanBo.

Right-click on the database and select New Query.




2. Declare the following variables:


declare @from nvarchar(max) = 'NameSurname'; - The user's name you would like to change.
declare @to nvarchar(max) = 'NameSurname'; - The new user's name in the format NameSurname
declare @to_name nvarchar(max) = 'Name Surname'; -The new user's name in the format Name Surnname.


i.e.

declare @from nvarchar(max) = 'adrianjohnson';
declare @to nvarchar(max) = 'adriansmith';
declare @to_name nvarchar(max) = 'Adrian Smith';




3. Enter the following script in all Content Databases in KanBo and execute it.


begin tran;
update LoginNames SET Name = REPLACE(Name, @from, @to) OUTPUT inserted.* where Name LIKE '%' + @from + '%';
update Users SET Name = @to_name, ProfileKey = REPLACE(ProfileKey, @from, @to) OUTPUT inserted.* where ProfileKey LIKE '%' + @from + '%';
commit;

If the script shows you good results, please change rollback; to commit; and execute the script once again.






4.Enter the KanBo Profiles Database, click on the right button of your mouse and select New Query.




5.Declare the same variables as in the steps earlier with the script and execute it.


declare @from nvarchar(max) = 'adrianjohnson';
declare @to nvarchar(max) = 'adriansmith';
declare @to_name nvarchar(max) = 'Adrian Smith';
begin tran;
update Profiles SET ProfileKey = REPLACE(ProfileKey, @from, @to) OUTPUT inserted.* where ProfileKey LIKE '%' + @from + '%';
commit;

If the script shows you good results, please change rollback; to commit; and execute the script once again.



Please refresh KanBo on IIS after the procedure on databases is completed. Now you will be able to enter KanBo.

Is this article helpful for you?