# How to Define my own Data Set with the Installer¶

The Akeneo PIM allows to prepare a data set to use during the installation.

You can configure the data set in the app/config/parameters.yml file:

  1 2 3 4 5 6 7 8 9 10 11 12 13 # /app/config/parameters.yml parameters: database_driver: pdo_mysql database_host: localhost database_port: ~ database_name: akeneo_pim database_user: akeneo_pim database_password: akeneo_pim locale: en secret: ThisTokenIsNotSoSecretChangeIt installer_data: PimInstallerBundle:icecat_demo_dev # use PimInstallerBundle:minimal for minimal data set 

The following steps allow you to easily define your own basic entities when you install the PIM.

## Create a Bundle¶

Create a new bundle:

  1 2 3 4 5 6 7 8 9 10 # /src/Acme/Bundle/InstallerBundle/AcmeInstallerBundle.php

Register it into AppKernel.php:

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 class AppKernel extends OroKernel { /** * {@inheritdoc} */ public function registerBundles() { $bundles = array(); // Add my own bundles$bundles[] = new Acme\Bundle\InstallerBundle\AcmeInstallerBundle(); return \$bundles; } } 

Create a directory Resources/fixtures/mydataset in your bundle.

Copy the *.yml and *.csv files from Installer bundle into the mydataset directory of your bundle.

Then edit the files, for example, to declare your own channels:

 1 2 3 4 5 6 7 8 9 # /src/Acme/Bundle/InstallerBundle/Resources/fixtures/mydataset/channels.yml channels: default: label: Default locales: - en_US currencies: - USD tree: default 

Tip

Take a look at Pim/Bundle/InstallerBundle/Resources/fixtures/minimal to see what is the expected format and which fixtures are absolutely needed. All fixtures can be created in CSV or YAML.

## Install the DB¶

Update the app/config/parameters.yml to use your data set:

  1 2 3 4 5 6 7 8 9 10 11 # /app/config/parameters.yml parameters: database_driver: pdo_mysql database_host: localhost database_port: null database_name: akeneo_pim database_user: root database_password: root locale: en secret: ThisTokenIsNotSoSecretChangeIt installer_data: 'AcmeInstallerBundle:mydataset' 

You can now (re)install your database by running:

> php app/console pim:installer:db --env=dev


## Load individual fixture files¶

Fixture files can be loaded individually by using the pim:installer:load-fixtures command :

> php app/console pim:installer:load-fixtures src/Acme/Bundle/InstallerBundle/Resources/fixtures/mydataset/*
`

Note

The fixtures files can be loaded multiple times, objects will be updated instead of being created on successive calls. This command also takes care of loading the fixtures in the right order.