Syncing Latest eCommerce Orders/Details from Production into Development Database

Permalink 1 user found helpful
Let's say you have a website using eCommerce add-on. You branch off the development database/filesystem to do upgrade, redesign, change page areas, themes, add new content, etc.

During this design time you are getting new orders/customers/products into the existing production database.

This creates a problem- your eCommerce tables need to be synced. And if you don't you will see 000000 for your order numbers and receive when viewing the order details page - with missing billing detail information:

PHP Fatal error:  Call to a member function getAddress1() on a non-object in /packages/core_commerce/elements/orders/detail.php on line 35


The solution is to sync the CoreCommerce tables- but there are some other ones that are less obvious and took me some time to discover so I am posting to help the community:

mysqldump concrete5 CoreCommerceDiscountGroups CoreCommerceDiscounts CoreCommerceDiscountTypeBasic CoreCommerceDiscountTypeFreeShipping CoreCommerceDiscountTypes CoreCommerceDiscountUsers CoreCommerceOrderAttributeKeys CoreCommerceOrderAttributeValues CoreCommerceOrderInvoiceNumbers CoreCommerceOrderProducts CoreCommerceOrders CoreCommerceOrderSearchIndexAttributes CoreCommerceOrderStatusHistory CoreCommercePaymentMethods CoreCommerceProductAttributeKeys CoreCommerceProductAttributeValues CoreCommerceProductImages CoreCommerceProductOptionAttributeKeys CoreCommerceProductOptionAttributeValues CoreCommerceProducts CoreCommerceProductSearchIndexAttributes CoreCommerceProductSearchPurchaseGroups CoreCommerceProductSetProducts CoreCommerceProductSets CoreCommerceProductStats CoreCommerceProductTieredPricing CoreCommerceSalesTaxRates CoreCommerceShippingTypeCustomCountries CoreCommerceShippingTypes atAddress atAddressCustomCountries atAddressSettings AttributeValues AttributeKeys  atCoreCommerceOrderAdjustment atCoreCommerceProductAdjustmentBoolean atCoreCommerceProductAdjustmentBooleanSettings atCoreCommerceProductAdjustmentSelectOptions atCoreCommerceProductAdjustmentText atCoreCommerceProductAdjustmentTextSettings > /tmp/ecommerce.sql


You may notice some additional blocks- but if you sync these you will break your new cart placements- but this may be advantageous if you haven't reorganized too much:

btCoreCommerceCartLinks btCoreCommerceDisplayProductAttributes btCoreCommerceProduct


NOTE: if your also upgrading your ecommerce add-on, there may be missing tables, so ideally you would 1) turn off your site, 2) dump the production database, 3) do your upgrades to c5 core and ecommerce add-on, 4) dump the above tables, 5) sync those tables into the development database, 6) dump development and import into production or upgrade your filesystem or configuration to use the new database VOILA!

I hope this helps!