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)
#2508 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?
#2509 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.
#2510 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
#2511 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.
#3206 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!