Skip to content

Commit 98e1b9f

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

File tree

1 file changed

+42
-79
lines changed

1 file changed

+42
-79
lines changed

README.md

Lines changed: 42 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,72 @@
11
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.
22

3-
 
43
Installing sample data is optional.
5-
 
4+
65
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 ##
6+
7+
## Deploy Sample Data
108
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-
 
9+
10+
* From the Magento composer repository, optionally using Magento CLI
11+
* From the Magento GitHub repository
12+
1513
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-
 
2114

22-
1. If your Magento instance is already installed, skip this step. Otherwise, in the Magento root directory, run:
15+
### Deploy Sample Data from Composer Repository
2316

24-
```
25-
    composer install
26-
```
17+
To deploy sample data from the Magento composer repository using Magento CLI:
18+
19+
1. If your Magento instance is already installed, skip this step. Otherwise, in the Magento root directory, run: `# composer install`.
20+
2. In the Magento root directory, run: `# 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).
2721

28-
2. In the Magento root directory, run: 
29-
 
30-
```
31-
    # bin/magento sampledata:deploy
32-
```
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-
 
3622
To deploy sample data from the Magento composer repository without Magento CLI:
37-
 
23+
3824
1. Specify sample data packages in the `require` section of the root `composer.json` file, for example:
39-
 
4025
```
4126
{
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-
 }
27+
"require": {
28+
...
29+
"magento/module-catalog-sample-data": "{version}",
30+
"magento/module-configurable-sample-data": "{version}",
31+
"magento/module-cms-sample-data": "{version}",
32+
"magento/module-sales-sample-data": "{version}"
33+
....
34+
}
35+
}
5136
```
52-
 
37+
5338
Where `<version>` is the version of the packages; it should correspond to the version of the Magento instance.
5439

5540
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)
5641

57-
2. To update the dependencies, in the Magento root directory, run:
58-
 
59-
```
60-
    composer update
61-
```
62-
 
42+
2. To update the dependencies, in the Magento root directory, run: `# composer update`
43+
6344
### Deploy Sample Data from GitHub Repository
64-
 
45+
6546
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-
 
47+
48+
1. Clone sample data from `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`.
49+
2. 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>"`
50+
7751
## Install Sample Data
7852
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-
 
53+
8154
## Uninstall Sample Data
8255
To remove the sample data modules from the code base, run one of the following commands from the Magento root directory:
8356

84-
- If sample data was deployed from the composer repository, run:
85-
86-
```
87-
# bin/magento sampledata:remove
88-
```
89-
90-
- If sample data was deployed from the GitHub repository and linked to your Magento instance, run:
57+
* If sample data was deployed from the composer repository, run: `# bin/magento sampledata:remove`
58+
* If sample data was deployed from the GitHub repository and linked to your Magento instance, run:
59+
`# php -f <sample-data_clone_dir>/dev/tools/build-sample-data.php – --command=unlink --ce-source="<path_to_your_magento_instance>"`
9160

92-
```
93-
php -f <sample-data_clone_dir>/dev/tools/build-sample-data.php – --command=unlink --ce-source="<path_to_your_magento_instance>"
94-
```
95-
 
9661
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-
 
62+
9863
## Reinstall Sample Data
99-
If you have deleted certain entities provided by sample data and want to restore them, take the following steps: 
64+
If you have deleted certain entities provided by sample data and want to restore them, take the following steps:
65+
66+
1. From the Magento root directory, run the following command: `# bin/magento sampledata:reset`
67+
2. Upgrade Magento as usual.
68+
69+
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.
10070

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-
 
10871
## 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)
72+
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)