public void migrateIfNeeded( DatabaseLayout layout ) { DatabaseLayout migrationStructure = DatabaseLayout.of( layout.databaseDirectory(), MIGRATION_DIRECTORY ); cleanupLegacyLeftOverDirsIn( layout.databaseDirectory() ); File migrationStateFile = migrationStructure.file( MIGRATION_STATUS_FILE ); // if migration directory exists than we might have failed to move files into the store dir so do it again if ( upgradableDatabase.hasCurrentVersion( layout ) && !fileSystem.fileExists( migrationStateFile ) ) { // No migration needed return; } if ( isUpgradeAllowed() ) { migrateStore( layout, migrationStructure, migrationStateFile ); } else if ( !RecordFormatSelector.isStoreAndConfigFormatsCompatible( config, layout, fileSystem, pageCache, logProvider ) ) { throw new UpgradeNotAllowedByConfigurationException(); } }
public void migrateIfNeeded( DatabaseLayout layout ) { DatabaseLayout migrationStructure = DatabaseLayout.of( layout.databaseDirectory(), MIGRATION_DIRECTORY ); cleanupLegacyLeftOverDirsIn( layout.databaseDirectory() ); File migrationStateFile = migrationStructure.file( MIGRATION_STATUS_FILE ); // if migration directory exists than we might have failed to move files into the store dir so do it again if ( upgradableDatabase.hasCurrentVersion( layout ) && !fileSystem.fileExists( migrationStateFile ) ) { // No migration needed return; } if ( isUpgradeAllowed() ) { migrateStore( layout, migrationStructure, migrationStateFile ); } else if ( !RecordFormatSelector.isStoreAndConfigFormatsCompatible( config, layout, fileSystem, pageCache, logProvider ) ) { throw new UpgradeNotAllowedByConfigurationException(); } }