moduleDataSetup->getConnection()->startSetup(); $connection = $this->resourceConnection->getConnection(); $table = $this->resourceConnection->getTableName('core_config_data'); $rows = $connection->fetchAll( $connection->select() ->from($table) ->where('path LIKE ?', self::OLD_PREFIX . '%') ); foreach ($rows as $row) { $newPath = self::NEW_PREFIX . substr((string)$row['path'], strlen(self::OLD_PREFIX)); $exists = $connection->fetchOne( $connection->select() ->from($table, ['config_id']) ->where('scope = ?', $row['scope']) ->where('scope_id = ?', $row['scope_id']) ->where('path = ?', $newPath) ->limit(1) ); if ($exists) { continue; } $connection->insert($table, [ 'scope' => $row['scope'], 'scope_id' => $row['scope_id'], 'path' => $newPath, 'value' => $row['value'], ]); } $this->moduleDataSetup->getConnection()->endSetup(); return $this; } public static function getDependencies(): array { return []; } public function getAliases(): array { return []; } }