private void migrateKeyValueEntries(final OffHeapRefDataLoader destStoreLoader,
                                        final BatchingWriteTxn destBatchingWriteTxn,
                                        final Txn<ByteBuffer> readTxn,
                                        final MapDefinition mapDefinition,
                                        final UID mapUid) {
        LOGGER.debug("Migrating Key/Value entries for {}, {}", mapDefinition, migrationState);
        // Loop over all KV entries for this map name in this stream
        updateTaskContextInfoSupplier("Migrating key/value entries");
        keyValueStoreDb.forEachEntryAsBytes(readTxn, mapUid, keyValBuffers -> {
            final ByteBuffer keyValueStoreKeyBuffer = keyValBuffers.key();
            final ByteBuffer valueStoreKeyBuffer = keyValBuffers.val();

            final Byte typeId = valueStore.getTypeId(readTxn, valueStoreKeyBuffer);
            Objects.requireNonNull(typeId, "Every entry should have a corresponding value meta");
            final ByteBuffer refDataValueBuffer = valueStore.getAsBytes(readTxn, valueStoreKeyBuffer)
                    .orElseThrow(() -> new RuntimeException(
                            "Every entry should have a corresponding value"));

            destStoreLoader.migrateKeyEntry(
                    destBatchingWriteTxn,
                    mapDefinition,
                    keyValueStoreKeyBuffer,
                    typeId,
                    refDataValueBuffer);
            migrationState.entriesMigrated.incrementAndGet();
            destBatchingWriteTxn.commitIfRequired();
        });
        LOGGER.debug("Migrated Key/Value entries for {}, {}", mapDefinition, migrationState);
    }
Migrate the data for refStreamId into destinationStore
stroom-pipeline/src/main/java/stroom/pipeline/refdata/store/offheapstore/StoreMigrator.java