Forums / Upgrading to 1.5.x / Copy Customers & Address Book ONLY from 1.3.8a to 1.5.4

Copy Customers & Address Book ONLY from 1.3.8a to 1.5.4

Views: 1,672

Results 1 to 9 of 9
8 Apr 2015, 10:38 PM
#1
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

Copy Customers & Address Book ONLY from 1.3.8a to 1.5.4

I'm doing a new site in v1.5.4 and would only like to import only my customers and their address from version 1.3.8a nothing else, No order history or anything. Did not want to copy entire database because I have to many mods installed on it that I will not be wanting to use on the new site. Thanks for any help.

marcopolo
Zen Cart 2.2.2 | PHP 8.5.11 | MariaDB 10.11.14

9 Apr 2015, 12:10 AM
#2
twitchtoo avatar

twitchtoo

Totally Zenned

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

Re: Copy Customers & Address Book ONLY from 1.3.8a to 1.5.4

Two options...

1 - Recommended:
Export only the fields you want to 'keep' then import them into the new SQL via phpMYadmin.
Run the db update using zc_install to update only.

Backup both db under separate names BEFORE making any changes.

2 - Advanced:
If you have an advanced knowledge of SQL, manually copy over the data raw SQL (old) to raw SQL (new) and import into the new db.
Run the db update using zc_install to update only.

Backup both db under separate names BEFORE making any changes.

Or, get someone that's done it before to help ;)

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

9 Apr 2015, 1:56 AM
#3
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

Re: Copy Customers & Address Book ONLY from 1.3.8a to 1.5.4

Thanks that worked perfect I did the following:

exported the three tables below from my v1.3.8 database:

address_book
customers
customers_info

Then on the new v1.5.4 database I dropped the following three tables:

address_book
customers
customers_info

Then I imported the ones from v1.3.8
Then I ran zc_install and updated database

Thanks again.

marcopolo
Zen Cart 2.2.2 | PHP 8.5.11 | MariaDB 10.11.14

9 Apr 2015, 2:19 AM
#4
twitchtoo avatar

twitchtoo

Totally Zenned

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

Re: Copy Customers & Address Book ONLY from 1.3.8a to 1.5.4

Thanks for the detailed update!

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

5 Jul 2015, 12:28 PM
#5
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

Re: Copy Customers & Address Book ONLY from 1.3.8a to 1.5.4

Updated and some feedback please:

I outlined the steps above that I took to bring over my customer data to the new 1.5.4 install which worked perfect. The new site is finally done and ready to go live so I figured lets try to bring over the orders as well and see if it works before going live.

Now both 1.3.8 and 1.5.4 have exact same products NO new products have been installed on either 1.3.8 install or 1.5.4 install The only difference at this point is that 1.5.4 has different modules installed and does not have latest customer data from last import and has no sales.

***** It's also important to note all product data and attributes are the same on both 1.3.8 and 1.5.4 installs, sames product_ids etc.***

OK so here are the steps I did:

To bring over latest customer data I once again exported the three tables below from my v1.3.8 database:

address_book
customers
customers_info

in addition to the above tables I also exported the below ones for the orders:

orders
orders_products
orders_products_attributes
orders_status
orders_status_history
orders_total
paypal
paypal_payment_status_history

from what I can see these are all the tables that hold customer order data, if I missed anything please let me know.

Then on the 1.5.4 database I dropped all the above tables and imported all the ones above that were exported from 1.3.8 install.

I then ran convert_db2utf8.php to convert them to utf8.

Everything as far as I can see is working perfect I did a test order and looked at each table and all ids progressed in proper order. Anything else I should be checking before going live?

marcopolo
Zen Cart 2.2.2 | PHP 8.5.11 | MariaDB 10.11.14

6 Jul 2015, 6:26 PM
#6
lat9 avatar

lat9

Administrator

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

Re: Copy Customers & Address Book ONLY from 1.3.8a to 1.5.4

After importing the data from your v1.3.8a database, you should be running the database upgrade script available from the zc_install folder. That will pick up any database changes to those tables introduced in ZC 1.3.9 through 1.5.4.

6 Jul 2015, 6:32 PM
#7
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

Re: Copy Customers & Address Book ONLY from 1.3.8a to 1.5.4

I did that as well and it did not have to make any changes, I just want to be certain I'm not overlooking anything that would be hard to fix once the new website is live and taking in new orders.

marcopolo
Zen Cart 2.2.2 | PHP 8.5.11 | MariaDB 10.11.14

6 Jul 2015, 6:51 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: Copy Customers & Address Book ONLY from 1.3.8a to 1.5.4

marcopolo:

I'm doing a new site in v1.5.4 and would only like to import only my customers and their address from version 1.3.8a nothing else, No order history or anything. Did not want to copy entire database because I have to many mods installed on it that I will not be wanting to use on the new site. Thanks for any help.
In short, I NEVER recommend this approach ... for multiple reasons, including: people almost always miss something because they didn't test properly (thankfully you're taking it more seriously than that); and the "scope" always changes: ie: initially only wanted customers, but later also wished they had order history too ... and on the list goes.

Further, whenever someone says "because I have too many mods installed", they rarely recognize that most changes made by mods are simply extra config records in the configuration and configuration_groups tables, or extra tables created by those mods. So cleaning those up is actually very simple ... and then the integrity of the rest of the real data is left intact by keeping the rest of the database.

When you instead choose to pick-and-choose various tables, you run the risk of leaving stuff behind, and also corrupting the data by doing export/import operations if character-sets get mangled, or server configs are different, etc.

At least, as I mentioned above, you seem to be taking a slightly bigger-picture look at it than most people do, although you've also been hit with the scope-creep issue.

Here's the list of core database tables and their purposes, to help guide you in your approach: https://www.zen-cart.com/wiki/index.php/Developers_-_Database_Schema#Table_List_Ordered_by_Data

What I recommend people do is this approach instead: https://www.zen-cart.com/entry.php?3-How-do-I-rebuild-my-site-on-the-new-version-instead-of-upgrading ... and then as part of "going live" simply be sure to also uninstall whatever stuff was installed into the database by your now-unwanted mods.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Jul 2015, 7:33 PM
#9
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
522
Plugin Contributions:
2

Re: Copy Customers & Address Book ONLY from 1.3.8a to 1.5.4

Thank you DrByte I'm always amazed by the support this form provides especially from you and Ajeh. I agree and would recommend anyone upgrading to go with the route you outlined

marcopolo
Zen Cart 2.2.2 | PHP 8.5.11 | MariaDB 10.11.14