Documentation/Import Export Suite for WooCommerce/How to resolve ID conflict during import in WooCommerce

How to resolve ID conflict during import in WooCommerce

The WooCommerce Import Export plugin by WebToffee facilitates easy import and export irrespective of the post types like products, orders, users, coupons, etc. to or from your WooCommerce website.

The import export suite plugin is equipped to handle all types of errors that are commonly observed on import or export.

One of the common errors that people face while importing is the conflict caused by post-ID. When an ID conflict occurs, the import of products, orders, or users may fail. Upon viewing the log, you will see that the failure of import is due to “Importing (ID) conflicts with an existing post”.

WordPress assigns a unique ID for every post type, such as products, orders, users, tags, comments, categories, pages, etc. All these are stored in WordPress in the wp_posts table. Therefore, it is likely to create a conflict on importing IDs that are already present on the site.

One way to avoid this type of error is to ensure that the post ID does not already exist as an Order ID, Page ID, Attachment ID, etc.

Workarounds

Some of the workarounds for ID conflict issues are stated below:

  • You can delete the ID column from the CSV before importing. WordPress will automatically assign a new ID for the posts.
  • You will just have to manually remove the IDs from the CSV which are causing the conflicts and import other values. In this case, a new ID will be assigned to the removed posts.
  • Unmap or deselect the id column from the mapping section (step 3) of the import process. Unmapping is similar to removing the entire column.
Unmap Order ID Column

Specific Scenarios

  • ID conflict with Variable Product: Usually variable products are linked using the product ID, therefore deleting or unmapping the ID column will result in importing the variable products as simple products. To overcome this, you can use SKU to link the products with its parent products.
  • ID conflict with Order ID: When the order ID columns are deleted or unmapped, the existing orders will be imported with a new order number. One of the workarounds that we suggest would be to install and activate our free plugin Sequential Order Number for WooCommerce which will retain the order number without causing the conflict even without deleting the iD column.

Advanced settings in the plugin

The add-on plugin carries out the import process in 4 steps consecutively. The advanced settings of each of the add-on are integrated in step 4 of the import process.

The advanced settings of each add-on are explained in detail below:

Order Import

Some of the fields provided within the advanced options are specifically for overcoming ID conflicts.

Order Import-Step 4
  • Update Only
    • Yes – The store is updated with the data from the input file only for matching/existing records from the file. If the post ID of the order being imported exists already(for any of the other post types like coupon, product, user, pages, media, etc) skip the order from being inserted into the store.
    • No – The entire data from the input file is processed for an update or insert as the case may be.
  • If order exists in the store – Orders are matched by their order IDs.
    • Skip – Retains the order in the store as is and skips the matching order from the input file.
    • Update – Update order as per data from the input file
      • Update even if empty values – Updates the order data respectively even if some of the columns in the input file contain an empty value.
  • If conflict with an existing Post ID – All the items within WooCommerce/WordPress are treated as posts and assigned a unique ID as and when they are created in the store. The post ID uniquely identifies an item irrespective of the post type be it order /product /pages /attachments/revisions etc.
  • Skip – If the post ID of the order being imported exists already(for any of the other post types like coupon, product, user, pages, media, etc.) skip the order from being inserted into the store.
  • Import as a new item – Insert the order into the store with a new order ID(next available post ID) different from the value in the input file.
  • Link products using SKU instead of Product ID
    • Yes – Link the products associated with the imported orders by their SKU.
    • No – Link the products associated with the imported orders by their Product ID. In case of a conflict with IDs of other existing post types, the link cannot be established.
  • Delete non-matching orders from store– Select ‘Yes’ if you need to remove the orders from your store which are not present in the input file. For e.g, if you have order #123 in your store and your import file has orders #234, #345; order #123 is deleted from the store prior to importing orders #234, #345.

Product Import

  • Update Only
    • Yes – The store is updated with the data from the input file only for matching/existing records from the file.
    • No – The entire data from the input file is processed for an update or insert as the case may be.
  • Match products by their:
    • ID: The products are either looked up based on their ID or SKU as per the selection. If the post ID of the product being imported exists already(for any of the other post types like coupon, order, user, pages, media etc) skip the product from being updated into the store.
    • SKU: The products are either looked up based on their ID or SKU as per the selection.
  • If a product exists in the store – products are matched by their product IDs.
    • Skip – Retains the product in the store as is and skips the matching product from the input file.
    • Update – Update product as per data from the input file
      • Update even if empty values – Updates the product data respectively even if some of the columns in the input file contain an empty value.
  • Use SKU to link up-sells, cross-sells and grouped products: Enable to import up-sells,cross-sells and grouped products using the product SKU.
  • Delete non-matching products from store- Select ‘Yes’ if you need to remove products from your store which are not present in the input file. For e.g, if you have a product A in your store and your import file has products B, C; the product A is deleted from the store prior to importing B and C.

User Import

WooCommerce User Import-Step 4
  • Update Only
    • Yes – The store is updated with the data from the input file only for matching/existing records from the file.
    • No – The entire data from the input file is processed for an update or insert as the case may be.
  • Match users by their: The users are either looked up based on their User ID/email/Username as per the selection.
  • If the user exists in the store:
    • Skip – Retains the user in the store as is and skips the matching user from the input file.
    • Update – Update user as per data from the input file
  • Was this article helpful?
  • YesNo