:: Version 3.2.0 ::

Automated installation

The installation of iTop is generally performed interactively using the “setup” page. However once information about the desired configuration has been collected by the setup page, the actual installation process is fully unattended and therefore can be automated.

In order to automate the iTop installation you'll need:

  • An XML response file containing the desired configuration options
  • The unattended_install.php script (see below)
If you use this for upgrading an existing iTop, be sure to purge APCu cache, as this script has no access to do this for your

Prerequisites

iTop directory and files have been copied to your server (Install iTop)

Response file

The response file is an XML file containing all the answers / choices to configure the application.

An example of the response file is the following:

default-params.xml
<?xml version="1.0" encoding="UTF-8"?>
<installation>
        <mode>install</mode>
        <preinstall>
                <copies type="array">
                        <copy>
                                <source>C:\inetpub\wwwroot\setup20\datamodel</source>
                                <destination>test_copy</destination>
                        </copy>
                </copies>
                <backup>
                        <configuration_file>../conf/production/config-itop.php</configuration_file>
                        <destination>../backups/__DB__-%Y-%m-%d.zip</destination>
                </backup>
        </preinstall>
        <source_dir>datamodel</source_dir>
        <source_env>production</source_env>
        <target_env>production</target_env>
        <workspace_dir/>
        <database>
                <server>localhost</server>
                <user>root</user>
                <pwd>root</pwd>
                <name>setup20</name>
                <prefix></prefix>
        </database>
        <url>http://localhost/setup20/</url>
        <admin_account>
                <user>admin</user>
                <pwd>admin</pwd>
                <language>FR FR</language>
        </admin_account>
        <language>IT IT</language>
        <selected_modules type="array">
                <module>authent-local</module>
                <module>itop-attachments</module>
                <module>itop-welcome-itil</module>
                <module>itop-profiles-itil</module>
                <module>itop-config-mgmt</module>
                <module>itop-service-mgmt</module>
                <module>itop-tickets</module>
        </selected_modules>
        <sample_data>1</sample_data>
        <options>
                <symlinks>1</symlinks>
                <mysql_bin_dir></mysql_bin_dir>
        </options>
</installation>

Generating the reponse file

The response file can be created manually using a text editor or generated by running the interactive setup with the additional parameter option[generate_config]=1.

This is achieved by adding ?option[generate_config]=1 at the end of the URL to specify this extra parameter. This gives the following sample URL:

  http://localhost/itop/setup/?option[generate_config]=1

Then run the setup as usual, but instead of launching the installation, stop at the “summary” step, and click on “XML config file” to open this section of the summary. You can then copy/paste the response file:

Generating the response file

Another way to get a response file is to retrieve the installation.xml file from an existing iTop installation. Each time the iTop installation completes, it creates a file install-<date>-<revision>.xml in the log directory of an existing iTop installation. You can use this file for automatically installing another instance of iTop with the exact same parameters.

Warning, a current bug causes the sample_data XML node to always be empty, whatever was chosen during setup ! Before using the XML file, beware to fix this node by adding 0 or 1 value.
For security reason, passords <pwd> are replaced by **removed**, you need to change them with the real value.

Unattended installation script

To automate the installation, use the unattended-install.php file.

Execution of the unattended installation

Because the installation runs from the command line, make sure that the current user has enough rights to access the different locations and that the web server will be able to access the files and directories created during the scripted installation. In order to exactly emulate the behavior of the interactive installation it may be a good practice to run this installation from the user account used for running the web server process.

Launch the script with the following command:

  php unattended_install.php  --param-file=fresh-install.xml

Where:

  • fresh-install.xml is the response file containing your desired settings for the installation (there are 4 models available in the folder 'xml_setup' : fresh-install.xml, itil-fresh-install.xml, itil-upgrade.xml, upgrade.xml)

Fresh installation parameters

In the case of a fresh installation (<mode>install</mode>), do not forget to complete below mandatory parameters before:
<database>
    <server></server>
    <user></user>
    <pwd></pwd>
    <name></name>
    <db_tls_enabled></db_tls_enabled>
    <db_tls_ca></db_tls_ca>
    <prefix></prefix>
  </database>
  <url></url>
  <graphviz_path>/usr/bin/dot</graphviz_path>
  <admin_account>
    <user></user>
    <pwd></pwd>
    <language></language>
  </admin_account>
  <language></language>

unattended installation options

To get all available options of the script, you can perform the following command :

php unattended-install.php --help

that will result in :

Usage: php unattended-install.php --param-file=<path_to_response_file> [--installation_xml=<path_to_installation_xml>] [--use_itop_config]
 
Options:
    --param-file=<path_to_response_file>  Path to the file (XML) to use for the unattended installation. That file (generated by the setup into log directory) must contain the following sections:
                                            - target_env: the target environment (production, test, dev)
                                            - database: the database settings (server, user, pwd, name, prefix)
                                            - selected_modules: the list of modules to install
    --response_file                         DEPRECATED: use `--param-file` instead
    --installation_xml=<path_to_installation_xml>  Use an installation.xml file to compute the modules to install depending on the selected extensions listed in the param file
    --use_itop_config                       Use the iTop configuration file to get the database settings, otherwise use the database settings from the parameters file
 
Advanced options:
    --check-consistency=1                   Check the data model consistency after the installation (default: 0)
    --clean=1                               In case of a first installation, cleanup the environment before proceeding: delete the configuration file, the cache directory, the target directory, the database (default: 0)
    --install=0                             Set to 0 to perform a dry-run (default: 1)
EOF;

use-itop-config option

When iTop is already installed, your configuration file already exists and is up to date regarding DB and app_root_url settings. In that case, maintaining this options is redundant with unattended XML file.

With below option, unattended-install.php will read these settings directly from iTop configuration file:

php unattended_install.php  --response_file=default-params.xml --use-itop-config=1
We recommand you the install-itop.sh script that is easier to use:
./install-itop.sh ./xml_setup/fresh-install.xml
3_2_0/advancedtopics/automatic_install.txt · Last modified: 2025/05/07 10:07 by 127.0.0.1
Back to top
Contact us