3

I have been developing an existing Magento (1.9) site.

My current approach is to make a clone of the Magento files and DB, configure the clone to use the new DB and change the base URLS of the site to dev.example.com. I then develop on the clone with the reassurance that I will not bring the live site down during plugin installs, new store creation or other development activities (see below).

During the development period all kinds has happened including the following:

  • Updates to mage core 1.9.1 to 1.9.2 for example.
  • Updates to existing plugins.
  • New plugins.
  • Changes to template files.
  • New Stores created (Multi-Store).
  • New Themes installed.
  • Updates to CMS.
  • Test purchases.
  • New test dummy user account.
  • New customer accounts and orders are migrated over from a non-magento store

Meanwhile, on the other side of the server, current live site has been:

  • Taking orders
  • Taking payment transaction infomation.
  • New customers have made accounts and signed up for newsletters.
  • The clients have made new blog posts and updated/added cms pages.

And this works all fine n dandy until its time (normally a few weeks down the road) to make the shiny development site live with all the changes brought together in one harmonious Magento.

My last experience of merging the data was unbelievably painful with the following issues experienced:-

  • my staging instance complaining of foreign key errors and other DB related issues.
  • incorrect records assigned to customers
  • replication of data
  • store views becoming muddled
  • transaction data missing

Magento's built in import/export tools were handy but also became a double edged sword as customers order history isn't a consideration with these built-in tools leading to all sorts of DB errors and mismatched data.

3rd party plugins to bring over order history made a bad situation worse as they would not bring across data I would expect to come across. Transaction information or Shipments for example.

My experience was pretty stressful and I'm not looking for a resolution for any particular issue (they're all solved now) but rather asking .... is there anyway to make the process less prone to error?

Are there any holistic tools / environment / methodology out there that can help in this situation without needing a Magento tool box of plugins or scripts that require updating / maintenance ?

Is my approach wrong?

Resources on the subject are pretty sparse given the popularity of Magento, which surprises me.

5
  • Do you want to clone your live website to staging? or do you want to merge the existing staging website with live website data?
    – ImranSheik
    Nov 24 '16 at 13:41
  • That would be the latter. Nov 24 '16 at 13:54
  • Didn't get your point here, please be clear.
    – ImranSheik
    Nov 24 '16 at 14:57
  • I want to merge the existing staging website with live website data. Nov 24 '16 at 15:16
  • This looks to be something unique requirement. Generally, merchants maintain the live website up to date with data(products/customers) and clone the same to staging website for doing any customization related to the application, not database level. I will be posting an answer for this to how to do Orders/Customer/Product data export/import in magento.
    – ImranSheik
    Nov 24 '16 at 15:31
0

Typically Magento provides Customers and Products import/export data profiles to export/import products/customers data between two Magento instances.

Blog for product import/export : [http://www.templatemonster.com/help/magento-how-to-exportimport-data-in-csv-files.html][1]

But order export/import is missing, for this we have some third party paid as well as some free extension which can full fill this gap.

I have used the following extension for one of my implementation and it works. Hope it helps you.

https://www.magentocommerce.com/magento-connect/bulk-import-export-orders-to-csv-1.html

2
  • 1
    Thanks @Mage_Dev, whilst Customers and Products can be imported via the built-in import/export functions and the orders can be exported and imported via the 3rd party plugin you mention I found the following issues with these methods. 1. Export/Import Orders plugin had difficulty matching orders to customers if their PK had changed it also did not bring across shipment or any payment history. 2. Import/Export of customers via Mage built in tools changed the PK of most of the customers. My question is more about if there is a holistic solution/environment out there. Nov 24 '16 at 15:58
  • Please share the issues you found.
    – ImranSheik
    Nov 24 '16 at 16:04
0

The issues you list in your question are typical to the integration procedure.

The major problem here is that development version diverges from production version which makes it problematic to deploy it "in an easy way".

The solution here is to have a deployment script for this procedure. That means that the procedure of rolling your developments onto your production website should not be done manually.

So, you shouldn't be exporting/importing data. You should instead be pulling your developments into your production environment.

The convenient way of doing this assumes that:

  • GIT is used for getting needed files in place when it comes to deployment to production

  • all the modifications done in the DB on dev version ( like settings adjustments, creating CMS blocks or whatever) must be packed into a script, that can perform such updates in the DB of the production version

1
  • Thanks, Alexy great suggestion for GIT I can see where the benefits in using this route for file version control and staging. Your second suggestion of scripting DB changes sounds good but what scripting are we talking about? Are we talking about flatting the database into arrays , making changes to the data then importing again (via a script)? Is this SQL scripting? PHP scripting? are there examples of this kind of scripting on the internet? Nov 25 '16 at 14:03

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.