code: private void migrateUsers() throws Exception
     {
        Session session = service.getStorageSession();
        try
        {
           if (session.itemExists(usersStorageOld))
           {
              NodeIterator iterator = ((ExtendedNode)session.getItem(usersStorageOld)).getNodesLazily();
              UserHandlerImpl uh = ((UserHandlerImpl)service.getUserHandler());
              while (iterator.hasNext())
              {
                 uh.migrateUser(iterator.nextNode());
              }
           }
        }
        finally
        {
           session.logout();
        }
     }
docs: Method for users migration.
  @throws Exception