$this->progress =
$this->io->
createProgressBar(\
count($keys));
$this->progress->
setFormat("<info>[%message%]</info>\n%current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%"
);
$this->progress->
setMessage('Migrating carts from Redis to SQL'
);
$queue =
new MultiInsertQueryQueue($this->connection, 50, false, true
);
// @deprecated tag:v6.6.0 - payload always exists
$payloadExists = EntityDefinitionQueryHelper::
columnExists($this->connection, 'cart', 'payload'
);
foreach ($keys as $index =>
$key) { if (\
method_exists($this->redis, '_prefix'
)) { $key = \
substr((string) $key, \
strlen($this->redis->
_prefix(''
)));
} $value =
$this->redis->
get($key);
if (!\
is_string($value)) { continue;
} $value = \
unserialize($value);
if (!\
array_key_exists('sales_channel_id',
$value)) { $this->io->
writeln('<error>Sales channel id is missing for key ' .
$key . '. Carts created before 6.4.12 can not be migrated</error>'
);