Author Topic: Importing orders successfully  (Read 1567 times)

Offline totaffy

  • Newbie
  • *
  • Posts: 24
  • Karma: +1/-1
    • View Profile
Importing orders successfully
« on: September 29, 2017, 05:19:55 PM »
Hi,

I'm starting a new thread from my "Orders Import With Bestsellers" thread, as there appeared to be an issue with that one.

My background is in IT Project Management, I'm not a developer - Though I'm trying to understand the Abantecart system and would really appreciate your help.

I am new to Abantecart, so really my priorities are understanding how/needing to import orders successfully.

Some of the errors iI got in v1.2.10 to me seem of a similar format to the ones I got in v1.2.11



i.e.

v1.2.10
Missing relation ID order_product_id for update_or_insert action in table order_products
Missing relation ID order_total_id for update_or_insert action in table order_totals.

v1.2.11
Missing relation ID order_id for update_or_insert action in table order_products.
Missing relation ID order_id for update_or_insert action in table order_totals

So I'm guessing I'm missing info from some of the _ID columns, or the columns are not correct for the import,

I've listed the columns I think  are likely to be causing an issue below.
and provided as much detail as possible - though please let me know if there is anything else


Please could you help me to import orders successfully?




i've just upgraded to v1.2.11

I'm migrating  content from  'custom developed' website to Abantecart.

I don't know if there are any issues caused by the upgrade, I guess you'll know more about that than me.


As attached i have:

- Submitted 2 test orders using default stripe test transactions plus a COD transaction and exported them (I've added this data to the top 3 rows in the .csv file attached, just for reference)

- Created an order from actual customer data using the exported file, the customer ID is as exported from Abantecart, the product ID is as exported from abantecart

- attempted a test import of a single order using this data in the Abantecart exported table

- line 5 of the attachment is the single order


I wasn't sure what to do with these columns so :

(B) orders.order_id -  included the column and left this field blank?
(DZ) order_products[0].order_id - included the column and left this field blank?
(EA)order_products[0].product_id - included the column and left this field blank?

And got these results:

(It created 4 duplicate records/entries for the single order, without the associated products)

There will be 1 records loaded and processed in this import!

Task Failed
Import Process has been completed. 0 row(s) processed.
For more details see

2017-09-29 10:30:46 - Converting file /home/username/public_html/dev/admin/system/data/import_phpZyJBRg.txt to array. Start row number: 0. Rows count: 1
2017-09-29 10:30:46 - Starting import data from array. Mode: commit
2017-09-29 10:30:46 - Insert into table orders done successfully
2017-09-29 10:30:46 - Missing relation ID order_id for update_or_insert action in table order_products. Skipping.
2017-09-29 10:30:46 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-09-29 10:30:46 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-09-29 10:30:46 - Converting file /home/username/public_html/dev/admin/system/data/import_phpZyJBRg.txt to array. Start row number: 1. Rows count: 1
2017-09-29 10:30:46 - Starting import data from array. Mode: commit
2017-09-29 10:30:46 - Incorrect structure of main Array node. Only table nodes are expected
2017-09-29 10:30:46 - Converting file /home/username/public_html/dev/admin/system/data/import_phpZyJBRg.txt to array. Start row number: 0. Rows count: 1
2017-09-29 10:30:46 - Starting import data from array. Mode: commit
2017-09-29 10:30:46 - Insert into table orders done successfully
2017-09-29 10:30:46 - Missing relation ID order_id for update_or_insert action in table order_products. Skipping.
2017-09-29 10:30:46 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-09-29 10:30:46 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-09-29 10:30:46 - Converting file /home/username/public_html/dev/admin/system/data/import_phpZyJBRg.txt to array. Start row number: 1. Rows count: 1
2017-09-29 10:30:46 - Starting import data from array. Mode: commit
2017-09-29 10:30:46 - Incorrect structure of main Array node. Only table nodes are expected
2017-09-29 10:30:46 - Converting file /home/username/public_html/dev/admin/system/data/import_phpZyJBRg.txt to array. Start row number: 0. Rows count: 1
2017-09-29 10:30:46 - Starting import data from array. Mode: commit
2017-09-29 10:30:46 - Insert into table orders done successfully
2017-09-29 10:30:46 - Missing relation ID order_id for update_or_insert action in table order_products. Skipping.
2017-09-29 10:30:46 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-09-29 10:30:46 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-09-29 10:30:46 - Converting file /home/username/public_html/dev/admin/system/data/import_phpZyJBRg.txt to array. Start row number: 1. Rows count: 1
2017-09-29 10:30:46 - Starting import data from array. Mode: commit
2017-09-29 10:30:46 - Incorrect structure of main Array node. Only table nodes are expected
2017-09-29 10:30:46 - Converting file /home/username/public_html/dev/admin/system/data/import_phpZyJBRg.txt to array. Start row number: 0. Rows count: 1
2017-09-29 10:30:46 - Starting import data from array. Mode: commit
2017-09-29 10:30:46 - Insert into table orders done successfully
2017-09-29 10:30:46 - Missing relation ID order_id for update_or_insert action in table order_products. Skipping.
2017-09-29 10:30:46 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-09-29 10:30:46 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-09-29 10:30:46 - Converting file /home/username/public_html/dev/admin/system/data/import_phpZyJBRg.txt to array. Start row number: 1. Rows count: 1
2017-09-29 10:30:46 - Starting import data from array. Mode: commit
2017-09-29 10:30:46 - Incorrect structure of main Array node. Only table nodes are expected

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 3826
  • Karma: +185/-0
    • View Profile
Re: Importing orders successfully
« Reply #1 on: October 02, 2017, 09:31:19 AM »
Hello.
Your file have broken structure. What editor you have?
With any delimiter I try it is broken. In addition you have an unreadable chars inside file looks like your editor mess up the file encoding.
 For example some chars looks like �
“Chuck Norris is so amazing.”
― Mother Teresa

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4078
  • Karma: +243/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Importing orders successfully
« Reply #2 on: October 02, 2017, 02:42:55 PM »
Three is a problem with EOL characters. How do you save CSV file?
We need your help to build better free open source eCommerce platform for everyone.
See how you can help

Offline totaffy

  • Newbie
  • *
  • Posts: 24
  • Karma: +1/-1
    • View Profile
Re: Importing orders successfully
« Reply #3 on: October 02, 2017, 06:36:11 PM »
Hello Basara,Abantecart

Thank you for your responses, I'm using/saving in Excel 2013 to edit the .csv files

Had a look at unreadable chars in wizard are -   - and - £ - pounds signs opened/translated in Excel as  for me.  I tried £,  and without. though still getting the same errors on the import.

I don't really have an idea about the structural issue , the file and attachment is opening ok for me in Excel. I'm not doing anything different with the orders compared to products and customers export/import. Products and customers imported ok without any apparent structural issue in v1.2.10.

I started from scratch, read that if adding/changing columns this may add commas in excel, I may have done this while testing (though did same with products and customers in 1.2.10 ok). Simply exported by ID this time (simplified/less columns for my products), edited  and imported, keeping as .csv format. Though same "Incorrect structure of main Array node. Only table nodes are expected" error. if thats the error.

Also of course missing relation ID for missing values in ID columns - so far I've included/though left the columns listed below blank.

- I've attached the latest file, removing £ or Â

I've had a look at the tables in the database via phpmyadmin
Perhaps could import directly into database?

Though would need a little help with the ID columns

Order ID columns - straightforward numerical order (unique)?
orders.order_id
order_products[0].order_id
order_totals[0].order_id

- Can follow existing sequence for these as exported?
order_totals[0].order_total_id
order_totals[1].order_total_id

- can't see logically where this ID for each order/products comes from, or anywhere else it's referenced in the database?
order_products[0].product_id







Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4078
  • Karma: +243/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Importing orders successfully
« Reply #4 on: October 02, 2017, 07:22:59 PM »
Your last attached file is a mess. It will not work.
If you use Excel to enter data and export ready data to CSV, it should work fine.

If you edit CSV manually, you will not be able to do it right (unless you know what you are doing. It does not sound that way)
We need your help to build better free open source eCommerce platform for everyone.
See how you can help

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 3826
  • Karma: +185/-0
    • View Profile
Re: Importing orders successfully
« Reply #5 on: October 03, 2017, 01:23:22 AM »
Hi.

Try openoffice software it is free and better to edit CSV files
“Chuck Norris is so amazing.”
― Mother Teresa

Offline totaffy

  • Newbie
  • *
  • Posts: 24
  • Karma: +1/-1
    • View Profile
Re: Importing orders successfully
« Reply #6 on: October 03, 2017, 03:42:19 AM »
Hi Abantecart, Ok, points taken! Haha - Thanks, I'll take another look, my learning curve here is a little steep

Hi Bassara thank you for the guidance, I'll try that suggestion.


Offline totaffy

  • Newbie
  • *
  • Posts: 24
  • Karma: +1/-1
    • View Profile
Re: Importing orders successfully
« Reply #7 on: October 06, 2017, 09:05:30 AM »
Simple export of one record via abantecart admin, and import as text as per https://www.hesa.ac.uk/support/user-guides/import-csv and file was still messed up with unreadable chars, I don't think its anything I'm doing, as pretty straightforward, so will try openoffice

Offline totaffy

  • Newbie
  • *
  • Posts: 24
  • Karma: +1/-1
    • View Profile
Re: Importing orders successfully
« Reply #8 on: October 06, 2017, 01:27:04 PM »
Hi,

I've exported a single record and opened with openoffice ...comma separated, text deelimited " and all columns set as 'text.'

Tested a simple update of the name  as attached- and this worked fine though still get that error at the end - "Incorrect structure of main Array node. Only table nodes are expected"


2017-10-06 17:02:15 - Converting file /home/user/public_html/dev/admin/system/data/import_phpCKrjH5.txt to array. Start row number: 0. Rows count: 1
2017-10-06 17:02:15 - Starting import data from array. Mode: commit
2017-10-06 17:02:15 - Update for table orders done successfully
2017-10-06 17:02:15 - update for table order_history done successfully
2017-10-06 17:02:15 - update for table order_history done successfully
2017-10-06 17:02:15 - update for table order_products done successfully
2017-10-06 17:02:15 - update for table order_totals done successfully
2017-10-06 17:02:15 - update for table order_totals done successfully
2017-10-06 17:02:15 - Converting file /home/user/public_html/dev/admin/system/data/import_phpCKrjH5.txt to array. Start row number: 1. Rows count: 1
2017-10-06 17:02:15 - Starting import data from array. Mode: commit
2017-10-06 17:02:15 - Incorrect structure of main Array node. Only table nodes are expected
« Last Edit: October 06, 2017, 02:00:04 PM by totaffy »

Offline totaffy

  • Newbie
  • *
  • Posts: 24
  • Karma: +1/-1
    • View Profile
Re: Importing orders successfully
« Reply #9 on: October 06, 2017, 02:13:49 PM »
Hi

Created a record from the exported file, and tested a single import.
Unfortunitely got exactly the same erro as started with.

it does seem, that I need to know what to do with these colums?:

orders.order_id
order_products[0].order_id
order_products[0].product_id

2017-10-06 17:53:47 - Converting file /home/user/public_html/dev/admin/system/data/import_phpVUah7D.txt to array. Start row number: 0. Rows count: 1
2017-10-06 17:53:47 - Starting import data from array. Mode: commit
2017-10-06 17:53:47 - Insert into table orders done successfully
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_history. Skipping.
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_products. Skipping.
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-10-06 17:53:47 - Converting file /home/user/public_html/dev/admin/system/data/import_phpVUah7D.txt to array. Start row number: 1. Rows count: 1
2017-10-06 17:53:47 - Starting import data from array. Mode: commit
2017-10-06 17:53:47 - Incorrect structure of main Array node. Only table nodes are expected
2017-10-06 17:53:47 - Converting file /home/user/public_html/dev/admin/system/data/import_phpVUah7D.txt to array. Start row number: 0. Rows count: 1
2017-10-06 17:53:47 - Starting import data from array. Mode: commit
2017-10-06 17:53:47 - Insert into table orders done successfully
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_history. Skipping.
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_products. Skipping.
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-10-06 17:53:47 - Converting file /home/user/public_html/dev/admin/system/data/import_phpVUah7D.txt to array. Start row number: 1. Rows count: 1
2017-10-06 17:53:47 - Starting import data from array. Mode: commit
2017-10-06 17:53:47 - Incorrect structure of main Array node. Only table nodes are expected
2017-10-06 17:53:47 - Converting file /home/user/public_html/dev/admin/system/data/import_phpVUah7D.txt to array. Start row number: 0. Rows count: 1
2017-10-06 17:53:47 - Starting import data from array. Mode: commit
2017-10-06 17:53:47 - Insert into table orders done successfully
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_history. Skipping.
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_products. Skipping.
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-10-06 17:53:47 - Converting file /home/user/public_html/dev/admin/system/data/import_phpVUah7D.txt to array. Start row number: 1. Rows count: 1
2017-10-06 17:53:47 - Starting import data from array. Mode: commit
2017-10-06 17:53:47 - Incorrect structure of main Array node. Only table nodes are expected
2017-10-06 17:53:47 - Converting file /home/user/public_html/dev/admin/system/data/import_phpVUah7D.txt to array. Start row number: 0. Rows count: 1
2017-10-06 17:53:47 - Starting import data from array. Mode: commit
2017-10-06 17:53:47 - Insert into table orders done successfully
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_history. Skipping.
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_products. Skipping.
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_totals. Skipping.
2017-10-06 17:53:47 - Converting file /home/user/public_html/dev/admin/system/data/import_phpVUah7D.txt to array. Start row number: 1. Rows count: 1
2017-10-06 17:53:47 - Starting import data from array. Mode: commit
2017-10-06 17:53:47 - Incorrect structure of main Array node. Only table nodes are expected

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4078
  • Karma: +243/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Importing orders successfully
« Reply #10 on: October 06, 2017, 02:16:51 PM »
There is clear message that you do not have order_id to insert into order_history.

2017-10-06 17:53:47 - Missing relation ID order_id for update_or_insert action in table order_history. Skipping.

Can you post your import file?
We need your help to build better free open source eCommerce platform for everyone.
See how you can help

Offline totaffy

  • Newbie
  • *
  • Posts: 24
  • Karma: +1/-1
    • View Profile
Re: Importing orders successfully
« Reply #11 on: October 09, 2017, 10:41:16 AM »
Hi Abantecart,

I've attached the orders file, its afairly simple format and as exported from the site/imported into open office.

Yes I don't know the correct way to add values to the ID columns, so I've left them blank, for the purpose of attaching the file and would appreciate some direction.

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4078
  • Karma: +243/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Importing orders successfully
« Reply #12 on: October 09, 2017, 02:17:00 PM »
Since you are doing insert, there is no order id.
Remove orders.order_id column and try again.
We need your help to build better free open source eCommerce platform for everyone.
See how you can help