Zen Cart Logo
Forums / Upgrading to 1.5.x / Best approach for updating DB with orders/customers?

Best approach for updating DB with orders/customers?

Views: 1,323

Results 1 to 9 of 9
28 Feb 2012, 10:13 AM
#1
leon76 avatar

leon76

New Zenner

Join Date:
Feb 2012
Posts:
22
Plugin Contributions:
0

Best approach for updating DB with orders/customers?

Hi all.

I have a 1.5.0 zen cart running in a separate folder so I can play with it, customize it, test it and so on.
My live 1.3.8a zen cart is in the root folder and is continuing to accept new customer registrations, new orders, etc. Life is normal.
Needless to say since exporting the DB to the 1.5.0, there has been new customers and orders.
In your experience what is the easiest way to synchronize the data? I mean, I expect that soon I can have the 1.5.0 folder ready to go live, but its DB is not up-to-date.
Should I bulk copy some of the tables? Like zen_orders_* and zen_customers_*?
Or should I make a export/import and make all the changes in the backoffice all over again?
I suspect that the first approach is the easiest, since I'm only interested in keeping the up-to-date customers and orders.

What do you think?

28 Feb 2012, 12:35 PM
#2
aditya369 avatar

aditya369

New Zenner

Join Date:
Oct 2011
Posts:
36
Plugin Contributions:
0

Re: Best approach for updating DB with orders/customers?

Hi Leon76,

Your first approach is the easiest one to follow.
First of all, take a back up of your database 1.5.0 and 1.3.8a and keep it in a safe location.

Make sure that the table structures in 1.5.0 and 1.3.8a should be same for the tables that you want to bulk copy.

If the table structure in both versions are same, then you can copy the table data from 1.3.8a to 1.5.0.

28 Feb 2012, 2:48 PM
#3
leon76 avatar

leon76

New Zenner

Join Date:
Feb 2012
Posts:
22
Plugin Contributions:
0

Re: Best approach for updating DB with orders/customers?

Thanks.

I wonder if anyone knows the tables which concern the customers and orders data?

28 Feb 2012, 6:57 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Best approach for updating DB with orders/customers?

I always recommend that you FIRST stage your upgrade COMPLETELY AS A TEST in another folder+database, taking detailed notes of what changes you will need to make when you eventually upgrade the LIVE site.

ie: your TESTING area is ONLY FOR TESTING. Not to eventually become "live". Instead, you do a dry-run using your test site. Then when it comes time to go live, you apply all the file changes to the live site, upgrade the live site's database, and then apply any alterations to settings in your live site's admin, before turning off down-for-maintenance and letting customers back in.

That way you NEVER LOSE ANY DATA, and never damage the data by flukes that often happen when exporting-and-then-importing needlessly.
Plus, you also won't lose search engine rankings by doing silly things like putting your site into different subfolder names, and won't have the complications of trying to repoint a site to a different folder, etc etc etc.

So, I respectfully disagree with aditya369's suggestion. Selectively copying data from one database to another IS NOT SOMETHING YOU SHOULD BE DOING. Especially if you're in the position of needing to ask which tables are involved. The only exception is when you already have a solid-enough understanding of the entire database infrastructure and all the potential issues arising from exporting/importing, charactersets, and more.

29 Feb 2012, 9:16 AM
#5
leon76 avatar

leon76

New Zenner

Join Date:
Feb 2012
Posts:
22
Plugin Contributions:
0

Re: Best approach for updating DB with orders/customers?

leon76:

Thanks.

I wonder if anyone knows the tables which concern the customers and orders data?

DrByte:

So, I respectfully disagree with aditya369's suggestion. Selectively copying data from one database to another IS NOT SOMETHING YOU SHOULD BE DOING. Especially if you're in the position of needing to ask which tables are involved. The only exception is when you already have a solid-enough understanding of the entire database infrastructure and all the potential issues arising from exporting/importing, charactersets, and more.

Thanks, Doc.

I'll make a backup of the test DB and try to synchronize the customers and orders tables with the live DB.
I don't know what the tables are, but I'll find out.
If anyone is willing to tell me, I'd appreciate it.

29 Feb 2012, 12:44 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Best approach for updating DB with orders/customers?

thud

29 Feb 2012, 4:23 PM
#7
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Best approach for updating DB with orders/customers?

leon76:

Thanks, Doc.

I'll make a backup of the test DB and try to synchronize the customers and orders tables with the live DB.
I don't know what the tables are, but I'll find out.
If anyone is willing to tell me, I'd appreciate it.
The question is this: WHY do you think you need to do this????????

I really think you are missing the point that DrByte was making in his response.. YOU DON'T NEED TO DO THIS!!!

Your TEST/DEVELOPMENT site does NOT need to stay in synch with your live site..

  1. Do your development on your test/development site.
  2. Make note of all the SQL file installs from mods you add/update in your test/development site.
  3. Make note of any other file modifications/customizations you make.
  4. Keep a list of ALL the add-ons you have installed (including the version) and any customizations/settings you have made to these add-ons.

Then following DrBytes advice:

when it comes time to go live:

  1. Apply all the file changes (NOT DB changes) to the live site.
  2. Run the upgrade process on the live site's database (JUST like you did when creating your test/development site)
  3. Apply any alterations to settings in your live site's admin, before turning off down-for-maintenance and letting customers back in
    Attempting to "synch" the data between these two sites when they are running DIFFERENT versions of Zen Cart is a WASTE OF TIME and bound to lead to errors.

I get what you are trying to do, but you are either over-thinking this or looking for a shortcut to the process.. This shortcut will most assuredly lead to you spending MORE TIME fixing the errors and issues you will create for yourself. It will take LESS time to follow the process than it will for you to figure out HOW to do this synchronization you are attempting and to deal with the issues it will cause than if you had just followed the suggested procedures to begin with..

In commercial software development, the process DrByte outlined IS HOW IT GETS DONE.. When my company (a MAJOR payroll company) upgrades clients from one version of our software to another, we create a test environment. We make our changes and test those changes on the test environment. Then we apply the database updates and file updates to the live store.. We DO NOT attempt to spend any time on data synchronization between the live and dev environments. (For what purpose?)

1 Mar 2012, 11:14 AM
#8
leon76 avatar

leon76

New Zenner

Join Date:
Feb 2012
Posts:
22
Plugin Contributions:
0

Re: Best approach for updating DB with orders/customers?

Hi all,

I found the tables I needed, did an export with drop/create, with structure only first.
Used a merging tool to find out the differences, there were 2 new indexes and one field that changed its datatype.
I did a backup of the 1.5.0, did the export of the 1.3.8a this time with data too, edited the .sql file to make the changes I spotted earlier, did the import on the 1.5.0, tested, and it's working.
Now I have an up-to-date site with customers and orders as of today, March, 1st.

:clap:

1 Mar 2012, 1:56 PM
#9
leon76 avatar

leon76

New Zenner

Join Date:
Feb 2012
Posts:
22
Plugin Contributions:
0

Re: Best approach for updating DB with orders/customers?

Fannya24:

Your first approach is the easiest one to follow.

Well, at least it worked for me.
I think it's a LOT of trouble going again through ALL the changes I made in the test site (new theme, new add-ons, lots of configuration changes, etc.).
Of course this is not the "official" way to do it, as stated by the Doc and others, but it works.

Did it worked out for you too?