# Update from v5.0.x to v5.0.latest

To update from v4.6.x, see [Update from v4.6 to v5.0](https://doc.ibexa.co/en/latest/update_and_migration/from_4.6/update_to_5.0/index.md). To update from an older version, visit [the update page](https://doc.ibexa.co/en/latest/update_and_migration/update_ibexa_dxp/index.md) and choose the applicable path.

## Update the application

Note which version you actually have before starting.

First, run:

**Ibexa Headless**

```
yarn upgrade @ibexa/frontend-config @ibexa/ts-config
composer require ibexa/headless:5.0.7 --with-all-dependencies --no-scripts
composer recipes:install ibexa/headless --force -v
```

**Ibexa Experience**

```
yarn upgrade @ibexa/frontend-config @ibexa/ts-config
composer require ibexa/experience:5.0.7 --with-all-dependencies --no-scripts
composer recipes:install ibexa/experience --force -v
```

**Ibexa Commerce**

```
yarn upgrade @ibexa/frontend-config @ibexa/ts-config
composer require ibexa/commerce:5.0.7 --with-all-dependencies --no-scripts
composer recipes:install ibexa/commerce --force -v
```

Then execute the instructions below starting from the version you're upgrading from.

## v5.0.1

Some packages increase their type hinting strictness. You can run [Ibexa DXP Rector](https://github.com/ibexa/rector/blob/v5.0.1/README.md) to update your code.

## v5.0.2

### Database update

**MySQL**

```
CREATE TABLE ibexa_messenger_messages (
    id BIGINT AUTO_INCREMENT NOT NULL,
    body LONGTEXT NOT NULL,
    headers LONGTEXT NOT NULL,
    queue_name VARCHAR(190) NOT NULL,
    created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime_immutable)',
    available_at DATETIME NOT NULL COMMENT '(DC2Type:datetime_immutable)',
    delivered_at DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime_immutable)',
    INDEX ibexa_messenger_created_at_idx (created_at),
    INDEX ibexa_messenger_available_at_idx (available_at),
    INDEX ibexa_messenger_delivered_at_idx (delivered_at),
    PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_520_ci` ENGINE = InnoDB;

CREATE TABLE ibexa_messenger_lock_keys (
    key_id VARCHAR(64) NOT NULL,
    key_token VARCHAR(44) NOT NULL,
    key_expiration INT UNSIGNED NOT NULL,
    PRIMARY KEY(key_id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_520_ci` ENGINE = InnoDB;
```

**PostgreSQL**

```
CREATE TABLE ibexa_messenger_messages (
    id BIGSERIAL NOT NULL,
    body TEXT NOT NULL,
    headers TEXT NOT NULL,
    queue_name VARCHAR(190) NOT NULL,
    created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL,
    available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL,
    delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL,
    PRIMARY KEY(id)
);

CREATE INDEX ibexa_messenger_created_at_idx ON ibexa_messenger_messages (created_at);

CREATE INDEX ibexa_messenger_available_at_idx ON ibexa_messenger_messages (available_at);

CREATE INDEX ibexa_messenger_delivered_at_idx ON ibexa_messenger_messages (delivered_at);

COMMENT ON COLUMN ibexa_messenger_messages.created_at IS '(DC2Type:datetime_immutable)';

COMMENT ON COLUMN ibexa_messenger_messages.available_at IS '(DC2Type:datetime_immutable)';

COMMENT ON COLUMN ibexa_messenger_messages.delivered_at IS '(DC2Type:datetime_immutable)';

CREATE TABLE ibexa_messenger_lock_keys (
    key_id VARCHAR(64) NOT NULL,
    key_token VARCHAR(44) NOT NULL,
    key_expiration INT NOT NULL,
    PRIMARY KEY(key_id)
);
```

On Commerce, run this additional update queries:

**MySQL**

```
ALTER TABLE ibexa_discount
    ADD indexed_at DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime_immutable)';

CREATE INDEX ibexa_discount_indexed_at_idx
    ON ibexa_discount (indexed_at);
```

**PostgreSQL**

```
ALTER TABLE ibexa_discount
    ADD indexed_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL;

COMMENT ON COLUMN ibexa_discount.indexed_at IS '(DC2Type:datetime_immutable)';

CREATE INDEX ibexa_discount_indexed_at_idx
    ON ibexa_discount (indexed_at);
```

## v5.0.3

### Form Builder performance fix: missing indexes on form submission data (Experience) (Commerce)

In large production databases, the `ibexa_form_submission` and `ibexa_form_submission_data` tables may contain a lot of rows. Missing indexes can cause high CPU load and slow queries.

Run the provided SQL upgrade script to add the missing indexes to your database:

**MySQL**

```
mysql -u <username> -p <password> <database_name> < vendor/ibexa/installer/upgrade/db/mysql/ibexa-5.0.2-to-5.0.3.sql
```

**PostgreSQL**

```
psql <database_name> < vendor/ibexa/installer/upgrade/db/postgresql/ibexa-5.0.2-to-5.0.3.sql
```

## v5.0.4

### Database update (Experience) (Commerce)

From a platform first installed on v5.0.3 or updated precisely to v5.0.3, you need to execute the requests below. If the platform comes from lower than v5.0.3 and is updated to higher than v5.0.3, you don't need this part (but if you run the requests anyway, you only obtain error messages, nothing being broken or lost).

**MySQL**

```
ALTER TABLE `ibexa_site_public_access` ADD COLUMN `tree_root_location_id` INT DEFAULT NULL;
ALTER TABLE `ibexa_site_public_access` ADD INDEX `ibexa_spa_trl_id` (`tree_root_location_id`);

UPDATE ibexa_site_public_access
  SET tree_root_location_id = CAST(JSON_UNQUOTE(JSON_EXTRACT(config, '$."ibexa.site_access.config.content.tree_root.location_id"')) AS SIGNED)
  WHERE tree_root_location_id IS NULL AND JSON_EXTRACT(config, '$."ibexa.site_access.config.content.tree_root.location_id"') IS NOT NULL;
```

**PostgreSQL**

```
ALTER TABLE ibexa_site_public_access ADD COLUMN tree_root_location_id INT DEFAULT NULL;
CREATE INDEX "ibexa_spa_trl_id" ON "ibexa_site_public_access" ("tree_root_location_id");

UPDATE ibexa_site_public_access
  SET tree_root_location_id = (config::jsonb ->> 'ibexa.site_access.config.content.tree_root.location_id')::integer
  WHERE tree_root_location_id IS NULL AND config::jsonb ? 'ibexa.site_access.config.content.tree_root.location_id';
```

## v5.0.5

### Elasticsearch 8 support

As of v5.0.5, Ibexa DXP adds support for Elasticsearch 8.19 or higher. You can continue using [unsupported Elasticsearch 7.16.2+](https://www.elastic.co/support/eol), but it's recommended to upgrade to Elasticsearch 8 for improved performance and security features.

When choosing to keep using Elasticsearch 7.16.2, adjust your configuration as described in the [Update configuration](#update-configuration) section below to avoid using deprecated settings.

If you choose to upgrade to Elasticsearch 8, follow these steps:

#### Update Elasticsearch server

Upgrade your Elasticsearch server to version 8.19 or higher. For detailed instructions, follow the [Elasticsearch upgrade guide](https://www.elastic.co/guide/en/elastic-stack/8.19/upgrading-elastic-stack.html#prepare-to-upgrade).

When you use Ibexa Cloud, see [Elasticsearch service](https://docs.upsun.com/add-services/elasticsearch.html) for a list of supported versions.

#### Update configuration

Update your configuration in `config/packages/ibexa_elasticsearch.yaml`.

##### Replace deprecated connection pool settings

The deprecated `connection_pool` and `connection_selector` settings are now ignored and don't have any effect. Replace them with appropriate `node_pool_selector` and `node_pool_resurrect` settings:

```
# Old configuration (Elasticsearch 7 - deprecated)
ibexa_elasticsearch:
    connections:
        default:
            connection_pool: 'Elasticsearch\ConnectionPool\StaticNoPingConnectionPool'
            connection_selector: 'Elasticsearch\ConnectionPool\Selectors\RoundRobinSelector'
```

```
# New configuration (Elasticsearch 7 and 8)
ibexa_elasticsearch:
    connections:
        default:
            node_pool_selector: 'Elastic\Transport\NodePool\Selector\RoundRobin'
            node_pool_resurrect: 'Elastic\Transport\NodePool\Resurrect\NoResurrect'
```

For more information, see [Node pool settings](https://doc.ibexa.co/en/latest/search/search_engines/elasticsearch/configure_elasticsearch/#node-pool-settings).

##### Remove trace option

The `trace` debugging option is no longer available.

```
# Old configuration (Elasticsearch 7)
ibexa_elasticsearch:
    connections:
        default:
            debug: true
            trace: true
```

```
# New configuration (Elasticsearch 7 and 8)
ibexa_elasticsearch:
    connections:
        default:
            debug: true
            # Trace option is no longer available
```

#### Reindex content

After upgrading to Elasticsearch 8 and updating your configuration, reindex the search engine:

1. Push the index templates:

   ```
   php bin/console ibexa:elasticsearch:put-index-template --overwrite
   ```

1. Reindex your content:

   ```
   php bin/console ibexa:reindex
   ```

### Database update

Run the provided SQL upgrade script to ensure the Messenger tables for [background tasks](https://doc.ibexa.co/en/latest/infrastructure_and_maintenance/background_tasks/index.md) exist in your database:

**MySQL**

```
mysql -u <username> -p <password> <database_name> < vendor/ibexa/installer/upgrade/db/mysql/ibexa-5.0.4-to-5.0.5.sql
```

**PostgreSQL**

```
psql <database_name> < vendor/ibexa/installer/upgrade/db/postgresql/ibexa-5.0.4-to-5.0.5.sql
```

## v5.0.5

No additional steps needed.

## v5.0.6

### Database update (Experience) (Commerce)

Run the provided SQL upgrade script to adapt your database to latest change in [form builder](https://doc.ibexa.co/en/latest/content_management/forms/form_builder_guide/index.md)'s `max_length` validator behavior:

**MySQL**

```
mysql -u <username> -p <password> <database_name> < vendor/ibexa/installer/upgrade/db/mysql/ibexa-5.0.5-to-5.0.6.sql
```

**PostgreSQL**

```
psql <database_name> < vendor/ibexa/installer/upgrade/db/postgresql/ibexa-5.0.5-to-5.0.6.sql
```

Prior, `0` was interpreted as "no length limit". Now, `0` is interpreted as "length limited to zero characters" and `NULL` as "no length limit".

### Ibexa Cloud configuration update

If you're using Ibexa Cloud, you must install a new package and update your cloud configuration.

First, install the `ibexa/cloud` package:

```
composer require ibexa/cloud
```

Then, update your cloud configuration. Instead of the old `composer ibexa:setup --platformsh` command, use:

```
php bin/console ibexa:cloud:setup --upsun
```

This command generates or updates the cloud configuration files.

Additionally, you must remove the following line from your `.platform.app.yaml` file if it exists:

```
curl -fs https://get.symfony.com/cloud/configurator | bash
```

## v5.0.7

### Update Symfony from 7.3 to 7.4

This version of Ibexa DXP requires [Symfony 7.4](https://symfony.com/releases/7.4). Update Symfony constraints in `composer.json` before updating the packages.

1. In `composer.json`, update `extra.symfony.require` to allow installing a higher Symfony version:

   ```
   "extra": {
       "symfony": {
           "require": "7.4.*"
       }
   }
   ```

1. To allow installing Symfony 7.4, update the requirements for **all** `symfony` packages in `composer.json` as in the example below:

   ```
   -        "symfony/<package>"": "7.3.*",
   +        "symfony/<package>"": "7.4.*",
   ```

1. Review your code, configuration, and third-party bundles for Symfony 7.4 compatibility.

   For more details about the new version, see the official Symfony [upgrade instructions](https://github.com/symfony/symfony/blob/7.4/UPGRADE-7.4.md) and [blog posts introducing this release](https://symfony.com/blog/category/living-on-the-edge/8.0-7.4). Key changes include:

   - Array-based PHP configuration format

     As part of the [array-based PHP configuration format](https://symfony.com/blog/new-in-symfony-7-4-better-php-configuration), a `config/reference.php` file will be created. You should commit this file to the repository.

   - Independent application cache directory

     Symfony 7.4 introduces a new [share directory](https://symfony.com/blog/new-in-symfony-7-4-share-directory), dedicated for storing application cache on the file system. If you decide to configure it (for example, by setting the `APP_SHARE_DIR` environment variable), review your existing scripts for explicit `var/cache` usage (for example, `rm -rf var/cache`) and decide whether to include `var/share` in the script.

1. Update Ibexa packages by running:

   **Ibexa Headless**

   ```
   yarn upgrade @ibexa/frontend-config @ibexa/ts-config
   composer require ibexa/headless:v5.0.7 --with-all-dependencies --no-scripts
   composer recipes:install ibexa/headless --force -v
   ```

   **Ibexa Experience**

   ```
   yarn upgrade @ibexa/frontend-config @ibexa/ts-config
   composer require ibexa/experience:v5.0.7 --with-all-dependencies --no-scripts
   composer recipes:install ibexa/experience --force -v
   ```

   **Ibexa Commerce**

   ```
   yarn upgrade @ibexa/frontend-config @ibexa/ts-config
   composer require ibexa/commerce:v5.0.7 --with-all-dependencies --no-scripts
   composer recipes:install ibexa/commerce --force -v
   ```

1. Manually restore the entry for `JMSTranslationBundle` in `config/bundles.php` to [its previous position](https://github.com/ibexa/commerce-skeleton/blob/v5.0.6/config/bundles.php#L14):

   ```
       FOS\HttpCacheBundle\FOSHttpCacheBundle::class => ['all' => true],
       JMS\TranslationBundle\JMSTranslationBundle::class => ['all' => true],
       Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
   ```

You're now running [Symfony 7.4, the current long-term support version](https://symfony.com/releases/7.4).

### Ibexa Cloud `ibexa:setup` command deprecation

Following the changes introduced in v5.0.6, the `ibexa:setup` command is deprecated as of v5.0.7 and will be removed in v6.0.0. Additionally, the `ibexa/cloud` package must be installed for the Ibexa Cloud build to succeed. The command `ibexa:cloud:setup` from this package replaces the deprecated `ibexa:setup`.

To learn how to adjust your configuration, see [update instructions for v5.0.6](#ibexa-cloud-configuration-update).

### Database update (Experience) (Commerce)

Run the provided SQL upgrade script to update your database:

**MySQL**

```
mysql -u <username> -p <password> <database_name> < vendor/ibexa/installer/upgrade/db/mysql/ibexa-5.0.6-to-5.0.7.sql
```

**PostgreSQL**

```
psql <database_name> < vendor/ibexa/installer/upgrade/db/postgresql/ibexa-5.0.6-to-5.0.7.sql
```

## LTS Updates and additional packages

[LTS Updates](https://doc.ibexa.co/en/latest/ibexa_products/editions/#lts-updates) are standalone packages with their own update procedures. To use the [latest features](https://doc.ibexa.co/en/latest/release_notes/ibexa_dxp_v5.0/index.md) added to them, update them separately with the following commands:

**Integrated help**

### Integrated help (LTS Update)

See [Integrated help](https://doc.ibexa.co/en/latest/administration/back_office/integrated_help/index.md) for more information.

If you're already using it, run the following command to get the latest version of this feature:

```
composer require ibexa/integrated-help:5.0.7
```

**Anthropic connector**

### Anthropic connector (LTS Update)

See [how to configure Anthropic connector](https://doc.ibexa.co/en/latest/ai_actions/configure_ai_actions/#install-anthropic-connector) for more information.

If you're already using it, run the following command to get the latest version of this feature:

```
composer require ibexa/connector-anthropic:5.0.7
```

**Real-time collaborative editing**

### Real-time collaborative editing

To learn more about the [Real-time editing](https://doc.ibexa.co/en/latest/content_management/collaborative_editing/collaborative_editing_guide/index.md), see the [installation and configuration instructions](https://doc.ibexa.co/en/latest/content_management/collaborative_editing/configure_collaborative_editing/index.md).

If you're already using it, run the following command to get the latest version of this feature:

```
composer require ibexa/fieldtype-richtext-rte:5.0.7 ibexa/ckeditor-premium:5.0.7
```

**Shopping list**

### Shopping list (LTS Update) (Commerce)

To learn more about the [Shopping list](https://doc.ibexa.co/en/latest/commerce/shopping_list/shopping_list_guide/index.md), see the [installation and configuration instructions](https://doc.ibexa.co/en/latest/commerce/shopping_list/install_shopping_list/index.md).
