customize the code according to your requirement i have written it for one my work where i needed to export products from magento 1. i this code am just taking the sku, id , and price you can take other things as well if you want.
// output headers so that the file is downloaded rather than displayed
header('Content-Type: text/csv; charset=utf-8'...
I understood your concern, that you want to add new products, update existing products price and product attribute value without mess up with old data.
I recommended you to create a patch command to import-products,
In this patch include below conditions
Check Website code and Store view condition
Whether the product has existing or not
To update any data, ...
You can create a CRON workflow and reuse the module-import-export model to import any entity.
This is an example class to define the Magento import model.
use Magento\ImportExport\Model\Import\Adapter as ImportAdapter;
I think you are looking for this program example, which might be best option. There is also a note about images in comments.
I would consider, having some sort of rollback strategy along with cron module, something like (pseudo code)
take product data dump
run cron import
if Import successful
else if import fail
You also can create different columns with the attribute_code of your custom attributes & fill the data into it & upload the file. It will works with it as well.
I have create my csv file like this:
; - is a ...
Yes, sure. You can use a third-party tool called Skyvia for this purpose. It connects to Magento via its API and allows exporting all major Magento tables in CSV files. It has a free account, too, so you can test it. Saves a lot of time as requires little to no configuration and coding
You can add exportButton to your custom grid.