Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Category Import - Changing/specifying category IDs
 
mweather
Member
 
Total Posts:  33
Joined:  2007-08-31
 

I’m trying to import my categories from another cart via Magento’s API.

My goal is to use the same URLs for Magento as on my old cart, for SEO reasons.

My old cart has everything Magento’s API needs: parentid, path, name, etc. The only problem is, how do you specify the category ID when creating or updating a category via the API?

The parent and path information from my old cart is pretty much useless if the categories have a different ID in Magento.

Surely someone must have run into this problem.

Do I have to use SQL or modify Magento?

Edit: forgot to mention, I’m using xml-rpc via a python script.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mweather
Member
 
Total Posts:  33
Joined:  2007-08-31
 

Well, I’ve got a workaround. I crated an array that maps the old category id to the new one and I pickled it (saved it to file). Now I can rewrite my products CSV substituting the old id with the new.

I’m wondering if it wouldn’t be faster to just import the products via the api and avoid pickling altogether (doing categories and products in one script).  With over 10,000 products to import, if the API is even slightly faster that means hours less downtime when the time comes to do the switch.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top