code: void migrate() throws RepositoryException
     {
        try
        {
           LOG.info("Migration started.");
  
           moveOldStructure();
           service.createStructure();
  
           //Migration order is important due to removal of nodes.
           migrateGroups();
           migrateMembershipTypes();
           migrateUsers();
           migrateProfiles();
           migrateMemberships();
  
           removeOldStructure();
  
           LOG.info("Migration completed.");
        }
        catch (Exception e)//NOSONAR
        {
           throw new RepositoryException("Migration failed", e);
        }
     }
docs: Method that aggregates all needed migration operations in needed order.
  @throws RepositoryException