code: void migrateUser(Node oldUserNode) throws Exception
     {
  
        String userName = oldUserNode.getName();
  
        if (findUserByName(userName, UserStatus.ANY) != null)
        {
           removeUser(userName, false);
        }
  
        UserImpl user = readUser(oldUserNode);
        createUser(user, false);
     }
docs: Method for user migration.
  
  @param oldUserNode
  the node where user properties are stored (from old structure)
  @throws Exception