Zen Cart Logo
Forums / General Questions / Transfering Customers & Orders

Transfering Customers & Orders

Locked

Views: 1,932

Results 1 to 20 of 24
This thread is locked. New replies are disabled.
19 Nov 2011, 8:48 AM
#1
dre avatar

dre

New Zenner

Join Date:
Mar 2006
Location:
The Netherlands
Posts:
92
Plugin Contributions:
0

Transfering Customers & Orders

Is it possible to transfer only the customers and their orders, information etc to a fresh new installed shop with a new database.

If possible, how wil i do that?

The shop has now the following modules realted to customers :
reward points
dualpricing

Thank you for any advice / help

19 Nov 2011, 8:57 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Transfering Customers & Orders

Why are you using a new database instead of keeping the actual real live database that contains the REAL information?

19 Nov 2011, 9:58 AM
#3
dre avatar

dre

New Zenner

Join Date:
Mar 2006
Location:
The Netherlands
Posts:
92
Plugin Contributions:
0

Re: Transfering Customers & Orders

Thank you for your reply.

Because i want to update all the modules and the shop from 1.3.g to h and also start with a new template

Also i tried to update image handler and light box. This failt and my lightbox isnt working anymore

19 Nov 2011, 10:20 AM
#4
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Transfering Customers & Orders

dre:

Thank you for your reply.

Because i want to update all the modules and the shop from 1.3.g to h and also start with a new template

Also i tried to update image handler and light box. This failt and my lightbox isnt working anymore

I don't believe there were any database changes from 1.3.9g to 1.3.9h So you should be using the same database as they are the same in both versions.

You just overwrite the php files with the new versions and update your template and modules

19 Nov 2011, 10:28 AM
#5
mastico avatar

mastico

New Zenner

Join Date:
Jun 2008
Posts:
1
Plugin Contributions:
0

Re: Transfering Customers & Orders

Hi

If there was no changes in DB structure of this tables this sql commands will fill your customers and orders information, you have to change new_table and old_table to your table names, and run this commands in your phpMyAdmin.

insert into new_table.address_book
select * from old_table.address_book;
insert into new_table.customers
select * from old_table.customers;
insert into new_table.customers_basket
select * from old_table.customers_basket;
insert into new_table.customers_basket_attributes
select * from old_table.customers_basket_attributes;
insert into new_table.customers_info
select * from old_table.customers_info;
insert into new_table.orders
select * from old_table.orders;
insert into new_table.orders_products
select * from old_table.orders_products;
insert into new_table.orders_products_attributes
select * from old_table.orders_products_attributes;
insert into new_table.orders_products_download
select * from old_table.orders_products_download;
insert into new_table.orders_status_history
select * from old_table.orders_status_history;
insert into new_table.orders_total
select * from old_table.orders_total;

Matej

19 Nov 2011, 7:35 PM
#6
drbyte avatar

drbyte

Sensei

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

Re: Transfering Customers & Orders

mastico's suggestion is incomplete, and doesn't accomplish what dre was asking for. In fact it will result in duplicate records and all kinds of MySQL errors. And it will lose payment history data.

A FAR BETTER APPROACH is to use the actual live database directly.

20 Nov 2011, 7:22 AM
#7
dre avatar

dre

New Zenner

Join Date:
Mar 2006
Location:
The Netherlands
Posts:
92
Plugin Contributions:
0

Re: Transfering Customers & Orders

pfew I wanted to try the option from mastico . So there is no way to transfer only the customers and their information.

20 Nov 2011, 8:02 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: Transfering Customers & Orders

What's so difficult about using the original live database?

What's so important about this "new" database that you're treating it more sacred than your real live data?

25 Nov 2011, 11:43 AM
#9
dre avatar

dre

New Zenner

Join Date:
Mar 2006
Location:
The Netherlands
Posts:
92
Plugin Contributions:
0

Re: Transfering Customers & Orders

The problem is there are some modules not working anymore or i want to get them out of the database .

So is zen lightbox after upgrading image handler not working any more. Paypal is accepting payment but i dont get the orders and i tried mailbeez but al the extra good modules for mailbez you have to pay for.

2 Dec 2011, 6:37 PM
#10
dre avatar

dre

New Zenner

Join Date:
Mar 2006
Location:
The Netherlands
Posts:
92
Plugin Contributions:
0

Re: Transfering Customers & Orders

So i its not possible to transfer customer details etc to a new database?

2 Dec 2011, 8:18 PM
#11
drbyte avatar

drbyte

Sensei

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

Re: Transfering Customers & Orders

With advanced database skills and a solid deep understanding of the Zen Cart database architecture and thorough awareness of all the tables and relationships affected by data between tables, yes it's possible. But if you're asking the question then you're telling me you don't have those skills.

That's why we tell you to use the existing database ... which is the opposite way around what you're trying to do. Tackle it from the other direction and you'll keep all your data.

8 Jun 2013, 4:37 PM
#12
twi avatar

twi

Zen Follower

Join Date:
Aug 2007
Posts:
277
Plugin Contributions:
0

Re: Transfering Customers & Orders

Dr Byte. this one is addressed to you and I hope you can help me with this.

I currently have 2 separate ZC 1.3.9h web stores with 2 URLS. I am in the process in to combining the 2 in one ZC 1.5.1 ising the MULTISITE Mod.

The task at hand is combining the customers' data and the customers orders from two databases into one database for the MULTISITE ZC.

At this point, I am fairly versed in inserting and updating data in PhpMyAdmin using sql statements.

Since both databases customers and data start with "1" and etc for customer numbers and orders, there is a need to change the customers numbers and orders for the 2 databases to not overlap with each other.

eg. customer database1 has customers 1 to 100
and customer database2 has customers 1 to 50
so what I did was to have database1 1 to 100 and change database2 from 101 to 150.

for orders: database1 1 to 100, and database2 1 to 70 combined to become 170.

I am able to combine and upload these into the appropriate new database tables.

I have used the same method to transfer the orders files too. The orders are displaying correctly with the customers names and all other info.

The problem is that the customer appear in the Zencart Cpanel under the customer list. But went I click on the edit details of these customers, there are no information displayed except for a country that is not belonging to any of the customers in the customers list.

What am I missing? Can you give me some pointers in this?

8 Jun 2013, 5:24 PM
#13
twi avatar

twi

Zen Follower

Join Date:
Aug 2007
Posts:
277
Plugin Contributions:
0

Re: Transfering Customers & Orders

This is the format I used to insert into the "emptied database tables of ZC 1.5.1:

INSERT INTO customers (customers_id, customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_nick, customers_default_address_id, customers_telephone, customers_fax, customers_password, customers_newsletter, customers_group_pricing, customers_email_format, customers_authorization, customers_referral, customers_paypal_payerid, customers_paypal_ec) VALUES

(1, 'm', 'name1', 'name2', '2010-05-21 00:00:00', 'customer##################', '', 1, '123-123-456', '', 'fcb6097abb488511206d91dbaa123456:83', '1', 0, 'HTML', 0, '', '', 0), ....... ;

INSERT INTO customers_info (customers_info_id, customers_info_date_of_last_logon, customers_info_number_of_logons, customers_info_date_account_created, customers_info_date_account_last_modified, global_product_notifications) VALUES

(1, '2013-04-12 15:19:03', 48, '2010-05-21 14:46:34', '2012-03-08 22:00:54', 0), ....... ;

Can you tell me what is wrong with this? Data did insert but they just don't display as described in my previous post.

Any help is appreciated.

8 Jun 2013, 5:43 PM
#14
twi avatar

twi

Zen Follower

Join Date:
Aug 2007
Posts:
277
Plugin Contributions:
0

Re: Transfering Customers & Orders

[QUOTE=twi;1206593]This is the format I used to insert into the "emptied database tables of ZC 1.5.1:

INSERT INTO customers (customers_id, customers_gender, customers_firstname, customers_lastname, customers_dob, customers_email_address, customers_nick, customers_default_address_id, customers_telephone, customers_fax, customers_password, customers_newsletter, customers_group_pricing, customers_email_format, customers_authorization, customers_referral, customers_paypal_payerid, customers_paypal_ec) VALUES

(1, 'm', 'name1', 'name2', '2010-05-21 00:00:00', 'customer@ email.com', '', 1, '305-123-456', '', 'fcb6097abb488511206d91dbaa123456:83', '1', 0, 'HTML', 0, '', '', 0), ......... ;

correction on the above values.

9 Jun 2013, 12:18 AM
#15
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Transfering Customers & Orders

twi:

......I currently have 2 separate ZC 1.3.9h web stores with 2 URLS. I am in the process in to combining the 2 in one ZC 1.5.1 ising the MULTISITE Mod.

That means asking for trouble on a grand scale - the DB's of 1.3.9 and 1.5.x are slightly different.

At this point, I am fairly versed in inserting and updating data in PhpMyAdmin using sql statements.

Export - Import would be a better option. Still does not satisfy my first comment

Since both databases customers and data start with "1" and etc for customer numbers and orders, there is a need to change the customers numbers and orders for the 2 databases to not overlap with each other.

eg. customer database1 has customers 1 to 100
and customer database2 has customers 1 to 50
so what I did was to have database1 1 to 100 and change database2 from 101 to 150.

for orders: database1 1 to 100, and database2 1 to 70 combined to become 170.

Customer ID's AUTO_INCREMENT.

By using your approach you are breaking relationships with other tables...... same applies to Product ID's, Order ID's etc

See DrByte's comment in post #11

The problem is that the customer appear in the Zencart Cpanel under the customer list. But went I click on the edit details of these customers, there are no information displayed except for a country that is not belonging to any of the customers in the customers list.

Address book maybe.....

As I said above, you are asking for trouble. I truly hope you are not doing this on a live store but on a local development server ........

10 Jun 2013, 3:22 PM
#16
twi avatar

twi

Zen Follower

Join Date:
Aug 2007
Posts:
277
Plugin Contributions:
0

Re: Transfering Customers & Orders

I do know they have differences. For this reason, I have downloaded the following tables from zc 1.3.9 and zc 1.5.1 for comparisons :

address_book, customers, customers_info, orders, orders_products, orders_status_history, orders_total, paypal, paypal_payment_status_history, paypal_sessions, so_payments

since some of the above mentioned tables have differences in their structure, I uploaded/inserted only the data that needs to be updated into the new tables.

I have attempted to use the export and import method as well after combining the appropriate data in the various tables first on open spread sheet. Then created sql files for each table separately.

that I have taken into account too. that is why database1 was used as first database and database2 entries are incremented from the last/largest value of the first database.

See DrByte's comment in post #11

I will take a look at that. Is that post 11 in this forum you are referring to?

Address book maybe.....

can you elaborate on this? this is actually the only problem I am encountering. the customers appears on the customer list in the ZC cpanel. Only when you try to click on a individual customer, the details are not displaying.

Orders and invoices and all other tables are fine. All the correct items, and data are there including the customers info are in the correct orders, so are the shipping info. In other words, the uploads/insets/updates are working except the customers data are not appearing when you want to see the details.

Any body can help out on this one?

no. it is my server that I cam trying to setup for future use. Thanks on this reminder.

10 Jun 2013, 8:53 PM
#17
drbyte avatar

drbyte

Sensei

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

Re: Transfering Customers & Orders

Agreed, you are playing with fire, because you are not keeping all the relational keys in sync. And you left out the address_book table, thus your customer data is now corrupt.

10 Jun 2013, 9:32 PM
#18
twi avatar

twi

Zen Follower

Join Date:
Aug 2007
Posts:
277
Plugin Contributions:
0

Re: Transfering Customers & Orders

DrByte:

Agreed, you are playing with fire, because you are not keeping all the relational keys in sync. And you left out the address_book table, thus your customer data is now corrupt.

But I did take into account the address_book table too.
From my understanding. the 3 tables that deals with customers and its info are:

address_book
customers
customers_info

What I did was incrementing the numbers under address_book table uner colimns
address_book_id and customers_id by the same number to create the sequence.

for customers table, customers_id matched that of the address_book

for the customers_info table, the customers_id sequence are the same as well,

Can you elaborate a bit more on the part of address_table? what am I missing there? Or are there more than three tables involved here? I need to combine all the customers. Any suggestions in doing this other than what I am trying to do?

10 Jun 2013, 9:37 PM
#19
drbyte avatar

drbyte

Sensei

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

Re: Transfering Customers & Orders

You didn't mention customers_default_address_book_id
And you didn't mention any of the other tables that have a customers_id in them.

10 Jun 2013, 9:38 PM
#20
twi avatar

twi

Zen Follower

Join Date:
Aug 2007
Posts:
277
Plugin Contributions:
0

Re: Transfering Customers & Orders

DrByte:

Agreed, you are playing with fire, because you are not keeping all the relational keys in sync. And you left out the address_book table, thus your customer data is now corrupt.

what do you mean by keeping the all the relational keys in sync? How do you do that?