将cms和静态页面块magento从一个数据库导出到另一个数据库

i want to export cms and static page block from on db of magento to other ,

basically they are same theme and structure ,so i want to just export them and import any possibility via databse , what table need to be imported please guide

You might want to check all tables with the name starting by cms_*, basically :

  • cms_page
  • cms_page_store
  • cms_block
  • cms_block_store

You can also check in Magento Commerce, I'm pretty sure that there are free extensions to export this information if you're not at ease with a mysqldump.

Bye.

Please use the following script.

function getCmspages() {

$pages = Mage::getModel('cms/page')->getCollection();

foreach ($pages as $page) {

    echo 'Page Id : '.$page->getId().PHP_EOL;
    echo 'Page Title : '.$page->getTitle().PHP_EOL;
    echo 'Page Identifier : '.$page->getIdentifier().PHP_EOL;
    echo 'Page Template : '.$page->getRootTemplate().PHP_EOL;
    echo 'Meta Keywords : '.$page->getMetaKeywords().PHP_EOL;
    echo 'Meta Desc : '.$page->getMetaDescription().PHP_EOL;
    echo 'Content Heading : '.$page->getContentHeading().PHP_EOL;
    echo'Content : '.$page->getContent().PHP_EOL;
    echo'Status : '.$page->getIsActive().PHP_EOL;
    echo 'Layout Update Xml : '.$page->getLayoutUpdateXml().PHP_EOL;
    $storeIds= $page->getResource()->lookupStoreIds($page->getId());

    foreach($storeIds as $storeId){

        $store = Mage::getModel('core/store')->load($storeId);
        echo 'Store Name : '. $store->getName().PHP_EOL;
        echo 'Code : '. $store->getCode().PHP_EOL;
        echo 'Website Id : '. $store->getWebsiteId().PHP_EOL;
        echo 'Group Id : '. $store->getGroupId().PHP_EOL;
        echo 'Sort Order : '. $store->getSortOrder().PHP_EOL;

    }

    echo '-----------------------------------------------'.PHP_EOL;
}

}

For static blocks

function getCmsblocks() {

$blocks = Mage::getModel('cms/block')->getCollection();

echo "block here".PHP_EOL;

foreach ($blocks as $block) {

    echo 'Id : '.$block->getId().PHP_EOL;
    echo 'Title : '.$block->getTitle().PHP_EOL;
    echo 'Identifier : '.$block->getIdentifier().PHP_EOL;
    echo'Content : '.$block->getContent().PHP_EOL;
    echo'Status : '.$block->getIsActive().PHP_EOL;
    $storeIds= $block->getResource()->lookupStoreIds($block->getId());

    foreach($storeIds as $storeId){

        $store = Mage::getModel('core/store')->load($storeId);
        echo 'Store Name : '. $store->getName().PHP_EOL;
        echo 'Code : '. $store->getCode().PHP_EOL;
        echo 'Website Id : '. $store->getWebsiteId().PHP_EOL;
        echo 'Group Id : '. $store->getGroupId().PHP_EOL;
        echo 'Sort Order : '. $store->getSortOrder().PHP_EOL;
        echo '-----------------------------------------------'.PHP_EOL;
    }
    echo '-----------------------------------------------'.PHP_EOL;
}

}

for full code please refer. https://www.pearlbells.co.uk/export-static-blocks-magento/