magenxcommerce / module-sample-data
Sample Data fixtures
Installs: 109
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:magento2-module
Requires
- php: ~7.3.0||~7.4.0
- magenxcommerce/framework: 103.0.*
Suggests
- magenxcommerce/sample-data-media: Sample Data version: 100.4.*
Replaces
- magento/module-sample-data: *
- dev-placeholder
- dev-2.4.3-release
- dev-default
- 100.4.1.x-dev
- 100.4.1
- 100.4.0.x-dev
- 100.4.0
- 100.3.5.x-dev
- 100.3.5
- 100.3.4.x-dev
- 100.3.4
- 100.3.3.x-dev
- 100.3.3
- 100.3.2.x-dev
- 100.3.2
- 100.3.1.x-dev
- 100.3.1
- 100.3.0.x-dev
- 100.3.0
- 100.2.7.x-dev
- 100.2.7
- 100.2.6.x-dev
- 100.2.6
- 100.2.5.x-dev
- 100.2.5
- 100.1.6.x-dev
- 100.1.6
- 2.4.3.x-dev
- 2.4.2.x-dev
- 2.4.1.x-dev
- 2.4.0.x-dev
- 2.3.7.x-dev
- 2.3.6.x-dev
- 2.3.5.x-dev
- 2.3.4.x-dev
- 2.3.3.x-dev
- 2.3.2.x-dev
- 2.3.1.x-dev
- 2.3.0.x-dev
- dev-2.3.6-p1
- dev-2.4.1-p1
- dev-2.4.2-p1
- dev-2.4.2-p2
- dev-2.4.3-p1
- dev-2.4.3-p2
- dev-2.3.7-p1
- dev-2.3.7-p2
This package is auto-updated.
Last update: 2024-11-21 11:31:55 UTC
README
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.
Deploy Sample Data
You can deploy sample data from one of the following sources:
- From the Magento composer repository, optionally using Magento CLI
- From the Magento GitHub repository
If your Magento code base was cloned from the mainline 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.
Deploy Sample Data from Composer Repository
To deploy sample data from the Magento composer repository using Magento CLI:
- If your Magento instance is already installed, skip this step. Otherwise, in the Magento root directory, run:
# composer install
. - In the Magento root directory, run:
# bin/magento sampledata:deploy
. This command collects the dependencies from thesuggest
sections of thecomposer.json
files of modules, which suggest to install sample data (likeMagento_Catalog
,Magento_Sales
, and so on).
To deploy sample data from the Magento composer repository without Magento CLI:
- Specify sample data packages in the
require
section of the rootcomposer.json
file, for example:
{
"require": {
...
"magento/module-catalog-sample-data": "{version}",
"magento/module-configurable-sample-data": "{version}",
"magento/module-cms-sample-data": "{version}",
"magento/module-sales-sample-data": "{version}"
....
}
}
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] (https://github.com/magento/magento2-sample-data/tree/develop/app/code/Magento)
- To update the dependencies, in the Magento root directory, run:
# composer update
Deploy Sample Data from GitHub Repository
To deploy sample data from the GitHub repository:
- Clone sample data from
https://github.com/magento/magento2-sample-data
. If your Magento instance was cloned from the mainline branch, choose the mainline branch when cloning sample data; choose thedevelop
branch if Magento was cloned fromdevelop
. - Link the sample data and your Magento instance by running:
# php -f <sample-data_clone_dir>/dev/tools/build-sample-data.php -- --ce-source="<path_to_your_magento_instance>"
Install Sample Data
Once the sample data is deployed, it will be installed automatically when you install or upgrade your Magento instance by using the command line.
Uninstall Sample Data
To remove the sample data modules from the code base, run one of the following commands from the Magento root directory:
- If sample data was deployed from the composer repository, run:
# bin/magento sampledata:remove
- If sample data was deployed from the GitHub repository and linked to your Magento instance, run:
# 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.
Reinstall Sample Data
If you have deleted certain entities provided by sample data and want to restore them, take the following steps:
- From the Magento root directory, run the following command:
# bin/magento sampledata:reset
- Upgrade Magento as usual.
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.
Documentation
You can find the more detailed description of sample data manipulation procedures at https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-sample-data.html.