Home > Docs > Import Export Suite for WooCommerce > Resolve ID Conflict during Import in WooCommerce

Resolve ID Conflict during Import in WooCommerce

Last updated on June 6, 2023

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 in 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.
Unmapping the column
Unmapping the column: order_id

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 SKUs to link the products with their 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-ons 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.

Advanced options during import of orders
Advanced options during the import of orders
  • 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 storeEnable 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, and #345; order #123 is deleted from the store before importing orders #234, and #345.

Product Import

Advanced options during import of products
Advanced options during the import of products
  • If the 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 the product as per data from the input file.
  • 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 in the store.
    • SKU: The products are either looked up based on their ID or SKU as per the selection.
  • Skip import of new products:
    • Yes: The option will not import new products from the input file.
    • No: The option will import a new product from the input file.
      • If product ID conflicts with an existing Post ID: Every post in the WooCommerce store is assigned a unique Post ID on creation. The post types could be the product, coupon, order, pages, media, etc.
        • Skip item: Skips import of a particular product if there is a conflict in Post ID with an existing post.
        • Import as new item: Imports product with a new id.
  • 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- Enable to remove products from your store which are not present in the input file. For e.g, if you have product A in your store and your import file has product B, C; product A is deleted from the store before importing B and C.

User Import

Advanced options during import of users
Advanced options during the import of users
  • 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 ID/Email/Username as per the selection.
  • Existing user :
    • 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