Provide Magento Sample Data
Import Sample Data
A detailed step by step guide of a complete Pacemaker Import Community installation including a fresh Magento installation and sample data is available as a comprehensive guide in the general Pacemaker Guides section as well. |
When this is the first import, the default import directory <magento-install-dir>/var/pacemaker/import
must get created.
cd <magento-install-dir>
var/pacemaker/import
directorymkdir var/importexport
All the files with the sample data (attribute-sets, attributes, categories, and products) have to get copied to this directory. The command to copy the sample data, including the images looks like this:
cp vendor/techdivision/import-sample-data/generic/data/attributes-set/add-update/*.csv var/importexport \
&& cp vendor/techdivision/import-sample-data/generic/data/attributes/add-update/*.csv var/importexport \
&& cp vendor/techdivision/import-sample-data/generic/data/categories/add-update/*.csv var/importexport \
&& cp vendor/techdivision/import-sample-data/generic/data/products/add-update/*.csv var/importexport
<IMPORT-DIRECTORY>/<PREFIX>.ok <IMPORT-DIRECTORY>/<PREFIX>_<FILENAME>.ok <IMPORT-DIRECTORY>/<PREFIX>_<FILENAME>_<COUNTER>.ok which results in one of import-cli-simple/projects/sample-data/tmp/magento-import.ok import-cli-simple/projects/sample-data/tmp/magento-import_20170203.ok import-cli-simple/projects/sample-data/tmp/magento-import_20170203_01.ok In case we’ve a bunch, the flag file MUST contain the name of the CSV files that have to be imported within the next iterations. If the flag file would be named
the importer has to be invoked four times (because the example above is NO bunch), whereas on each innovation, the next file will be imported and removed from the flag file. Have a look in the subdirectories of |
vendor/bin/import-simple import:create:ok-file \
&& vendor/bin/import-simple import:attributes:set \
&& vendor/bin/import-simple import:attributes \
&& vendor/bin/import-simple import:categories \
&& vendor/bin/import-simple import:products
The first command creates the mandatory .OK file that signals, that all import artifacts are on-place and the second command finally starts the import with the add-update operation on your Magento 2 installation.
The import commands support an argument as well as several options.
In Case the imported Sample Data are not displayed in the Store, please run the Magento Indexer and clear all caches as well Run indexer
|