Forums / General Questions / Adding older orders and customer list to new database

Adding older orders and customer list to new database

Views: 1,528

Results 1 to 12 of 12
5 Mar 2014, 8:20 PM
#1
in2deep avatar

in2deep

Zen Follower

Join Date:
Jul 2011
Posts:
214
Plugin Contributions:
0

Adding older orders and customer list to new database

I'm refreshing an older zen cart with a fresh new install with a new layout etc. The old database has 2000 orders and almost that many customers. I'd like to save the order and customer info to the new database. How would I do this properly?

5 Mar 2014, 10:53 PM
#2
k1ra avatar

k1ra

New Zenner

Join Date:
Jul 2013
Posts:
57
Plugin Contributions:
0

Re: Adding older orders and customer list to new database

In2Deep:

I'm refreshing an older zen cart with a fresh new install with a new layout etc. The old database has 2000 orders and almost that many customers. I'd like to save the order and customer info to the new database. How would I do this properly?

If you follow the upgrade procedures this will not be an issue. I accomplished this for my store going from 1.3.9 to 1.5.1 with a whole new theme/plugins/etc and was able to retain my customer and order info..

This link may be helpful:
https://www.zen-cart.com/content.php?148-how-do-i-upgrade-my-zen-cart-site

5 Mar 2014, 11:55 PM
#3
in2deep avatar

in2deep

Zen Follower

Join Date:
Jul 2011
Posts:
214
Plugin Contributions:
0

Re: Adding older orders and customer list to new database

I didn't do an upgrade though, I installed a new version of the cart and started from scratch. Would I still do it this way?

k1ra:

If you follow the upgrade procedures this will not be an issue. I accomplished this for my store going from 1.3.9 to 1.5.1 with a whole new theme/plugins/etc and was able to retain my customer and order info..

This link may be helpful:
https://www.zen-cart.com/content.php?148-how-do-i-upgrade-my-zen-cart-site

6 Mar 2014, 4:46 AM
#4
drbyte avatar

drbyte

Sensei

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

Re: Adding older orders and customer list to new database

Yes. Import your entire old database. This will wipe out your new one. Then run zc_install and choose database-upgrade. This will upgrade your data to the new format. Then reconfigure anything you'd changed in your store.

See: http://www.zen-cart.com/entry.php?3-How-do-I-rebuild-my-site-on-the-new-version-instead-of-upgrading

.
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 Mar 2014, 9:05 PM
#5
in2deep avatar

in2deep

Zen Follower

Join Date:
Jul 2011
Posts:
214
Plugin Contributions:
0

Re: Adding older orders and customer list to new database

Getting an error when I try to import the old database into phpMyAdmin:

Error
SQL query:

--
-- Database: abc


--
-- Table structure for table address_book

DROP TABLE IF EXISTS address_book ;

MySQL said: Documentation

#1046 - No database selected

7 Mar 2014, 4:15 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: Adding older orders and customer list to new database

In2Deep:

#1046 - No database selected
It will only say "no database selected" if you've not selected a database to use.

.
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.

7 Mar 2014, 7:44 PM
#7
in2deep avatar

in2deep

Zen Follower

Join Date:
Jul 2011
Posts:
214
Plugin Contributions:
0

Re: Adding older orders and customer list to new database

My mistake. Fixed it now. When I look at the database through phpMyAdmin all of the data is there. I ran zc_install and upgraded the database from 1.3.9 to 1.5.0 and then to 1.5.1

When I logged into my Admin, none of the new data is there. What's missing?

DrByte:

It will only say "no database selected" if you've not selected a database to use.

9 Mar 2014, 6:28 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: Adding older orders and customer list to new database

In2Deep:

When I logged into my Admin, none of the new data is there. What's missing?
By "new" do you literally mean "new"? Or do you mean "the data I meant to copy forward from the old database"?

The upgrade process is intended to bring all the old data forward. And then you continue by taking new orders from that point.
So, the import I just described above brought in all the data from the old version (as of the date/time that you did the backup which you imported from), and then you upgraded it to the new format. Now you're all set to start adding new orders from today. It replaces whatever else you had in your database.

.
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.

9 Mar 2014, 9:21 AM
#9
in2deep avatar

in2deep

Zen Follower

Join Date:
Jul 2011
Posts:
214
Plugin Contributions:
0

Re: Adding older orders and customer list to new database

What I am trying to do is still have the past orders and customers info populated in the brand new install. The data is not showing up in the admin section.

9 Mar 2014, 6:54 PM
#10
drbyte avatar

drbyte

Sensei

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

Re: Adding older orders and customer list to new database

Look at the /admin/includes/configure.php in your OLD site and your NEW site, and look at the DB_PREFIX line. Does your new one have the same DB_PREFIX as the old one? If not, make it so. Then do the same in your non-admin configure.php file too.

.
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.

10 Mar 2014, 6:47 PM
#11
in2deep avatar

in2deep

Zen Follower

Join Date:
Jul 2011
Posts:
214
Plugin Contributions:
0

Re: Adding older orders and customer list to new database

Looks like the old one didn't have a prefix:

define('DB_PREFIX', '');

The new one does:

define('DB_PREFIX', 'zc_');

10 Mar 2014, 9:58 PM
#12
drbyte avatar

drbyte

Sensei

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

Re: Adding older orders and customer list to new database

Okay, then until you set the new one to use the same prefix, it'll keep looking at the wrong set of tablenames in the database.

.
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.