@@ -0,0 +1,1072 @@
+/*%0A */%0Apackage org.dspace.doi;%0A%0Aimport java.util.Set;%0Aimport org.apache.log4j.Logger;%0A%0A/**%0A * Migrates DOIs from perst DOI.db file to Postgres%0A * @author Dan Leehr %3Cdan.leehr@nescent.org%3E%0A */%0Apublic class DOIMigrator %7B%0A    private static Logger log = Logger.getLogger(DOIMigrator.class);%0A%0A    public static void migrate() %7B%0A        log.info(%22Beginning migration%22);%0A        DOIDatabase perstDatabase = DOIDatabase.getInstance();%0A        PGDOIDatabase postgresDatabase = PGDOIDatabase.getInstance();%0A%0A        Set%3CDOI%3E perstDOIs = perstDatabase.getALL();%0A        for(DOI perstDOI : perstDOIs) %7B%0A            log.info(%22Migrating %22 + perstDOI.toString());%0A            DOI doi = new DOI(perstDOI.getPrefix(), perstDOI.getSuffix(), perstDOI.getInternalIdentifier());%0A            postgresDatabase.put(doi);%0A        %7D%0A        log.info(%22Finished migration%22);%0A        log.info(%22Count of DOIs in doi.db: %22 + perstDatabase.size());%0A        log.info(%22Count of DOIs in Postgres: %22 + postgresDatabase.size());%0A    %7D%0A%0A    public static void main(String args%5B%5D) %7B%0A        migrate();%0A    %7D%0A%7D%0A

Add DOIMigrator