8

Is there a way to remove sample data in Magento2 without uninstalling/re-installing Magento?

I want this because I changed settings in my backend that I don't want to be removed.

1
  • Did the solution work for you?
    – Mukesh
    Mar 7, 2016 at 9:21

3 Answers 3

8

bin/magento sampledata:remove to completely remove sample data. bin/magento sampledata:reset is used to update sample data before updating Magento application.

+1 for taking backup before doing so. bin/magento setup:backup --db creates a backup for the database.

Ref: http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-sample-data-other.html

2
  • 1
    it remove only product images nothing else
    – HaFiz Umer
    Nov 27, 2019 at 11:31
  • how can remove default products ?
    – HaFiz Umer
    Nov 27, 2019 at 11:31
4

run this in the console bin/magento sampledata:reset.
And backup your db in case I'm wrong.

1
  • Sir it gives me an error [Composer\Downloader\TransportException] Content-Length mismatch after running the above command
    – Asad Khan
    Oct 29, 2019 at 11:14
0

Use this command on command line:

bin/magento sampledata:remove 

For More Detail use this : http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-sample-data-other.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.