Using the following given quick PHP script you can export categories with Ids in Magento.You just need to save te below given code in a PHP file “CatList.php” in the base Magento directory of your store, and visit the URL in your web browser.
<?php
define('MAGENTO', realpath(dirname(__FILE__)));
require_once MAGENTO . '/app/Mage.php';
Mage::app();
$category = Mage::getModel ( 'catalog/category' );
$tree = $category->getTreeModel ();
$tree->load ();
$ids = $tree->getCollection ()->getAllIds ();
if ($ids) {
$file = "var/import/catlist.csv";
file_put_contents($file,"catId, catName\n");
foreach ( $ids as $id ) {
$string = $id . ', ' .$category->load($id)->getName() . "\n";
file_put_contents($file,$string,FILE_APPEND);
}
}
?>
http://www.domain.com/CatList.php
. You can find the csv file in thevar/import/
directory.