I have done this script to runs data/profile using ssh terminal to export csv data of all products inside of magento 1.9. I need to have the category name (structure tree) instead of category Ids but i do not know how to do that. Attached my code.
<?php
#$profileId = 1; #All Products
$profileId = 49; #OnSale
require_once 'app/Mage.php';
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$profile = Mage::getModel('dataflow/profile');
$userModel = Mage::getModel('admin/user');
$userModel->setUserId(0);
Mage::getSingleton('admin/session')->setUser($userModel);
$profile->load($profileId);
if (!$profile->getId()) {
Mage::getSingleton('adminhtml/session')->addError('[ERROR] Invalid ID');
}
Mage::register('current_convert_profile', $profile);
$profile->run();
$recordCount = 0;
?>