[英]SWAG_MIGRATION_RUN_EXCEPTION in logs while migrating from shopware5 to shopware6
PHP Version: 8.1 PHP 版本: 8.1
Shopware Version: 6.4.13商店软件版本: 6.4.13
Expected behaviour: Data migrated successfully and visible in the backend/frontend.预期行为:数据成功迁移并在后端/前端可见。
Actual behaviour: Migrated data doesn't appear to visible in backend/frontend and there are errors within the logs.实际行为:迁移的数据在后端/前端中似乎不可见,并且日志中存在错误。
How to reproduce: I am trying to migrate from shopware 5.7 with demo-data to shopware 6.4 in my local development environment within a virtual environment.如何重现:我正在尝试在虚拟环境中的本地开发环境中从带有演示数据的 shopware 5.7 迁移到 shopware 6.4。 I had followed all instructions mentioned in the site https://docs.shopware.com/en/migration-en/Migrationprocess?category=migration-en/shopware5 I had used local gateway setup for this.
我已按照站点https://docs.shopware.com/en/migration-en/Migrationprocess?category=migration-en/shopware5中提到的所有说明进行操作,为此我使用了本地网关设置。
Although the status of migration is 'success'.虽然迁移的状态是“成功”。 No migrated data is visible in backend of shopware 6.4 and there are errors within the logs in migration process.
在 shopware 6.4 的后端看不到迁移的数据,并且迁移过程中的日志中有错误。 I have attached a log for reference.
我附上了一个日志供参考。
Error Log:错误日志:
[error] SWAG_MIGRATION_RUN_EXCEPTION
An exception occurred
Entity: language, sourceId: -
SwagMigrationAssistant\Migration\Logging\Log\ExceptionRunLog::__construct(): Argument #4 ($sourceId) must be of type ?string, int given, called in /var/www/webdev/shopware56/custom/plugins/SwagMigrationAssistant/Migration/Service/MigrationDataConverter.php on line 144
[error] SWAG_MIGRATION_RUN_EXCEPTION
An exception occurred
Entity: category, sourceId: -
SwagMigrationAssistant\Profile\Shopware\Converter\ShopwareConverter::getSourceIdentifier(): Return value must be of type string, int returned
[error] SWAG_MIGRATION_RUN_EXCEPTION
An exception occurred
Entity: customer_group, sourceId: -
SwagMigrationAssistant\Profile\Shopware\Converter\ShopwareConverter::getSourceIdentifier(): Return value must be of type string, int returned
[error] SWAG_MIGRATION_RUN_EXCEPTION
An exception occurred
Entity: sales_channel, sourceId: -
SwagMigrationAssistant\Profile\Shopware\Converter\ShopwareConverter::getSourceIdentifier(): Return value must be of type string, int returned
The cause of your problem is the use of PHP 8.1 on the Shopware 5 system.您的问题的原因是在 Shopware 5 系统上使用了 PHP 8.1。
Since PHP 8.1, the data for a SELECT is no longer returned as PHP strings by default, but now has correct data types such as integer or float. Since PHP 8.1, the data for a SELECT is no longer returned as PHP strings by default, but now has correct data types such as integer or float. See https://www.php.net/manual/de/migration81.incompatible.php#migration81.incompatible.pdo
见https://www.php.net/manual/de/migration81.incompatible.php#migration81.incompatible.pdo
As a workaround, you could downgrade to PHP 8.0 or add the following to your config.php
in Shopware 5:作为一种解决方法,您可以降级到 PHP 8.0 或将以下内容添加到
config.php
5 中的 config.php 中:
...
'db' => [
'username' => '<your-credentials>',
'password' => '<your-credentials>',
'dbname' => '<your-db-name>',
'host' => '<your-host>',
'driverOptions' => [
\PDO::ATTR_STRINGIFY_FETCHES => true,
],
],
...
With Shopware 5.7.15 this will be the default setting.对于 Shopware 5.7.15,这将是默认设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.