How to Customize the Installation

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

The idea is to allow you to setup your own catalog structure or your own demo data.

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
<?php

namespace Acme\Bundle\InstallerBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AcmeInstallerBundle extends Bundle
{
}

Register it in AppKernel.php:

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

         ...

         return $bundles;
     }
 }

Add your own Data

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

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

Note

Since 1.4, we aim to use only csv format in the installer in order to make it easier to export data from the PIM and to put it back into the installer fixtures to be able to deploy on other environments.

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

You can take a look at Pim/Bundle/InstallerBundle/Resources/fixtures/minimal to see what the expected format is and which fixtures are absolutely needed, then you can draw heavily on Pim/Bundle/InstallerBundle/Resources/fixtures/icecat_demo_dev to add optional objects.

Install the DB

Update 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