diff --git a/src/migration/TripleStoreUserConfigurationMigration.js b/src/migration/TripleStoreUserConfigurationMigration.js index 12e9679a1..5fef04405 100644 --- a/src/migration/TripleStoreUserConfigurationMigration.js +++ b/src/migration/TripleStoreUserConfigurationMigration.js @@ -12,16 +12,24 @@ class TripleStoreUserConfigurationMigration extends BaseMigration { const userConfiguration = await this.fileService.readFile(configurationFilePath, true); - if ('tripleStore' in userConfiguration) { + if ('tripleStore' in userConfiguration.modules) { const oldConfigTripleStore = userConfiguration.modules; - const implementation = oldConfigTripleStore.implementation[0]; - const { url, username, password } = implementation.config.repositories.publicCurrent; - implementation.config.repositories.dkg = { - url, - name: 'dkg', - username, - password, - }; + for (const implementation in oldConfigTripleStore.tripleStore.implementation) { + if (oldConfigTripleStore.tripleStore.implementation[implementation].enabled) { + const { url, username, password } = + oldConfigTripleStore.tripleStore.implementation[implementation].config + .repositories.publicCurrent; + + oldConfigTripleStore.tripleStore.implementation[ + implementation + ].config.repositories.dkg = { + url, + name: 'dkg', + username, + password, + }; + } + } await this.fileService.writeContentsToFile( configurationFolderPath, diff --git a/src/migration/migration-executor.js b/src/migration/migration-executor.js index a83892690..df1897a44 100644 --- a/src/migration/migration-executor.js +++ b/src/migration/migration-executor.js @@ -1,7 +1,7 @@ import path from 'path'; import { NODE_ENVIRONMENTS } from '../constants/constants.js'; -import TripleStoreUserConfigurationMigration from './TripleStoreUserConfigurationMigration'; +import TripleStoreUserConfigurationMigration from './TripleStoreUserConfigurationMigration.js'; class MigrationExecutor { static async executeTripleStoreUserConfigurationMigration(container, logger, config) {