|
| 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 | +##From Composer |
| 10 | +To deploy sample data from Composer, use: |
| 11 | + |
| 12 | +1. In your composer.json, specify the following: |
| 13 | + - repository: |
| 14 | + ``` |
| 15 | + { |
| 16 | + "repositories": [ |
| 17 | + { |
| 18 | + "type": "composer", |
| 19 | + "url": "http://packages.magento.com/" |
| 20 | + } |
| 21 | + ], |
| 22 | + } |
| 23 | + ``` |
| 24 | +
|
| 25 | + - packages: |
| 26 | + ``` |
| 27 | + { |
| 28 | + "require": { |
| 29 | + "magento/sample-data": "{version}" |
| 30 | + } |
| 31 | + } |
| 32 | + ``` |
| 33 | + |
| 34 | + where version is either an exact version or semantic version syntax. |
| 35 | +2. From your Magento root directory, run composer update. |
| 36 | +
|
| 37 | +##From repository |
| 38 | +To deploy sample data from repository, use: |
| 39 | +
|
| 40 | +1. Clone the sample data repository. For example, git clone [https://github.com/magento/magento2-sample-data.git](https://github.com/magento/magento2-sample-data.git) |
| 41 | +2. Link the sample data repository with your Magento CE repository as follows: |
| 42 | + ``` |
| 43 | + php -f <sample-data-root>/dev/tools/build-sample-data.php -- --ce-source="path/to/magento/ce/edition" |
| 44 | + ``` |
| 45 | +
|
| 46 | +#Installation |
| 47 | +
|
| 48 | +Once deployed, the sample data can be installed using the Magento Setup Wizard (web installation) or using CLI (console installation). |
| 49 | +
|
| 50 | +###Web Installation |
| 51 | +
|
| 52 | +When installing the Magento application using the Magento Setup Wizard, you can choose to install the sample data at Step 4. Customize Your Store by selecting the *Use Sample Data* check box. |
| 53 | +
|
| 54 | +###Console Installation |
| 55 | +
|
| 56 | +The steps required to install sample data are different depending on whether the Magento application itself is installed: |
| 57 | +
|
| 58 | +- If the Magento application is not installed, you can install it with sample data at once. Use the following code sample as an example: |
| 59 | +``` |
| 60 | +php -f index.php install --base-url=http://localhost/magento2/ \ |
| 61 | + --backend-frontname=admin \ |
| 62 | + --db-host=localhost --db-name=magento --db-user=magento --db-password=magento \ |
| 63 | + --admin-firstname=Magento --admin-lastname=User --admin-email= [email protected] \ |
| 64 | + --admin-user=admin --admin-password=iamtheadmin --language=en_US \ |
| 65 | + --currency=USD --timezone=America/Chicago |
| 66 | + --use-sample-data |
| 67 | +``` |
| 68 | +- If the Magento application is already installed, to install the sample data, enter the following commands in the order shown: |
| 69 | +``` |
| 70 | +<path to Magento 2 bin dir>/magento setup:upgrade |
| 71 | +<path to Magento 2 bin dir>/magento sampledata:install <your Magento administrator user name> |
| 72 | +``` |
| 73 | +
|
| 74 | +For example, |
| 75 | +``` |
| 76 | +/var/www/magento2/bin magento setup:upgrade |
| 77 | +/var/www/magento2/bin magento sampledata:install admin |
| 78 | +``` |
| 79 | +
|
| 80 | +#Removing Sample Data |
| 81 | +
|
| 82 | +There are no special scripts that assist in uninstalling of sample data. |
| 83 | +To remove sample data, you must delete the database and re-install Magento with a new empty database |
0 commit comments