Just can't get data to import

A forum where issues related to the DataPort utility can be discussed.
Post Reply
User avatar
draneb
Captain (CAPT)
Captain (CAPT)
Posts: 314
Joined: Sun Jun 12, 2005 4:07 pm
Location: Texas
Contact:

Just can't get data to import

Post by draneb » Mon Sep 21, 2009 7:48 pm

Hello,

I am running two AbleCommerce 7.0.3 stores. I need to export about 1400 products (and anything associated with those products) from Store A and import them into Store B. Is there a successful method for doing this?

Some of the sub categories won't import. All the main categories import. I get this error

Importing 50 Categorys
Exception has been thrown by the target of an invocation.
Import unsuccessful for Category
CategoryId = 59
Name = Personalized NFL Pub Sign with Wood Frame
Error message: Exception has been thrown by the target of an invocation.

at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.b(Object& A_0)
at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.a(Array A_0, Type A_1, String A_2, String A_3, String A_4, Object A_5, aa A_6, z A_7, ae A_8, c A_9, String A_10)

Base Exception: Invalid parent category specified.
Parameter name: parentId
at CommerceBuilder.Catalog.Category.UpdateParent(Int32 categoryId, Int32 parentId)
at CommerceBuilder.Catalog.Category.Save()
46 Category(s) imported, 0 Category(s) updated.
Category(s) Import Complete...

For the Products then is what I have tried so far...
Download AC7 Store Data
Selected Data - Warehouses, Vendors, Product Templates, Categories, Products, Custom Fields (not quite sure what all fields to export in order to import products successfully)

Then Import AC7 Store Data, choose the XML file, select Only IMPORT new objects (Skip Updating existing objects)
None of the products are importing and I get the following errror for every product

Exception has been thrown by the target of an invocation.
Import unsuccessful for Product
ProductId = 1410
Name = Texas Longhorns College Football Locker Room Print
Error message: Exception has been thrown by the target of an invocation.

at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.b(Object& A_0)
at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.a(Array A_0, Type A_1, String A_2, String A_3, String A_4, Object A_5, aa A_6, z A_7, ae A_8, c A_9, String A_10)

Base Exception: The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Warehouses_ac_Products_FK1". The conflict occurred in database "uptown", table "uptown.ac_Warehouses", column 'WarehouseId'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteScalar(DbCommand command)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command)
at CommerceBuilder.Data.Database.ExecuteScalar(DbCommand command)
at CommerceBuilder.Products.Product.BaseSave()
at CommerceBuilder.Products.Product.Save()

Can anyone tell where I went wrong? Something with Warehouse and Warehouse ID?

Thank you very much!
AC 7.0.3 build 13937

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Just can't get data to import

Post by jmestep » Tue Sep 22, 2009 3:46 am

Yes, there is already an existing warehouse id in the store you are trying to import into matching the one you are trying to import. So don't import that field. On the category, that looks like it can't add a subcategory to a parent category because it doesn't exist. Fixing that might just be a matter of moving a category around after the import. On the options--> settings, be sure to set your chunk size larger than the default and - try 500. That helps keep things matched up.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
draneb
Captain (CAPT)
Captain (CAPT)
Posts: 314
Joined: Sun Jun 12, 2005 4:07 pm
Location: Texas
Contact:

Re: Just can't get data to import

Post by draneb » Tue Sep 22, 2009 3:46 pm

Hi Judy! Still no luck... After not inlcuding the warehouse field in export I get this error for all products:

Exception has been thrown by the target of an invocation.
Import unsuccessful for Product
ProductId = 0
Name = Ivory Sparkling Entwined Flower Girl Basket
Error message: Exception has been thrown by the target of an invocation.

at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.b(Object& A_0)
at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.a(Array A_0, Type A_1, String A_2, String A_3, String A_4, Object A_5, aa A_6, z A_7, ae A_8, c A_9, String A_10)

Base Exception: The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Warehouses_ac_Products_FK1". The conflict occurred in database "uptown", table "uptown.ac_Warehouses", column 'WarehouseId'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteScalar(DbCommand command)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command)
at CommerceBuilder.Data.Database.ExecuteScalar(DbCommand command)
at CommerceBuilder.Products.Product.BaseSave()
at CommerceBuilder.Products.Product.Save()

I tried importing with the original product ids but then thought that could be causing a problem so I removed the product id column and it made no difference.
I still see the Warehouse and Warehouse ID mentioned even though I did not include it in the export.
Each time the import is unsuccessful I restore the database to its original state.

This is tough... What should I try next?
Thank you!
AC 7.0.3 build 13937

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Just can't get data to import

Post by jmestep » Wed Sep 23, 2009 5:43 am

Maybe I am misunderstanding. Did you do a csv import? In either that or xml, try changing the warehouse/warehouse id to blank or one of the ones in the database you are importing into.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
draneb
Captain (CAPT)
Captain (CAPT)
Posts: 314
Joined: Sun Jun 12, 2005 4:07 pm
Location: Texas
Contact:

Re: Just can't get data to import

Post by draneb » Wed Sep 23, 2009 6:48 am

It is XML. That's weird... even though the warehouse id and warehouse name stayed the same I had to remove those fields from the file. I also had to remove the taxid field and one or two others.

Thanks Judy! I can see some products now. :D
AC 7.0.3 build 13937

User avatar
draneb
Captain (CAPT)
Captain (CAPT)
Posts: 314
Joined: Sun Jun 12, 2005 4:07 pm
Location: Texas
Contact:

Re: Just can't get data to import

Post by draneb » Fri Sep 25, 2009 7:31 am

Ohh noooo, more problems.

The products in Store B are all associated with a template id and template name.

Well, the existing products in Store A are also already associated with a template id and template name. So, when I try to import the products from Store B it will import the products and templates but it is not associating any of the new products with their respective templates.

It must be matching them based on the template id and not the template name.
Are there any suggestions?

Thank you!
AC 7.0.3 build 13937

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Just can't get data to import

Post by Naveed » Fri Sep 25, 2009 10:21 am

if you are specifying both the template Id and template name, then it will prefer match based upon template Id. Set the template Id value to zero (in product records) and I should match using the template name.

User avatar
draneb
Captain (CAPT)
Captain (CAPT)
Posts: 314
Joined: Sun Jun 12, 2005 4:07 pm
Location: Texas
Contact:

Re: Just can't get data to import

Post by draneb » Fri Sep 25, 2009 12:52 pm

Hi Naveed,

After I read your post I set all of the template ids to 0 in the xml file but it still did not match the products with the template names :(
and when I go in the Admin and look under Product Templates all of the templates imported fine but under Products they all read 0
products associated with them.

I have 16 pages of templates and was trying to avoid having to manually assign 1,416 products to specific templates. Ouch. That hurts just thinking about it.
Do you think it may be a glitch in Dataport?

Thank you.
AC 7.0.3 build 13937

User avatar
draneb
Captain (CAPT)
Captain (CAPT)
Posts: 314
Joined: Sun Jun 12, 2005 4:07 pm
Location: Texas
Contact:

Re: Just can't get data to import

Post by draneb » Sun Sep 27, 2009 5:38 pm

Ugh, I am at a stand still. I deleted the product template id all together after trying 0 for the value and still no luck. This is what it looks like in the admin... 0 products associated with each template but all products did import. I am running two stores and I will be doing quite a bit of product transferring between the two to avoid doing double work. The products and templates will have different ids because the stores are not identical.

Image

Is it perhaps the next version of dataport that will match the products with templates names?
AC 7.0.3 build 13937

User avatar
draneb
Captain (CAPT)
Captain (CAPT)
Posts: 314
Joined: Sun Jun 12, 2005 4:07 pm
Location: Texas
Contact:

Re: Just can't get data to import

Post by draneb » Wed Sep 30, 2009 6:40 am

Does anyone have any suggestions or should I began the tedious task of going through 16 pages of templates and assigning 1,416 products to them?

Every day my store can't be open is disastrous for me.

Thank you.
AC 7.0.3 build 13937

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Just can't get data to import

Post by jmestep » Wed Sep 30, 2009 10:01 am

Did you try downloading the products via the dataport using .csv, then changing the template and uploading again?
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Just can't get data to import

Post by mazhar » Wed Sep 30, 2009 10:20 am

When you changed the ProductTemplateId to 0 for related product template you must also update the product template id entry find in associated products as well. Have a look at following sample XML file and check ProductTemplateId entry for product and actual product template set to 0.

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Just can't get data to import

Post by Naveed » Wed Sep 30, 2009 10:35 am

With the above provided sample by Mazhar you can see that how you can associate products to templates using template names. Under each product name provide the Product template id as zero, and use the product template name field for associations.
<Product>
...
...
<ProductTemplateId>0</ProductTemplateId>
<ProductTemplate>Test Template</ProductTemplate>

</Product>
Even if you are using the CSV import/export, you can use the same technique.

Post Reply