Home » Magento7 July 2009

How to Install Sample Data for Magento?

Remember that, Sample Data must be installed prior to the basic Magento Installation. But never mind if you forgot to install sample data before installing Magento.

Here, I will show you how you can install sample data after you have installed Magento.

1) Download Sample Data zip file from Magento Website

2) Extract the zip file

3) Drop all the tables from your magento database. It would be easy to drop the magento database and then recreate it instead of dropping individual tables. This can be done either through Database Manager or PhpMyAdmin.

4) Import sample data sql file into your magento database.

# Remember that, you have to drop all tables from your magento database before importing the sample sql file. You will get error afterward if you import the sample data without dropping tables from your magento database. Therefore, step 3 is important.

5) Go to your magento installation folder and delete local.xml file present inside app/etc folder.

6) Reinstall magento (i.e. if you have uploaded magento inside http://yourdomain.com/magento then type the address in your browser’s address bar :))

# After your installation is complete, you may get error something like this:
Integrity constraint violation: 1062 Duplicate entry ‘1’ for key 1

Check if app/etc, var, and media folders are writable. They should be writable. Change their CHMOD to 777.

Clear your browser cache or open your website in another browser and you are done :)


Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed
  • Pingback: robert()

  • Jaime

    Hello… I cannot avoid “Integrity constraint violation” error

  • Jaime

    Hello… I cannot avoid “Integrity constraint violation” error

  • Atit

    Thanks for all the help.. It worked wonders.. Thank you sooooo much….

  • Muhammadtalha

    Thanks. I tried this on Magento 1.6 and it worked.


  • Anes P.A

    Hi pal, I do as per your suggestion , but got “The page isn’t redirecting properly”

    meaage and stop the process . How it can remedy pls reply me ASAP I am worried

    thanks Anes

  • Please check:

    1) Safe_mode should be Off in php.ini
    2) These folders should have permission set to 777.
    – app/etc
    – var
    – media

  • vishwa

    I have used magento sample data for vs1.6.1.0 its work me thank you Mukesh

  • satish

    thanks. it saved my time

  • rajesh

    Hi folks .
    how to install sample data in magento ? i tell to u installed sample data before install magento if ur database name less than 7 letteres but me database name too large onlinemu_shop i cant skip and avoid letters .. please help me

  • Abdul-Baasit Ismail

    thank Gahd fo this

  • yasin

    thanks, it helps a lot.

  • nidheesh

    thanks mukesh

  • suman

    thanks man , keep up the good work