DirectRecordStoreMigrator migrator = new DirectRecordStoreMigrator( pageCache, fileSystem, config ); migrator.migrate( sourceDirectoryStructure, oldFormat, migrationStrcuture, newFormat, progressReporter, storesToMigrate, StoreType.NODE );
public void migrate( DatabaseLayout fromDirectoryStructure, RecordFormats fromFormat, DatabaseLayout toDirectoryStructure, RecordFormats toFormat, ProgressReporter progressReporter, StoreType[] types, StoreType... additionalTypesToOpen ) { StoreType[] storesToOpen = ArrayUtil.concat( types, additionalTypesToOpen ); progressReporter.start( storesToOpen.length ); try ( NeoStores fromStores = new StoreFactory( fromDirectoryStructure, config, new DefaultIdGeneratorFactory( fs ), pageCache, fs, fromFormat, NullLogProvider.getInstance(), EmptyVersionContextSupplier.EMPTY ) .openNeoStores( true, storesToOpen ); NeoStores toStores = new StoreFactory( toDirectoryStructure, withPersistedStoreHeadersAsConfigFrom( fromStores, storesToOpen ), new DefaultIdGeneratorFactory( fs ), pageCache, fs, toFormat, NullLogProvider.getInstance(), EmptyVersionContextSupplier.EMPTY ) .openNeoStores( true, storesToOpen ) ) { for ( StoreType type : types ) { // This condition will exclude counts store first and foremost. if ( type.isRecordStore() ) { migrate( fromStores.getRecordStore( type ), toStores.getRecordStore( type ) ); progressReporter.progress( 1 ); } } } }
public void migrate( DatabaseLayout fromDirectoryStructure, RecordFormats fromFormat, DatabaseLayout toDirectoryStructure, RecordFormats toFormat, ProgressReporter progressReporter, StoreType[] types, StoreType... additionalTypesToOpen ) { StoreType[] storesToOpen = ArrayUtil.concat( types, additionalTypesToOpen ); progressReporter.start( storesToOpen.length ); try ( NeoStores fromStores = new StoreFactory( fromDirectoryStructure, config, new DefaultIdGeneratorFactory( fs ), pageCache, fs, fromFormat, NullLogProvider.getInstance(), EmptyVersionContextSupplier.EMPTY ) .openNeoStores( true, storesToOpen ); NeoStores toStores = new StoreFactory( toDirectoryStructure, withPersistedStoreHeadersAsConfigFrom( fromStores, storesToOpen ), new DefaultIdGeneratorFactory( fs ), pageCache, fs, toFormat, NullLogProvider.getInstance(), EmptyVersionContextSupplier.EMPTY ) .openNeoStores( true, storesToOpen ) ) { for ( StoreType type : types ) { // This condition will exclude counts store first and foremost. if ( type.isRecordStore() ) { migrate( fromStores.getRecordStore( type ), toStores.getRecordStore( type ) ); progressReporter.progress( 1 ); } } } }
DirectRecordStoreMigrator migrator = new DirectRecordStoreMigrator( pageCache, fileSystem, config ); migrator.migrate( sourceDirectoryStructure, oldFormat, migrationStrcuture, newFormat, progressReporter, storesToMigrate, StoreType.NODE );