Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Magento sample data includes a sample store, complete with more than 250 products (about 200 of them are configurable products), categories, promotional price rules, CMS pages, banners, and so on. Sample data uses the Luma theme on the storefront.
Installing sample data is optional.
Technically, sample data is a set of regular Magento modules, which can be deployed and installed together with the Magento instance, or later in the scope of upgrade.
You can deploy sample data from one of the following sources:
If your Magento code base was cloned from the master
branch, you can use either source of the sample data. If it was cloned from the develop
branch, use the GitHub repository and choose to get sample data modules from the develop
branch.
To deploy sample data from the Magento composer repository using Magento CLI:
# composer install
.# bin/magento sampledata:deploy
. This command collects the dependencies from the suggest
sections of the composer.json
files of modules, which suggest to install sample data (like Magento_Catalog
, Magento_Sales
, and so on).To deploy sample data from the Magento composer repository without Magento CLI:
require
section of the root composer.json
file, for example: Where <version>
is the version of the packages; it should correspond to the version of the Magento instance.
Each package corresponds to a sample data module. The complete list of available modules can be viewed in the sample data GitHub repository
# composer update
To deploy sample data from the GitHub repository:
https://github.com/magento/magento2-sample-data
. If your Magento instance was cloned from the master
branch, choose the master
branch when cloning sample data; choose the develop
branch if Magento was cloned from develop
.# php -f <sample-data_clone_dir>/dev/tools/build-sample-data.php -- --ce-source="<path_to_your_magento_instance>"
Once the sample data is deployed, it will be installed automatically when you install or upgrade your Magento instance either by using the Magento Setup Wizard or from the command line.
To remove the sample data modules from the code base, run one of the following commands from the Magento root directory:
# bin/magento sampledata:remove
# php -f <sample-data_clone_dir>/dev/tools/build-sample-data.php – --command=unlink --ce-source="<path_to_your_magento_instance>"
To delete all the products and other entities provided by the sample data modules, delete the database and reinstall Magento with a clean database.
If you have deleted certain entities provided by sample data and want to restore them, take the following steps:
# bin/magento sampledata:reset
The deleted sample data entities will be restored. Those entities, which were changed, will preserve these changes and will not be restored to the default view.
You can find the more detailed description of sample data manipulation procedures at http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-sample-data.html