> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migration notes

Migrate from Atoti What-If 4.0.4-AS6.1 to 4.1.-AS6.1. Consult the Atoti What-If 4.1.-AS6.1 [release notes](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/release-notes-4.1.md) and [changelog](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/changelog-4.1.md) for a complete view of changes.

## Recommended migration process

1. Back up your project.
2. Update the Atoti What-If dependency.
3. Upgrade your security manager.
4. Update your external database schema (only required if using an external database).
5. Confirm successful build and startup.

## Update dependencies

### pom.xml

#### Update Atoti Server to 6.1.11

> [!NOTE]
>
> Atoti What-If 4.1.0-AS6.1 is shipped with 6.1.11, but you can use later versions if they are available.

#### Update Atoti What-If to version 4.1.0-AS6.1

You can upgrade Atoti What-If in your project from 4.0.4-AS6.1 to 4.1.0-AS6.1 by making the following change:

* Atoti What-If 4.0.4-AS6.1:

```xml theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
<dependency>
    <groupId>com.activeviam.apps</groupId>
    <artifactId>whatif</artifactId>
    <version>4.0.4-AS6.1</version>
</dependency>
```

* Atoti What-If 4.1.0-AS6.1:

```xml theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
<dependency>
    <groupId>com.activeviam.apps</groupId>
    <artifactId>whatif</artifactId>
    <version>4.1.0-AS6.1</version>
</dependency>
```

## Upgrade your security manager

Atoti What-If 4.1.0-AS6.1 improves user authorization for simulation and branch management. To achieve this, this release introduces several changes to the `IDatabaseSimulationsSecurityManager` and its `SpringDatabaseSimulationsSecurityManager` implementation.

If you are using the provided `SpringDatabaseSimulationsSecurityManager` implementation, update your configuration from

* Atoti What-If 4.0.4-AS6.1:

```java theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
@Bean
public IDatabaseSimulationsSecurityManager securityManager() {
    return new SpringDatabaseSimulationsSecurityManager();
}
```

* Atoti What-If 4.1.0-AS6.1:

```java theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
@Bean
public IDatabaseSimulationsSecurityManager securityManager(ISimulationPersistenceManager persistenceManager, IBranchPermissionsManager branchPermissionsManager) {
    return new SpringDatabaseSimulationsSecurityManager(persistenceManager, branchPermissionsManager);
}
```

If you have implemented your own security manager, update these methods

| Method | Previous Parameters | New Parameters | Details |
| - | - | - | - |
| `canUpdate` | `Object databaseSimulationId, IDatabaseSimulation updatedDatabaseSimulation` | `IDatabaseSimulation updatedDatabaseSimulation` | The database simulation already includes the ID, making the method logic less error-prone. |
| `canUpdate` | `List<Object> databaseSimulationIds, List<IDatabaseSimulation> updatedDatabaseSimulations` | `List<IDatabaseSimulation> updatedDatabaseSimulations` | The database simulations already include the ID, making the method logic less error-prone. |

and implement this new method

| Method | Parameter | Details |
| - | - | - |
| `canCreateBranch` | `branchName` | The security manager has to check permissions to create branches as the Atoti Server branch permissions manager also assigns such permissions. |

## Update your external database schema

If you are using an external database for persisting simulation information, update its schema to include the following changes:

| Atoti What-If 4.0.4-AS6.1 | Atoti What-If 4.1.0-AS6.1 | Modification | Field | Type | Details |
| - | - | - | - | - | - |
| DATASTORE\_SIMULATIONS | DATASTORE\_SIMULATIONS | Added field | executedBy | VARCHAR(4000) | The executing user will be persisted alongside all other simulation details. |

In order to perform these changes, you can run this SQL script:

```sql theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
ALTER TABLE DATASTORE_SIMULATIONS
ADD executedBy VARCHAR(4000);
```

***

## 4.1.0-AS6.1 to 4.1.1-AS6.1

Migrate from Atoti What-If 4.1.0-AS6.1 to 4.1.1-AS6.1. Consult the Atoti What-If 4.1.1-AS6.1 [release notes](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/release-notes-4.1.md) and [changelog](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/changelog-4.1.md) for a complete view of changes.

> [!NOTE]
>
> No migration needed.

***

## 4.1.1-AS6.1 to 4.1.2-AS6.1

Migrate from Atoti What-If 4.1.1-AS6.1 to 4.1.2-AS6.1. Consult the Atoti What-If 4.1.2-AS6.1 [release notes](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/release-notes-4.1.md) and [changelog](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/changelog-4.1.md) for a complete view of changes.

> [!NOTE]
>
> No migration needed.

***

## 4.1.2-AS6.1 to 4.1.3-AS6.1

Migrate from Atoti What-If 4.1.2-AS6.1 to 4.1.3-AS6.1. Consult the Atoti What-If 4.1.3-AS6.1 [release notes](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/release-notes-4.1.md) and [changelog](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/changelog-4.1.md) for a complete view of changes.

> [!NOTE]
>
> No migration needed.

***

## 4.1.3-AS6.1 to 4.1.4-AS6.1

Migrate from Atoti What-If 4.1.3-AS6.1 to 4.1.4-AS6.1. Consult the Atoti What-If 4.1.4-AS6.1 [release notes](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/release-notes-4.1.md) and [changelog](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/changelog-4.1.md) for a complete view of changes.

> [!NOTE]
>
> No migration needed.

***

## 4.1.4-AS6.1 to 4.1.5-AS6.1

Migrate from Atoti What-If 4.1.4-AS6.1 to 4.1.5-AS6.1. Consult the Atoti What-If 4.1.5-AS6.1 [release notes](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/release-notes-4.1.md) and [changelog](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/changelog-4.1.md) for a complete view of changes.

> [!NOTE]
>
> No migration needed.

***

## 4.1.5-AS6.1 to 4.1.6-AS6.1

Migrate from Atoti What-If 4.1.5-AS6.1 to 4.1.6-AS6.1. Consult the Atoti What-If 4.1.5-AS6.1 [release notes](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/release-notes-4.1.md) and [changelog](https://docs.activeviam.com/solutions/libraries/what-if/5.0/dev/dev-release/previous-versions/4.1/changelog-4.1.md) for a complete view of changes.

> [!NOTE]
>
> No migration needed.
