Odoo determines whether to update or newly create a Product via CSV based on the external_id field.
When this column in the CSV is empty, Odoo assumes it is a new Product, an therefore tries to create a new Product.
When this column is set, Odoo attempts to find an existing record with that external_id and either updates the Product (if that external_id is found) or creates a new Product (with this exact external_id).
That being said, if you happen to be able to re-import your Products from scratch from CSV (i.e. by removing the barcodes from all currently existing Products and then archiving them) you could simply duplicate the barcode column in your CSV and use that duplicated column as your external_id. This way, when importing CSV files again in future, you can again use that same concept, ultimately representing the barcode, to match your Products.
Thank you. Your solution works. Any way to automate this inside Odoo maybe?