Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将产品数据从opencart迁移到magento_Magento_Opencart_Data Migration_Database Migration - Fatal编程技术网

将产品数据从opencart迁移到magento

将产品数据从opencart迁移到magento,magento,opencart,data-migration,database-migration,Magento,Opencart,Data Migration,Database Migration,我有一个基于opencart的购物车网站 现在我想把它转换成一个magento网站 我重新安装了magento。现在我需要将数据从opencart数据库迁移到新的magento数据库 那么,谁能告诉我表名,并告诉我成功迁移应该做些什么 首先,谢谢 评估要导入到Magento的内容。qestion回答得越清楚,就越容易评估您的选项 基本上,这些选项包括通过内置导入导入数据(内置方式),通过自定义脚本导入数据(脚本方式),通过普通SQL导入数据(糟糕、糟糕的SQL方式),以及通过外部模块导入数据(模

我有一个基于opencart的购物车网站

现在我想把它转换成一个magento网站

我重新安装了magento。现在我需要将数据从opencart数据库迁移到新的magento数据库

那么,谁能告诉我表名,并告诉我成功迁移应该做些什么

首先,谢谢 评估要导入到Magento的内容。qestion回答得越清楚,就越容易评估您的选项

基本上,这些选项包括通过内置导入导入数据(内置方式),通过自定义脚本导入数据(脚本方式),通过普通SQL导入数据(糟糕、糟糕的SQL方式),以及通过外部模块导入数据(模块方式


内置方式 首先,您可以通过后端导入csv数据,前提是您可以将基于opencart的产品/客户置于csv格式,然后可以在后端重新导入这些数据-请参阅或(仅限产品)

这个解决方案取决于如何从OpenCart导出数据,坦率地说,我并不擅长这一点。只要您可以导出到XLS、CSV或类似文件,您就可以了

脚本方式 如果您不能做到这一点,我建议您使用Magento自己的模型编写导入脚本。让您开始学习的一个非常基本的片段:

<?php
//place this file in the Magento root, e.g. ./import.php, "." being you Magento root
//load the magento app with the admin store 
require_once('app/Mage.php');
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

//data import, I assume you can write some sort of input for this $data like reading a zip file or some other format, i here, I assume, this $data array holds arrays of products ($new_product) containing information on a product from open cart
$data = ...

// loop over the data and create the Magento models, these can include products, customers, etc. - for simplicity this is done for products, but can be done for every other data object in magento
foreach ($data as $new_product) {
    //load an empty Magento product model
    $product = Mage::getModel('catalog/product');

    //set the attributes you want
    $product->setData('sku', $new_product['sku']);
    $product->setData('name', $new_product['name']);

    .
    .
    . 
    //save it
    try {
        $product->save();
    }
    catch(Exception $e) {
        Mage::logException($e);
        continue;
    }
}

请参阅我的教程,该教程解释了如何使用magento脚本导入产品和类别

逐步解释

  • 导入属性选项
  • 导入类别magento
  • 读取CSV数据
  • 进口简单产品
  • 导入可配置产品
  • 导入产品图像
  • 添加相关产品
  • 进口级价格

  • 如果您只想导入产品和类别,请查看MAGMI。它是一个强大的导入工具,基于CSV。也支持可配置产品。