Zen Cart Logo
Forums / Managing Customers and Orders / Importing Order Information into New Store

Importing Order Information into New Store

Views: 986

Results 1 to 6 of 6
18 Jul 2015, 19:57
#1
wwwd avatar

wwwd

Inactive

Join Date:
Nov 2012
Posts:
100
Plugin Contributions:
0

Importing Order Information into New Store

I want to import the contents of the order history from a ZC 1.5.1 store into my new 1.5.4 store. I have tried exporting into a CSV file and then uploading into the corresponding table in the new store.

However, the order date fields keep defaulting, it doesn't let me import dates, so it is completely screwing up my orders, I cannot tell which is new and which are old!

19 Jul 2015, 02:09
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Importing Order Information into New Store

I cannot tell which is new and which are old!
What are you attempting to do???
Apparently not upgrade

19 Jul 2015, 03:50
#3
wwwd avatar

wwwd

Inactive

Join Date:
Nov 2012
Posts:
100
Plugin Contributions:
0

Re: Importing Order Information into New Store

I am trying to migrate the date from the old tables to the new ones.

The date fields do not seem to allow date to populate from the .csv files that I've used to import the information. I've not come across this before, the dates are in the import file but do not write to the fields in the target table.

19 Jul 2015, 04:15
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Importing Order Information into New Store

WWWD:

I am trying to migrate the date from the old tables to the new ones.

The date fields do not seem to allow date to populate from the .csv files that I've used to import the information. I've not come across this before, the dates are in the import file but do not write to the fields in the target table.

While such "migration" would be/have been better to do as part of an upgrade, are the dates in the format: YYYY-MM-DD? In your CSV file?

19 Jul 2015, 05:34
#5
rodg avatar

rodg

Deceased

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

Re: Importing Order Information into New Store

WWWD:

The date fields do not seem to allow date to populate from the .csv files that I've used to import the information. I've not come across this before, the dates are in the import file but do not write to the fields in the target table.

Why are you exporting/importing using .csv ? (yes, there ARE valid reasons for this), but if this is a matter of migrating the data from one version of ZenCart to another, then you are better served doing this in .sql format and the dates will be retained).

I should also mention that SQL servers can be/are quite finicky about the data being imported into date/time fields because internally these are stored as a timestamp, which is typically the number of seconds that have passed since January 1970.

There's several reasons for this.

  1. It makes date related calculations easy and reliable.
  2. It negates the effects of timezone differences for when/if the data is migrated from a server based in (say) USA to a server based in UK
  3. It maintains compatibility between different servers that may happen to use a different date format, such as MM-DD-YYYY, DD-MM-YYYY and even D-M-Y

This is never an issue with the SQL export/import, but with .CSV these timestamps (numbers) are converted to/from a human readable text format, and if the server being imported to doesn't understand the text format, it'll either set the date to null, zero, or 01-01-1970

Cheers
RodG

19 Jul 2015, 09:18
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Importing Order Information into New Store

I want to import the contents of the order history from a ZC 1.5.1 store into my new 1.5.4 store
You are best off not attempting to pick & choose which data to import or not
If upgrading follow the tutorials on that and import a "FULL" database from your 1.5.1 shop and then re-run zc_install and select upgrade database only