Skip to content

Commit 24b76b7

Browse files
author
Leonid Poluyanov
committed
MAGETWO-45297: [Sample Data] Update README.md file
1 parent be1c99e commit 24b76b7

File tree

1 file changed

+87
-61
lines changed

1 file changed

+87
-61
lines changed

README.md

Lines changed: 87 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,109 @@
1-
# Introduction
2-
3-
Magento sample data uses the responsive Luma theme to display a sample store, complete with products, categories, promotional price rules, CMS pages, banners, and so on. You can use the sample data to come up to speed quickly and see the power and flexibility of the Magento storefront.
4-
5-
Installing sample data is optional; you can install it before or after you install the Magento software.
6-
7-
# Deployment
8-
9-
Deployment of Sample Data can be performed in three ways: using Magento CLI, composer and from GitHub repository.
10-
11-
## Using CLI
12-
13-
SampleData module is included to default scope of Magento CE modules. To deploy other sample data modules (e.g. ConfigurableSampleData, CatalogSampleData e.t.c) Magento CLI command can be used:
1+
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.
2+
3+
 
4+
Installing sample data is optional.
5+
 
6+
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.
7+
 
8+
 
9+
## Deploy Sample Data ##
10+
You can deploy sample data from one of the following sources:
11+
 
12+
 * From the Magento composer repository, optionally using Magento CLI
13+
 * From the Magento GitHub repository
14+
 
15+
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.
16+
 
17+
### Deploy Sample Data from Composer Repository ###
18+
 
19+
To deploy sample data from the Magento composer repository using Magento CLI:
20+
 
21+
22+
1. If your Magento instance is already installed, skip this step. Otherwise, in the Magento root directory, run:
1423

1524
```
16-
# bin/magento sampledata:deploy
25+
    composer install
1726
```
1827

19-
CLI command collects suggest node from composer.json files of modules which suggest to install sample data:
20-
28+
2. In the Magento root directory, run: 
29+
 
2130
```
22-
"suggest": {
23-
"magento/module-catalog-sample-data": "Sample Data version:1.0.0-beta"
24-
}
31+
    # bin/magento sampledata:deploy
2532
```
26-
27-
## Using Composer
28-
29-
Also it's possible to add needed sample data modules manually (via composer require or editing main composer.json file)
30-
31-
1. Specify packages
33+
 
34+
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).
35+
 
36+
To deploy sample data from the Magento composer repository without Magento CLI:
37+
 
38+
1. Specify sample data packages in the `require` section of the root `composer.json` file, for example:
39+
 
3240
```
3341
{
34-
"require": {
35-
...
36-
"magento/module-catalog-sample-data": "{version}",
37-
"magento/module-configurable-sample-data": "{version}",
38-
"magento/module-cms-sample-data": "{version}",
39-
"magento/module-sales-sample-data": "{version}"
40-
....
41-
}
42-
}
43-
{version} - Go to packages.magento.com and write down suitable versions of magento/sample-data and magento/sample-data-media (typically, you should choose the most recent version).
44-
```
45-
2. Run composer update from your Magento root directory
42+
    "require": {
43+
    ...
44+
       "magento/module-catalog-sample-data": "{version}",
45+
        "magento/module-configurable-sample-data": "{version}",
46+
        "magento/module-cms-sample-data": "{version}",
47+
        "magento/module-sales-sample-data": "{version}"
48+
        ....
49+
    }
50+
 }
51+
```
52+
 
53+
Where `<version>` is the version of the packages; it should correspond to the version of the Magento instance.
4654

47-
## From GitHub Repository
55+
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)
4856

49-
1. Clone Sample Data from https://github.com/magento/magento2-sample-data
50-
2. Link Sample Data and Magento Edition using tool <sample-data-ce-root>/dev/tools/build-sample-data.php
57+
2. To update the dependencies, in the Magento root directory, run:
58+
 
5159
```
52-
php -f <sample-data-ce-root>/dev/tools/build-sample-data.php -- --ce-source="path/to/magento/ce/edition"
60+
    composer update
5361
```
62+
 
63+
### Deploy Sample Data from GitHub Repository
64+
 
65+
To deploy sample data from the GitHub repository:
66+
 
67+
1. Clone sample data from `https://github.com/magento/magento2-sample-data`.
68+
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`.
69+
 
70+
 
71+
2. Link the sample data and your Magento instance by running:
72+
 
73+
```
74+
    php -f <sample-data_clone_dir>/dev/tools/build-sample-data.php -- --ce-source="<path_to_your_magento_instance>"
75+
```
76+
 
77+
## Install Sample Data
78+
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.
79+
 
80+
 
81+
## Uninstall Sample Data
82+
To remove the sample data modules from the code base, run one of the following commands from the Magento root directory:
5483

55-
# Installing
56-
57-
Being once deployed the Sample Data is available for installation through the Magento Setup Wizard or using CLI.
58-
59-
## Web Installation
60-
61-
Deployed SampleData modules have been selected to be installed by default. To prepare installation Magento with SampleData finish installation as you do it usual. In success page user will be notified about successfully installed SampleData
62-
63-
## Console Installation
64-
65-
Use Magento CLI installation command to install Magento as usual.
66-
67-
# Uninstalling
68-
69-
There is CLI command which allows to remove all sample data modules from Magento (only for case when sample data was installed via composer):
84+
- If sample data was deployed from the composer repository, run:
7085

7186
```
7287
# bin/magento sampledata:remove
7388
```
7489

75-
# Re-installation
76-
77-
To prepare sample data for re installation process run:
90+
- If sample data was deployed from the GitHub repository and linked to your Magento instance, run:
7891

7992
```
80-
# bin/magento sampledata:reset
93+
php -f <sample-data_clone_dir>/dev/tools/build-sample-data.php – --command=unlink --ce-source="<path_to_your_magento_instance>"
8194
```
95+
 
96+
To delete all the products and other entities provided by the sample data modules, delete the database and reinstall Magento with a clean database.
97+
 
98+
## Reinstall Sample Data
99+
If you have deleted certain entities provided by sample data and want to restore them, take the following steps: 
82100

83-
Then install or upgrade Magento as usual
101+
1. From the Magento root directory, run the following command:
102+
```
103+
    # bin/magento sampledata:reset
104+
```
105+
2. 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.
106+
 
107+
 
108+
## Documentation
109+
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] (http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-sample-data.html)

0 commit comments

Comments
 (0)