Zen Cart Logo
Forums / Upgrading to 1.5.x / Manually merging 151 database customer records into a 154 database

Manually merging 151 database customer records into a 154 database

Views: 1,765

Results 1 to 10 of 10
21 Feb 2015, 4:05 PM
#1
jmocallghan avatar

jmocallghan

New Zenner

Join Date:
Feb 2015
Location:
North Carolina
Posts:
5
Plugin Contributions:
0

Manually merging 151 database customer records into a 154 database

I had to do a manual rebuild of a V151 to V154 due to some problems with both my web server and also corruption of my database. I took the opportunity to jump to 154 from 151. Has anyone manually moved the customer information from 151 before to 154 and if so,how?

21 Feb 2015, 5:41 PM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Manually merging 151 database customer records into a 154 database

jmocallghan:

I had to do a manual rebuild of a V151 to V154 due to some problems with both my web server and also corruption of my database. I took the opportunity to jump to 154 from 151. Has anyone manually moved the customer information from 151 before to 154 and if so,how?

The easiest/safest thing to do would be to export the original database (the entire database, not just selected tables) and then import it into the new database, using a tool such as phpmyadmin

This may help
http://www.zen-cart.com/content.php?144-how-can-i-do-a-site-backup-or-use-phpmyadmin-for-database-backup

Although it is possible to just export and import the customer data related tables you run a much greater risk of this going wrong.

Cheers
RodG

PS. If you really only want to 'move the customer data' please view http://www.zen-cart.com/wiki/index.php/Developers_-_Database_Schema
You'll need to export/import all the tables indicated that pertain to 'Customers'.

21 Feb 2015, 5:47 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,097
Plugin Contributions:
56

Re: Manually merging 151 database customer records into a 154 database

Your best bet is to create a new database, copy the v1.5.1 database into that new database, point a Zen Cart v1.5.4 test site at that database and run the zc_install database upgrade procedure. That will make any conversions required in going from v1.5.1 to v1.5.4.

Once you "know" that the customer tables are up to snuff with v1.5.4, then doing the customer-date export and subsequent import into your "real" v1.5.4 database (as RodG indicated) will have fewer gremlins to deal with.

21 Feb 2015, 6:03 PM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Manually merging 151 database customer records into a 154 database

lat9:

Your best bet is to create a new database, copy the v1.5.1 database into that new database, point a Zen Cart v1.5.4 test site at that database and run the zc_install database upgrade procedure. That will make any conversions required in going from v1.5.1 to v1.5.4.

For the OP. This is an equally viable method to use.

The benefit/pitfall of this method is that you won't be messing with the currently installed/working database, but you will need to edit the two configure.php files to 'switch' from the current DB to the newly created one.

The benefit/pitfall of my suggested method is that you won't need to edit the configure files, but you will be overwriting the contents of the currently working database with the content of the original database, IOW, you will be working with 'live' data rather than data in a testing/staging area.

With either method there is a small risk that something could go wrong so always keep backups before doing anything.

Personally I like lat9's suggested method a little better, but it seems to me that more people get themselves into trouble with the configure.php file edits than they do with the export/import.

Pick the method that you feel most comfortable with, and if it doesn't go well, restore from the backup and try the other. :)

As they say, there's more than one way to skin an apple (or something like that) <g>

Cheers
RodG

22 Feb 2015, 4:32 AM
#5
drbyte avatar

drbyte

Sensei

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

Re: Manually merging 151 database customer records into a 154 database

jmocallghan:

I had to do a manual rebuild of a V151 to V154 due to some problems with both my web server and also corruption of my database. I took the opportunity to jump to 154 from 151. Has anyone manually moved the customer information from 151 before to 154 and if so,how?
Can you explain the specific reason why you're only considering your customer names, and not your entire database?

22 Feb 2015, 1:16 PM
#6
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Manually merging 151 database customer records into a 154 database

jmocallghan:

I had to do a manual rebuild of a V151 to V154 due to some problems with both my web server and also corruption of my database. I took the opportunity to jump to 154 from 151. Has anyone manually moved the customer information from 151 before to 154 and if so,how?

Yes. I do this sort of thing all the time, it's quite easy. If the zc_install db upgrade feature isn't working for you, just move the data manually:

  1. Install ZC v1.54, make sure it works.

  2. New - Export the new v1.54 db to .sql file. Open the file in a code editor.

  3. Old - Export the old v1.51 db to .sql file. Open the file in a code editor.

  4. Compare the two. From the top to the bottom. Here you will clearly see just how basic the information is stored. Be mindful of syntax within each of the tables. Once you are familiar with the code structure you will see how easy it is to copy over the customer data. Remember that customer data is stored in more than one location along with the indexes each of the tables use.

  5. Copy the SQL data from the old to the new. Once you have it copied, save the .sql, import it into the new site using phpMYadmin and your v1.54 site will have clean customer data!

Note: If you can't see the sql structure it may be helpful to make one of everything you need in the new site, add a category, product, customer and place an order. Then export the data to see how the 'new' ZC is storing information in your 'new' php version.

Limitations... We are talking about moving customer data NOT the entire old site - to - the new site. Things get a lot more complex when you're trying to move old sites with many modules to new sites with no modules or upgraded versions. Stick to the customer data and it will work out just fine.

22 Feb 2015, 2:13 PM
#7
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,709
Plugin Contributions:
56

Re: Manually merging 151 database customer records into a 154 database

twitchtoo:

Yes. I do this sort of thing all the time, it's quite easy. If the zc_install db upgrade feature isn't working for you, just move the data manually:

Please note that this is incredibly bad advice for the average shopowner.

If the zc_install db upgrade feature isn't working for you, please post your results, error logs, etc. on the forum so someone can advise you on what's going wrong and how to fix it. Skipping the built-in upgrade tool and instead doing a table-by-table SQL upgrade by hand is a great way to hose up your store. Unless you're an expert, you should be using the built-in upgrading logic. And if you are an expert - you should be using the built-in upgrading logic.

22 Feb 2015, 5:08 PM
#8
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Manually merging 151 database customer records into a 154 database

twitchtoo:

Yes. I do this sort of thing all the time, it's quite easy.

Easy for you perhaps (because you 'do it all the time' and know more about SQL than the average shopowner) but of the methods mentioned so far this is by far the most time consuming and most risky.

As I 'hinted' in a previous reply, if exporting/import just the customer is a 'must' (which is very rare and generally indicates someone has already messed things up) then exporting/importing **just the relevant tables **is the way to go. No need to compare, copy and paste.

I could never recommend your method except perhaps as a last resort in the situation where the data has somehow been corrupted making a direct import impossible, and even then it is only something I'd do myself rather than suggesting it to others.

<shudder>

Cheers
RodG

28 Feb 2015, 12:29 PM
#9
jmocallghan avatar

jmocallghan

New Zenner

Join Date:
Feb 2015
Location:
North Carolina
Posts:
5
Plugin Contributions:
0

Re: Manually merging 151 database customer records into a 154 database

I had some corruption issues on SBA information and also rewrote all my entries for products hence just looking for the customer base at this time that is coming out of my current 151 store vs the 154 I am building now.

28 Feb 2015, 12:31 PM
#10
jmocallghan avatar

jmocallghan

New Zenner

Join Date:
Feb 2015
Location:
North Carolina
Posts:
5
Plugin Contributions:
0

Re: Manually merging 151 database customer records into a 154 database

RodG, thanks. Your information is exceptionally helpful and I appreciate the guidance on the risks associated. You are correct, I really screwed up my 151 database w/a made application of SBA info.