Page 1 of 1

How to import categories/catalog list?

Posted: 16 Feb 2016, 11:48
by Dan
Hi,

I want to migrate products and categories from Magento to aimeos. I did not find any way to import categories. How is data migration be intended?

Re: How to import categories/catalog list?

Posted: 16 Feb 2016, 12:18
by aimeos
Dan wrote: I want to migrate products and categories from Magento to aimeos. I did not find any way to import categories. How is data migration be intended?
How many categories does your Magento installation have?

There's currently no import for categories but it would be possible to implement one based on a XML file or to import the categories directly from the database with a setup task.

Re: How to import categories/catalog list?

Posted: 16 Feb 2016, 12:42
by Dan
Hi,

thanks a lot for your fast reply.

There are ~100 categories including sub-categories.

Is there any way to load it into the mshop_catalog table directly? I could build a simple MySQL import statement to do so. What fields are required to set?

From the Magento export I have the the ID, parent ID and name field.

Code: Select all

  `id` int(11) NOT NULL AUTO_INCREMENT,
  `parentid` int(11) NOT NULL,
  `siteid` int(11) NOT NULL,
  `level` smallint(6) NOT NULL,
  `code` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `label` varchar(255) NOT NULL,
  `config` text NOT NULL,
  `nleft` int(11) NOT NULL,
  `nright` int(11) NOT NULL,
  `status` smallint(6) NOT NULL DEFAULT '0',
  `mtime` datetime NOT NULL,
  `ctime` datetime NOT NULL,
  `editor` varchar(255) NOT NULL

Re: How to import categories/catalog list?

Posted: 16 Feb 2016, 13:01
by aimeos
It's possible to do an SQL import but it's a bit more difficult because Aimeos uses a nested set for storing the hierarchical nature of the category tree. How are the categories stored in Magento? Perhaps we can implement a setup task for this together.

If you want to create a SQL import, you should use Magentos ID as code and its name as label. Its ID and parent ID can only be used directly if the mshop_catalog table is completely empty. Furthermore, you have to calculate the values for the "level", "nleft" and "nright" fields. Using a setup task and the catalog manager should be definitively easier.

Re: How to import categories/catalog list?

Posted: 18 Aug 2016, 01:00
by brunojti
How can one calculate the values for the "level", "nleft" and "nright" fields? I am interested in doing that ;)

Re: How to import categories/catalog list?

Posted: 18 Aug 2016, 10:09
by aimeos
It's difficult to implement nested sets correctly and you would have to care about the other data (level, parentid, etc.) as well. We strongly recommend to create an Aimeos Catalog Manager object and use it's insertitem() method instead!