Introducing a new way to review your PRs.

Read the announcement

combodo / itop

A simple, web based CMDB & IT Service Management tool

View on GitHub

17 documents · Updated Nov 20, 2026

docs / installation-and-upgrades

Installation and upgrades

Installation and upgrades turn a set of application files, module choices, and database settings into a usable iTop runtime. The setup process checks the host, builds a data model, changes or creates the database, records the result, and then makes the new runtime active. This page complements Platform runtime and extensibility and Startup and module composition.

Setup wizard

The setup wizard is the guided entry point for a fresh install or an upgrade. It keeps the user's choices in setup session state so each page can validate its own input and the user can move back before the change phase begins.

Setup route selection

The welcome step clears old wizard state and checks for an existing iTop instance. It selects the install route when no previous instance is found. It selects the upgrade route when an instance is found and carries its database and runtime settings into the new setup session.

An upgrade of the same application and version can show a Keep current choices shortcut. This shortcut reads the installed extension and module records, reconstructs the selected set, and sends the flow to the compatibility stage. The landing step still checks that this recovered set is valid unless the operator has enabled the force option. A normal upgrade still allows the operator to review and change those choices.

The two routes share the later module, compatibility, and execution stages. They differ in the data they must collect:

  • A fresh install accepts the license, database details, administrator account, language, application URL, and sample-data choice.
  • An upgrade shows the installed product and data-model versions. It also asks how to handle changes made to the previous data model.

References: setup/…/WizStepWelcome.php• L56-88 setup/…/WizStepWelcome.php• L147-198 setup/…/WizStepLandingBeforeAudit.php• L12-39 setup/…/WizStepLandingBeforeAudit.php• L51-119 setup/wizard.php• L63-99 setup/…/WizStepLicense.php• L24-39 setup/…/WizStepDetectedInfo.php• L26-69

Wizard state

The wizard stores database settings, selected modules, upgrade decisions, and other choices in a session-scoped parameter set. The controller records visited pages as a stack, validates the current page before moving forward, and restores the prior page when the user moves back.

The setup endpoint also protects the process with a setup token. A stale or invalid setup session does not continue the wizard. This prevents an old setup page from starting a new change sequence.

References: setup/wizardcontroller.class.inc.php• L17-24 setup/wizardcontroller.class.inc.php• L43-77 setup/wizardcontroller.class.inc.php• L139-192 setup/wizard.php• L63-99

Prerequisite checks

Prerequisite checks stop unsafe setup work before it changes the database. They return errors that block progress and warnings that explain a risk while still allowing the user to continue.

Host checks

The setup checks the PHP version, required PHP extensions, memory limit, session storage, temporary directories, upload settings, and the writable application directories. These checks cover both the web process and the command-line PHP process used by background setup work.

The current hard limits include PHP 8.2 and MySQL 5.7. PHP 8.5 and newer receives a warning because that version is not yet validated. The setup also checks the database server connection, server version, user rights, and selected database. TLS settings are checked when the database connection uses TLS.

The live database check also warns when the server has too little packet space or too few connections for setup work. It warns about Galera because that setup can cause data loss and is not supported.

References: setup/setuputils.class.inc.php• L104-121 setup/setuputils.class.inc.php• L149-240 setup/setuputils.class.inc.php• L319-336 setup/setuputils.class.inc.php• L459-544 setup/setuputils.class.inc.php• L1309-1375 setup/setuputils.class.inc.php• L1405-1455

Setup option checks

The wizard checks options that depend on the selected route. It checks Graphviz when the installation uses impact analysis. It checks the database backup path and the mysqldump tool when an upgrade backup is requested. It checks module dependencies before the final execution stage.

An error in these checks disables the relevant action. A warning remains visible in the wizard so the operator can decide whether the risk is acceptable.

References: setup/…/WizStepInstallMiscParams.php• L106-150 setup/…/WizStepUpgradeMiscParams.php• L87-126 setup/setuputils.class.inc.php• L546-664 setup/setuputils.class.inc.php• L557-572

Module selection

Module selection defines the feature set that the new runtime will build and the database will support. The setup discovers extension choices from the product definition and from extension and module directories. It also merges installed records into that view so an upgrade can account for choices whose files are no longer present.

Selection rules

The selection model supports mandatory choices, optional choices, alternatives, and nested choices. A selected choice contributes its modules. The setup then evaluates automatic selections and checks that module dependencies resolve before it proceeds.

Hidden authentication modules and other hidden modules can be part of the final set without a visible choice. Modules placed in the target environment's extra module area are treated as part of that environment. Automatic-selection rules can add more modules after the visible choices are processed.

During an upgrade, the wizard compares the requested extension set with the installed set. It reports additions and removals. An installed extension whose local files are gone is shown as missing and is marked for removal. An extension stays protected when one of its modules cannot be uninstalled or when it comes from a remote source. The operator must enable the explicit force option to override that protection, and the wizard warns that this can corrupt data or stop the application. A chosen extension without a valid extension code blocks setup.

References: setup/extensionsmap.class.inc.php• L88-129 setup/extensionsmap.class.inc.php• L286-389 setup/extensionsmap.class.inc.php• L648-729 setup/extensionsmap.class.inc.php• L774-816 setup/…/WizStepModulesChoice.php• L105-164 setup/…/WizStepModulesChoice.php• L764-917 setup/itopextension.class.inc.php• L61-71 setup/itopextension.class.inc.php• L126-141 setup/…/AbstractWizStepMiscParams.php• L43-78 setup/modulediscovery.class.inc.php• L201-230 setup/…/moduledependencysort.class.php• L43-106

Installation choices

An installation.xml file presents the product's choices in one or more wizard pages. The selected choices become extension codes and module IDs. Nested options and alternatives are included only when their parent choice is active.

The extension map also supports packages without this definition. It can expose formal extensions from their metadata and treat standalone visible modules as individual choices. This keeps newer grouped packages and older or separately placed modules in the same selection model.

The conversion also accounts for modules that are not named by a package choice. Default authentication and hidden modules are included. Selected unpackaged extensions can contribute their compatible modules. Automatic-selection rules run after these inputs and may add further modules when their conditions are true.

The command-line installer uses the same choice model when an installation definition is supplied. With no explicit extension list, it can use the definition's defaults or treat optional choices as selected according to its input. This keeps interactive and unattended setup aligned while still allowing automation to choose a precise set.

References: setup/extensionsmap.class.inc.php• L90-131 setup/extensionsmap.class.inc.php• L302-376 setup/…/WizStepModulesChoice.php• L574-705 setup/…/WizStepModulesChoice.php• L721-761 setup/…/InstallationChoicesToModuleConverter.php• L45-107 setup/…/InstallationChoicesToModuleConverter.php• L123-140 setup/…/InstallationChoicesToModuleConverter.php• L206-267 setup/…/InstallationFileService.php• L46-54 setup/…/InstallationFileService.php• L102-130 setup/…/InstallationFileService.php• L258-305

Data-model compilation

Data-model compilation converts the selected module definitions and any site-specific model changes into the model used by the new runtime. The setup builds this result before it changes the live database, so it can check the new model against the current data first.

Build environment

The setup uses a build environment as a safe working copy. For the normal setup path, the build environment is separate from the final environment. Existing runtime data-model files, configuration, and extra modules can be copied into that workspace before the new selection is compiled.

When an existing environment is rebuilt, the setup recovers its extension choices from the source database. It converts those choices into modules and checks their dependencies before loading the model. This makes the selected extensions and the compiled module set two views of the same upgrade decision.

This separation allows setup to discard an incomplete build. A successful commit replaces the final model, module files, caches, and configuration with the build result.

References: setup/…/StepSequencer.php• L42-53 setup/runtimeenv.class.inc.php• L46-104 setup/runtimeenv.class.inc.php• L1255-1269 setup/runtimeenv.class.inc.php• L1286-1292 setup/runtimeenv.class.inc.php• L1502-1536 setup/…/ModuleInstallationRepository.php• L31-41

Compatibility audit

The compatibility stage copies the chosen source files, compiles the new data model, and checks whether existing data needs cleanup. The audit compares the classes exposed by the source environment with those exposed by the build environment. It then checks whether records of removed classes still exist. The audit applies to upgrades where the installed version and the new runtime require a data consistency check.

The model comparison runs through the configured command-line PHP process for each environment. It requires a valid environment and configuration and returns a structured class list. If the audit finds data that needs adjustment, the operator can send the work to the data cleanup flow or use the available continuation choice. Continuing without cleanup leaves the data adjustment for manual work and is therefore an explicit risk.

References: setup/…/DataAuditSequencer.php• L27-42 setup/…/DataAuditSequencer.php• L47-100 setup/…/SetupAudit.php• L25-60 setup/…/AbstractSetupAudit.php• L63-89 setup/…/ModelReflectionSerializer.php• L34-86 setup/…/get_model_reflection.php• L19-44 setup/…/WizStepDataAudit.php• L74-95 setup/…/WizStepDataAudit.php• L149-195

Compiled model

The compiler combines the selected modules with the site's model delta and produces the runtime model artifacts. It writes to a temporary target when possible and only moves the result into place after compilation succeeds. It also clears PHP opcode caches so the application does not run old model code with a new database structure.

The data-model design format is versioned separately from the application model. The format converter moves a design document through supported versions one step at a time and records errors or warnings for unsupported versions and changes that cannot be preserved. A successful conversion updates the document to the target format before compilation continues.

References: setup/runtimeenv.class.inc.php• L1306-1386 setup/compiler.class.inc.php• L262-326 setup/compiler.class.inc.php• L386-419 setup/compiler.class.inc.php• L643-733 setup/itopdesignformat.class.inc.php• L54-133 setup/itopdesignformat.class.inc.php• L313-407 setup/itopdesignformat.class.inc.php• L827-912

Database installation and upgrade

The database phase applies the selected model to the target database. A fresh install creates the structure and an upgrade changes the existing structure while preserving the data through version-specific migration actions.

Database lifecycle

The application installer runs the change phase as a sequence of small steps. This limits the work in each request and gives the web wizard or command-line installer progress and a clear failure point.

The normal sequence is:

  1. Log the setup parameters.
  2. Create an optional backup for an upgrade.
  3. Run data migration needed before the structure change.
  4. Create or update the database schema.
  5. Run data migration needed after the structure change.
  6. Load post-creation data, including the fresh-install administrator account.
  7. Load structural data and optional sample data.
  8. Record the installed application, modules, and extensions.
  9. Write the configuration file.
  10. Commit the build environment and leave maintenance and read-only modes.

The runtime enters read-only mode during setup and enters maintenance mode before an upgrade changes data. Module-specific setup handlers can run before and after the schema change and after data load. This lets a module move its data with the model that owns it.

References: setup/…/ApplicationInstallSequencer.php• L41-65 setup/…/ApplicationInstallSequencer.php• L70-168 setup/runtimeenv.class.inc.php• L450-539 setup/runtimeenv.class.inc.php• L561-589 setup/runtimeenv.class.inc.php• L1082-1179

Installation records

The setup records the application version, data-model version, selected modules, and selected extensions in the target database. Later setup runs use these records to identify the installed product and to restore or compare previous choices.

The installation repository reads the current records as a group. It separates the application and data-model version records from their child module records, then presents the installed module set to the wizard and to automated setup. This record set is also the source for the upgrade shortcut that keeps current choices.

When that shortcut skips the visible choice pages, the upgrade landing step restores both extension and module selections from these records. It still checks the recovered choices before it moves to compatibility work unless the operator explicitly forces the upgrade.

References: setup/runtimeenv.class.inc.php• L642-751 setup/…/moduleinstallation.class.inc.php• L20-98 setup/…/ModuleInstallationRepository.php• L31-78 setup/…/ModuleInstallationRepository.php• L95-145 setup/…/ModuleInstallationRepository.php• L148-194 setup/…/WizStepLandingBeforeAudit.php• L53-119

Database backup

The upgrade summary offers an optional database backup before the first destructive database step. The backup is a compressed archive that protects more than table data, so it can help restore the setup context as well as the database contents.

Backup contents

The backup includes the SQL dump and, when present, the configuration file, the current model delta, extra modules, and configured extra files. The setup names the archive from the database and the requested time pattern, then makes it available for download after a successful upgrade.

References: setup/backup.class.inc.php• L136-180 setup/backup.class.inc.php• L190-218 setup/backup.class.inc.php• L220-303 setup/…/WizStepDone.php• L71-82

Backup safeguards

The backup path must be usable and the server must provide the archive and database tools needed by the backup process. The backup check applies to the default environment only. The database connection must be active before the SQL dump starts. A failed dump removes incomplete output rather than presenting it as a valid backup.

References: setup/setuputils.class.inc.php• L575-664 setup/backup.class.inc.php• L313-405 setup/runtimeenv.class.inc.php• L1410-1419

Upgrade-copy flow

The core update flow moves a downloaded iTop package into the existing application before the setup phases compile the new model and update the database. It treats the package as untrusted until extraction and file-integrity checks succeed.

Package copy

The updater extracts the package into a temporary update area and checks its files. It then uses the package's copy rules when they exist. Otherwise it uses the default copy behavior. After the copy, it checks the installed files again and clears opcode caches.

The package-specific copy rule copies the new web files into the application root. It also places the core-update data-model files in the production runtime area. This keeps the updater available after the main application files have changed.

References: datamodels/…/CoreUpdater.php• L27-81 datamodels/…/CoreUpdater.php• L454-473 setup/appupgradecopy.php• L13-26

Copy and database stages

File copy and database update are separate responsibilities. The updater can verify and copy the package first. The runtime then compiles the model, applies database migrations, loads required data, records the new version, and finalizes the active environment.

This order gives the database phase access to the code and model definitions for the new version. It also lets a failed build or failed integrity check stop before the new runtime is committed.

References: datamodels/…/CoreUpdater.php• L114-197 setup/…/ApplicationInstallSequencer.php• L110-158 setup/runtimeenv.class.inc.php• L887-949

Unattended setup

The command-line installer runs the same setup model without the web wizard. It reads a response XML file, resolves extension choices into modules, performs the compatibility and application sequences, and returns a success or failure result for automation.

The response file supplies the target environment, database settings, and selected modules or extensions. When extension choices are not explicit, the installation definition can supply defaults or enable its optional choices through the command input. The service also includes required hidden modules, compatible unpackaged extensions, and modules selected by automatic rules. The command can use an existing iTop configuration, run a dry check without installation, clean a fresh target, and optionally check model consistency after the run.

References: setup/…/unattended-install.php• L21-39 setup/…/unattended-install.php• L56-117 setup/…/unattended-install.php• L241-339 setup/…/InstallationFileService.php• L35-54 setup/…/InstallationFileService.php• L102-236 setup/…/InstallationFileService.php• L258-387 setup/…/StepSequencer.php• L65-131

Change checklist

When these files or sections are changed, remember to consider these:

  • Changes to the wizard's stored parameter names must remain compatible with AbstractWizStepInstall::BuildConfig, the summary page, the keep-current-choices shortcut, and the unattended response format.
  • Changes to extension discovery must keep installation definitions, local and remote module directories, installed-but-missing extensions, and extension-code validation aligned with the selection screen.
  • Changes to module choice rules must keep interactive choice conversion, unattended default handling, automatic selection, dependency ordering, installed-choice recovery, and installation records aligned.
  • Changes to uninstallability or extension source rules must keep the wizard's protection checks consistent with the force-uninstall warning and with the recorded installation state.
  • Changes to the installation-record reader must preserve application and data-model version detection because the welcome step uses it to decide whether the keep-current-choices shortcut is safe.
  • Changes to the data-model compiler must preserve the build-to-final commit boundary and cache reset behavior.
  • Changes to data-model design-format versions or conversion rules must keep each supported version transition compatible with model compilation and must preserve conversion errors and warnings for the setup flow.
  • Changes to the compatibility audit or its model reader must keep the source and build environments comparable through the configured command-line PHP process and must preserve clear setup errors for missing environments, missing configuration, or invalid model output.
  • Changes to the application step names or optional steps must update both the progress labels and every caller that advances the sequencer.
  • Changes to backup contents or naming must preserve the post-upgrade download path and the archive restore context.
  • Changes to package copy rules must keep the updater available after the application root is replaced and must retain the file-integrity check.

Important failure modes

TriggerConsequenceGuard
A required PHP extension, PHP version, memory limit, or writable setup directory is missingThe wizard cannot continueFix the host requirement and reload the welcome step
Database credentials, TLS files, server version, or database rights are invalidThe database step blocks or later database work failsUse the live database check and correct the connection or rights
The database server has too few connections, too little packet space, or uses GaleraSetup can fail during work or can cause unsupported data behaviorAdjust the server or use a supported database topology
A selected module has an unmet dependency or an automatic-selection rule cannot be evaluatedThe model cannot be built safely or the intended feature set is incompleteAdd the missing module or correct the module metadata before continuing
A selected extension has no valid extension codeSetup rejects the selected extensionRestore its metadata or remove it from the selected set
An installed extension is missing from diskThe upgrade marks the extension for removal, or blocks if its recorded state forbids removalRestore the extension files or use the force option only with a recovery plan
The upgrade source contains local model changes and the operator chooses the standard modelLocal model changes are discarded from the new buildChoose to preserve the previous model when those changes are required
The model audit cannot find an environment or configuration, cannot run the configured CLI PHP process, or receives invalid model outputThe compatibility check fails before it can compare the old and new modelsRestore the environment and configuration, fix the CLI PHP path, and review setup.log
A data-model design document has an unknown format version or its conversion records an errorData-model compilation cannot safely use the documentUse a supported design format and resolve the conversion error before continuing
Data-model compilation failsNo new compiled runtime is committedRead the setup error and log, then correct the model or module source
The compatibility audit finds data that needs cleanupThe upgrade cannot safely complete without manual action or explicit continuationUse the data cleanup flow or repair the inconsistent data before continuing
mysqldump is missing, cannot run, or cannot write the target archiveThe requested pre-upgrade backup is unavailableInstall or configure the database tools and verify the destination
File-integrity validation fails during a core updateThe package is not copied into the live applicationReject the package and obtain a valid update archive

Key files

FileWhy to read it
setup/wizard.phpEntry point that starts or resumes the setup wizard
setup/wizardcontroller.class.inc.phpShared page flow, session state, and forward/back behavior
setup/setuputils.class.inc.phpHost, database, backup, module, and version checks
setup/…/WizStepWelcome.phpInstall-versus-upgrade detection, prerequisite display, and the keep-current-choices shortcut
setup/…/WizStepLandingBeforeAudit.phpUpgrade state preparation, recovered-choice validation, and the transition from module choices to compatibility checks
setup/…/WizStepDetectedInfo.phpUpgrade version display and local-model change choice
setup/…/WizStepModulesChoice.phpProduct and extension selection rules, dependency guards, and upgrade differences
setup/extensionsmap.class.inc.phpDiscovery and recovery of extension choices from definitions, directories, and installation records
setup/itopextension.class.inc.phpExtension identity, source, installed state, dependencies, and uninstall protection
setup/…/InstallationChoicesToModuleConverter.phpConversion from installation choices and extension selections to modules
setup/…/ModuleInstallationRepository.phpReading installed versions and module records used to recover upgrade state
setup/…/DataAuditSequencer.phpBuild, compile, and upgrade data-audit stages
setup/…/ModelReflectionSerializer.phpValidated model reading for comparison between the current and build environments
setup/…/SetupAudit.phpComparison of model class sets and identification of removed classes
setup/runtimeenv.class.inc.phpBuild environment, module compilation, schema, data, records, commit, and mode changes
setup/compiler.class.inc.phpData-model compilation and the production of runtime model artifacts
setup/itopdesignformat.class.inc.phpVersioned conversion of data-model design documents before compilation
setup/…/ApplicationInstallSequencer.phpOrdered database and application change stages
setup/backup.class.inc.phpDatabase dump and setup archive contents
setup/…/InstallationFileService.phpAutomated installation-choice and module computation
setup/…/unattended-install.phpAutomated command-line setup path
datamodels/…/CoreUpdater.phpPackage validation, core copy, and core-update database path
setup/appupgradecopy.phpPackage-specific file-copy rules used during a core update