®Magento Tutorials

Magento how to delete default sample data

In Magento, you can delete the default sample data by using the command line interface (CLI) to run the “sampledata:remove” command. Here are the steps to delete the default sample data:

Connect to your server using SSH or a terminal
Navigate to the Magento root directory by using the “cd” command
Run the following command to remove the sample data:

python

php bin/magento sampledata:remove

The command will remove the sample data and revert the database changes made during the sample data installation.
After that, you need to run the following command to clean the cache

python

php bin/magento cache:clean

Finally, you need to run the following command to re-index your data

python

php bin/magento indexer:reindex

It is important to note that removing the sample data will delete all of the sample products, categories, customers, and orders that were installed with the sample data. This action is irreversible, so you should be sure that you want to delete the sample data before running the command.

It’s also important to note that if you have made any customizations to the sample data, you may need to manually backup or move these changes before running the “sampledata:remove” command.

It’s recommended to take a backup of your database and files before running this command, just in case if you want to restore the sample data later.

About zohaibk

We develop useful addons for #E-Commerce and #CRM software to provide extra features.#PrestaShop,#Magento,#SugarCRM,#Vtiger & #Android #apps
View all posts by zohaibk →