We are currently in the process of redoing our main store front. I have set up a development server which currently replicates our production server. We would like to use the development server to re-theme the site, as well as do a major recategorization of our products. Then, on D-Day, the plan will be to migrate the changes (theme + categories) to the production site but obviously maintaining sales / customer data.

Any recommendations on how to do this? I don't mind scripting something, but would be more than happy to use an existing module.

I'm new to Magento but am familiar with PHP / MySQL / rsync etc.



The best approach in my opinion is this:

  1. For the theme. Obviously create a new theme under app/design/frontend/{interface}/THEME NAME HERE and skin/frontend/{interface}/THEME NAME HERE. Then use this theme only on your dev server. After migrating it to the live server, just change the theme name is System->Configuration->Design. This should be easy.
  2. Now the hard(er) part. Categories. I recommend you to script the category creation in a custom module. Use the data folder of the module. See this for more details. In the files you put in this folder just create the category tree. Here is a small example:

    $mainCategory = Mage::getModel('catalog/category')
        ->setName('Main category')
        ->setPath('1/2') //add as subcategory of ROOT
        ->setDescription('Some description')
        ->setPostedProducts(array(5,8,9)) //and array with product ids
        ->setIsAnchor(1) //or 0
    $subCategory = Mage::getModel('catalog/category')
        ->setName('Sub category')
        ->setParentId($mainCategory->getId) //add as child of previous category
        ->setDescription('Some description for subcategory')
        ->setPostedProducts(array(1,3,4)) //and array with product ids
        ->setIsAnchor(1) //or 0

I wrote this of the top of my head. The script may need some modifications. but the idea seams OK.
now all you have to do to go live is to put on your live server the theme and your extension that scripts the categories. But before doing it live test it on a clone from your live server. And back-up your live server before trying it.

| improve this answer | |
  • Thanks for your answer. Regarding the theme I think there is some things stored in the database as well (such as CMS->Static Blocks etc). Regarding the Categories, I wasn't planning to script their creation, but rather get the shop staff to perform the categorization manually on the dev site and then transfer it across. Does that make sense? – Jymz Jan 14 '14 at 4:00
  • @Jymz. You can also script the creation of cms pages. See this as reference: stackoverflow.com/a/9324609/2047249. As for categories I would still take the script approach. It is not that easy to move the category tree from one instance to an other. But if you insist, you can give this a try. sourceforge.net/projects/magmi – Marius Jan 14 '14 at 7:08
  • Scripting the creation of CMS pages sounds like a good way to go - I'll look into that. Thanks for your advice regarding categories as well. I'll aim at scripting that too – Jymz Jan 14 '14 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.