Installation
A detailed guide of a complete Pacemaker Import Community installation including a fresh Magento installation is available as a comprehensive guide in the general Pacemaker Guides section as well. |
Install the Pacemaker Import Community and sample data
When you have got a full running Magento 2 instance, you additionally need to download the sample CSV import
files from the repository techdivision/import-cli-simple
.
Add the Pacemaker Import Community repository and the Sample data repository to your Magento installation:
cd <magento-install-dir>
cd <magento-install-dir> \
&& composer require techdivision/import-cli-simple \
&& composer require techdivision/import-sample-data
The Pacemaker CLI and the Sample Data files as well for your Magento 2 version will find place at listed locations in the current Magento instance under:
-
<magento-install-dir>/vendor/techdivision/import-cli-simple
-
<magento-install-dir>/vendor/techdivision/import-sample-data
At this time of the Sample data installation, the import data are only stored as CSV files. the import must be initialized in a separate step |
Import Sample Data
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
|