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

Export & import categories
 
sherrie
Mentor
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 
Hucke-Media - 30 March 2009 10:29 PM

Hello Stefy

Attached you will find a little archive which contains all mods and tricks described above to import categories as a CSV file.

I also had a little struggle putting the very helpful hints together.

Just put it into your app directory, create advanced import profile and should simply work.

This gets me the furthest but I am still getting this error:

Starting profile executionplease wait...
WarningPlease don't close window during importing/exporting data
Starting Mage_Dataflow_Model_Convert_Adapter_Io :: load
Loaded successfully: "/stores/var/import/Categories.csv"
Starting Mage_Dataflow_Model_Convert_Parser_Csv :: parse
Found 1 rows
Starting catalog/convert_adapter_category :: parse
 <br /> <b>Fatal error</b>: Call to undefined method ImpCat_Catalog_Model_Convert_Adapter_Category::getStoreById() in <b>/stores/app/code/local/ImpCat/Catalog/Model/Convert/Adapter/Category.php</b> on line <b>42</b><br />
Processed 0% 0/1 records
Imported 0 records

I’m running 1.1.6 - is there a code difference that is causing this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sharmstr
Member
 
Total Posts:  61
Joined:  2009-03-15
 

I cant tell you about the version you are running, but I received that error on 1.3 and it was because I hadn’t uploaded the config.xml file to /app/code/local/ImpCat/Catalog/etc/config.xml

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

I got that file, it’s the getStoreById() that’s confusing it ... I’m thinking it might’ve been called something else in 1.1.6.

 
Magento Community Magento Community
Magento Community
Magento Community
 
xoai
Jr. Member
 
Total Posts:  3
Joined:  2009-02-13
 

Sherrie, make sure the Categories.csv in the right format. I got that error too, but when I converted them in to text and save it. It s gone, could be the format of the CSV.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sharmstr
Member
 
Total Posts:  61
Joined:  2009-03-15
 

is it something silly like having “Store” instead of “store” in your csv file?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 
xoai - 09 April 2009 12:24 PM

Sherrie, make sure the Categories.csv in the right format. I got that error too, but when I converted them in to text and save it. It s gone, could be the format of the CSV.

This was the problem, thanks. Unfortunately it’s still giving me the same SQL error I get when trying to add them manually - I was hoping this would bypass the error. Oh well.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pezomatic
Sr. Member
 
Avatar
Total Posts:  190
Joined:  2008-11-05
 

I have been away for a few months and I was really hoping that Varien finally added the ability to import categories into Magento.

Are they still forcing us to perform all these ridiculous workarounds?

 
Magento Community Magento Community
Magento Community
Magento Community
 
lbeetles
Member
 
Total Posts:  66
Joined:  2009-02-04
 

cheers this helped me loads.

 
Magento Community Magento Community
Magento Community
Magento Community
 
abakkook
Jr. Member
 
Total Posts:  28
Joined:  2008-09-23
 

Hello everyone,

Thanks for all of the help with this.  Does anyone know why I would be getting the following error when running this import:

* Starting profile execution, please wait…
* Warning: Please don’t close window during importing/exporting data

* Starting Mage_Dataflow_Model_Convert_Adapter_Io :: load
* Loaded successfully: “/home/universa/domains/universalathletic.com/public_html/beta/store/var/import/Categories.csv”
* Starting Mage_Dataflow_Model_Convert_Parser_Csv :: parse
* Found 8 rows
* Starting catalog/convert_adapter_category :: parse
* <script type="text/javascript">[removed].href = ‘/store/report/?id=223199942396&s;=admin’;</script>
* <script type="text/javascript">[removed].href = ‘/store/report/?id=958519753382&s;=admin’;</script>
* <script type="text/javascript">[removed].href = ‘/store/report/?id=1236279683135&s;=admin’;</script>
* <script type="text/javascript">[removed].href = ‘/store/report/?id=363319907228&s;=admin’;</script>
* <script type="text/javascript">[removed].href = ‘/store/report/?id=464999881676&s;=admin’;</script>
* <script type="text/javascript">[removed].href = ‘/store/report/?id=579079853178&s;=admin’;</script>
* <script type="text/javascript">[removed].href = ‘/store/report/?id=257919934832&s;=admin’;</script>
* <script type="text/javascript">[removed].href = ‘/store/report/?id=1201559697460&s;=admin’;</script>
* Processed 0% 0/8 records
* Imported 0 records
* Finished profile execution.

 
Magento Community Magento Community
Magento Community
Magento Community
 
abakkook
Jr. Member
 
Total Posts:  28
Joined:  2008-09-23
 

One thing I thought of is if I have the “store” column wrong in my CSV file.  Should that column ALWAYS be “default”?  Or does it depend on what your actual store name is?  I’ve tried it both ways and it didn’t seem to make a different.

The CSV file I have it saved as a Unicode TXT file with a CSV extension.  Is that correct?
Thanks - IR

 
Magento Community Magento Community
Magento Community
Magento Community
 
abakkook
Jr. Member
 
Total Posts:  28
Joined:  2008-09-23
 

Nevermind.  I figured it out.  The text file needs to be ANSI format.  I was doing Unicode and UTF.  Once I changed it, it worked.  Plus I left the “store” column at “default” even though we have a different store name.  It doesn’t matter.  Thanks guys for all this help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jaycode
Jr. Member
 
Total Posts:  7
Joined:  2009-03-22
 
michael_g08 - 08 April 2009 07:35 PM

I wrote my own script based on direct sql queries. Importing the tree of over 200 categories from temporary table into magento and asociating products with them.
I’ts hardcoded for my own needs, but i think it’s enough easy to change smile.

If somebody interested, I can share.

Hi, could you share me the code please? I think it is safer just to do it via direct sql (that way I won’t need to back up an entire site and my installation would stay clean)

Thanks in advance!

 
Magento Community Magento Community
Magento Community
Magento Community
 
michael_g08
Sr. Member
 
Avatar
Total Posts:  108
Joined:  2009-03-06
Ukraine
 

Here Your are smile
Just do not forget to change the username & password to Your MySql.

File “products_import_sql.gz” includes temporary table structure. It have to be imported into base “magento_import” which You have to create manualy.

Regards, Michael.

File Attachments
Category_script.zip  (File Size: 4KB - Downloads: 1386)
 
Magento Community Magento Community
Magento Community
Magento Community
 
Martin
Guru
 
Avatar
Total Posts:  445
Joined:  2007-08-31
Brno | London | Los Angeles
 

Hi, I use Santosh adapter override and it partly works (it imports 33 of 178 categories), but on the rest of categories it throws out fatal error:

Call to a member function getUrlPath() on a non-object in \app\code\core\Mage\Catalog\Model\Resource\Eav\Mysql4\Url.php on line 657

Almost all of my categories uses diacritics, so I thought it’s the problem, but I cann’t crack it ... Does anybody know how to solve it?

 
Magento Community Magento Community
Magento Community
Magento Community
 
funkytone
Jr. Member
 
Total Posts:  4
Joined:  2008-04-14
 

Hi,

Has someone had this problem?

I’m using Santosh’s method, everything works great, i get success after running the profile, but when i go to manage categories, there are no categories listed.

Anyone else had the same thing?

Thanks,
Tony

Image Attachments
untitled.JPG
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top