How to import categories/catalog list?

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Dan
Posts: 2
Joined: 16 Feb 2016, 11:45

How to import categories/catalog list?

Post by Dan » 16 Feb 2016, 11:48

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?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: How to import categories/catalog list?

Post by aimeos » 16 Feb 2016, 12:18

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Dan
Posts: 2
Joined: 16 Feb 2016, 11:45

Re: How to import categories/catalog list?

Post by Dan » 16 Feb 2016, 12:42

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

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: How to import categories/catalog list?

Post by aimeos » 16 Feb 2016, 13:01

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

brunojti
Posts: 27
Joined: 29 Jul 2016, 14:02

Re: How to import categories/catalog list?

Post by brunojti » 18 Aug 2016, 01:00

How can one calculate the values for the "level", "nleft" and "nright" fields? I am interested in doing that ;)

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: How to import categories/catalog list?

Post by aimeos » 18 Aug 2016, 10:09

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!
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply