Magento-具有正确产品数据的产品页面404

问题描述 投票:0回答:1

我在使用Magento数据导入时遇到了一个奇怪的问题,想知道是否还有其他人遇到过这个问题,并且可能找到了一种解决方案来帮助诊断问题。

我使用Magento数据迁移工具将数据从Magento 1实例迁移到现有的Magento 2实例。 Magento 2实例已经有一些数据,所以这并不是所有内容的最新副本,我分阶段进行,首先仅是订单,然后是客户,最后是产品和类别。我忽略了需要保留的CMS块和页面以及主题和其他一些设置和问题(因此,我只运行migration:data)。

用于数据迁移的我的配置文件如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
        xs:noNamespaceSchemaLocation="urn:magento:module:Magento_DataMigrationTool:etc/config.xsd">
    <steps mode="data">
        <step title="Data Integrity Step">
            <integrity>Migration\Step\DataIntegrity\Integrity</integrity>
        </step>
        <step title="EAV Step">
            <integrity>Migration\Step\Eav\Integrity</integrity>
            <data>Migration\Step\Eav\Data</data>
            <volume>Migration\Step\Eav\Volume</volume>
        </step>
        <step title="Map Step">
            <integrity>Migration\Step\Map\Integrity</integrity>
            <data>Migration\Step\Map\Data</data>
            <volume>Migration\Step\Map\Volume</volume>
        </step>
        <step title="Url Rewrite Step">
            <integrity>Migration\Step\UrlRewrite\Version191to2000</integrity>
            <data>Migration\Step\UrlRewrite\Version191to2000</data>
            <volume>Migration\Step\UrlRewrite\Version191to2000</volume>
        </step>
        <step title="ConfigurablePrices step">
            <integrity>Migration\Step\ConfigurablePrices\Integrity</integrity>
            <data>Migration\Step\ConfigurablePrices\Data</data>
            <volume>Migration\Step\ConfigurablePrices\Volume</volume>
        </step>
        <step title="Inventory Step">
            <integrity>Migration\Step\Inventory\Integrity</integrity>
            <data>Migration\Step\Inventory\Data</data>
            <volume>Migration\Step\Inventory\Volume</volume>
        </step>
        <step title="PostProcessing Step">
            <data>Migration\Step\PostProcessing\Data</data>
        </step>
    </steps>
    <steps mode="delta">
        <step title="Map Step">
            <delta>Migration\Step\Map\Delta</delta>
            <volume>Migration\Step\Map\Volume</volume>
        </step>
        <step title="ConfigurablePrices step">
            <delta>Migration\Step\ConfigurablePrices\Delta</delta>
            <volume>Migration\Step\ConfigurablePrices\Volume</volume>
        </step>
        <step title="Url Rewrite Step">
            <delta>Migration\Step\UrlRewrite\Version191to2000Delta</delta>
            <volume>Migration\Step\UrlRewrite\Version191to2000</volume>
        </step>
        <step title="Inventory Step">
            <delta>Migration\Step\Inventory\Delta</delta>
            <volume>Migration\Step\Inventory\Volume</volume>
        </step>
    </steps>
    <source>...</source>
    <destination>...</destination>
    <options>...</options>
</config>

产品和类别数据已安全复制,我可以在数据库和管理员中看到它们。 URL重写也可以正常工作。但是,在某些(但不是全部)产品页面上,它显示除名称之外的几乎所有产品数据,但页面标题是404,并且在所有产品数据下方显示404布局和404内容(参见图片)[ C0]。

因此,与大多数产品页面都在404页上运行的问题不同,我知道这不是URL重写问题(如果我使用绝对的Magento路径而不是URL重写路径,也会发生这种情况)。我之前曾在另一项数据导入测试中发生过这种情况,当我查看数据库时,有一些产品分配给不再存在的旧属性集,因此我删除了它们,重新索引并清除了缓存并对其进行了修复。

我已经审查并确认分配给产品的所有属性集都是正确的。我已经重新索引,清除了缓存多次。这修复了一些产品,但不是大多数。我认为这是由于与产品有关的数据库中的一些不正确/损坏的数据而发生的,但是我不知道如何诊断在哪里/在哪里看。我无法擦除所有内容并重新安装,因为我们需要保留一些数据。

以前有没有人遇到过这个问题,也许找到了解决方案或一种很好的方法来弄清楚是什么不良数据导致了这种情况?

magento magento2 magento-1.9 data-migration data-import
1个回答
0
投票

对于可能遇到此问题的其他人,我想出了这个问题。在数据迁移中,我介绍了类别,产品和URL重写。 URL重写是通过正确的请求路径进行的,但是它们的ID不同,因此以某种方式破坏了Magento路径,并且页面全部为404。

[当我进入产品时,将URL密钥更改为其他名称,然后再将其更改回,它重新生成了在Magento中正确链接的正确URL重写,并且该页面无需404ing就可以工作。

这非常令人沮丧,特别是因为在Magento 2中,没有内置的方法来重新生成产品url重写。您必须手动删除所有URL重写和更新并重新保存产品,以正确地重新生成它们。有趣的是,我在另一个项目中执行了此操作,其中URL重写正确复制并可以正常工作。我在此次迁移中验证了url_rewrite表是清楚的,并且所有值均已导入,因此该特定项目上的原始Magento 1 url_rewrite内容可能存在导致此问题的问题。

© www.soinside.com 2019 - 2024. All rights reserved.