docs/anomaly-detection/Migration.md
This document provides guidelines for migrating to the latest version of VictoriaMetrics Anomaly Detection (vmanomaly). It covers the key changes, compatibility considerations, and best practices to ensure a smooth transition for stateful and stateless modes of operation.
Upgrading to v1.27.1 or newer is recommended to benefit from simplified migration process.
The --dryRun command-line argument allows {{% available_from "v1.27.0" anomaly %}} to simulate the migration process without making any actual changes. This is useful for identifying potential issues and understanding the impact of the migration before applying it, e.g. dropping of existing state database or on-disk artifacts for all (or some) of the configured models and data. Starting from version v1.27.0, the upgrade impact to any new version can be assessed by running vmanomaly with the --dryRun flag automatically. Downgrade check from v1.27.0 (or newer) to earlier versions than v1.25.3 requires setting env variable VMANOMALY_STATE_VERSION_OVERRIDE=<version>, e.g.:
export VMANOMALY_STATE_VERSION_OVERRIDE=1.25.2
This section outlines the compatibility of different vmanomaly versions with various components, including data, models, and configuration formats, for both stateful and stateless modes.
Refer to the global changelog for detailed information on changes in each version. Use
--dryRun{{% available_from "v1.27.0" anomaly %}} mode to check for compatibility issues before performing the actual migration. See Dry Run section for more details.
Used if
settings.restore_stateis set totrue. See argument details in the configuration documentation.
There are 2 types of compatibility to consider when migrating in stateful mode:
| Group start | Group end | Compatibility | Notes |
|---|---|---|---|
| v1.29.3 | Latest* | Fully Compatible | Just a placeholder for new releases |
| v1.29.1 | v1.29.3 | Fully Compatible | - |
| v1.28.7 | v1.29.0 | Partially compatible* | Dumped models of class prophet and seasonal quantile have problems with loading to v1.29.0 due to dropped pytz library. Upgrading directly from v1.28.7 to v1.29.1 with a fix is suggested |
| v1.26.0 | v1.28.7 | Fully Compatible | v1.28.0 introduced rolling model class drop in favor of online models (rolling_quantile and std models), however, it does not impact compatibility, as artifacts were not produced by default for rolling models. Also, offline mad and zscore models are redirecting to their respective online counterparts since v1.28.4. |
| v1.25.3 | v1.26.0 | Partially Compatible* | v1.25.3 introduced forecast_at argument for base univariate and Prophet models, however, itself remains backward-reversible from newer states like v1.26.2, v1.27.0. (All models except isolation_forest_multivariate class will be dropped) |
| v1.25.1 | v1.25.2 | Fully Compatible | In v1.25.1 there was a change to vmanomaly.db metadata database format, so migrating from v1.24.0-v1.25.0 requires deletion of a state, see note above the table |
| v1.24.1 | v1.25.0 | Partially Compatible* | In v1.25.0 there were changes to data dump layout and to online_quantile and isolation_forest_multivariate model states, so to migrate from v1.24.0-v1.24.1 it is recommended to drop the state |
| v1.24.0 | v1.24.1 | Fully Compatible | - |
| v1.23.3 and earlier | v1.24.0 | Fully Incompatible* | *As no state (prior to v1.24.0) existed, it was not saved (even if on-disk mode was used). Also, see config breaking changes list in stateless mode |
For releases v1.27.0 and newer, the migration process is automatically handled by vmanomaly when started with settings.restore_state: true, so no manual intervention is required to clear existing state if incompatible.
However, for releases v1.24.0 - v1.26.2, to clear the existing state (if ended with settings.restore_state: true), please manually delete the existing state database and on-disk artifacts before starting the new version of `vmanomaly - either:
VMANOMALY_MODEL_DUMPS_DIR / VMANOMALY_DATA_DUMPS_DIR folders orsettings.restore_state: false in the config the first run of the new version, then stop vmanomaly, set back settings.restore_state: true, and restart vmanomaly.Used if
settings.restore_stateis set tofalse. See argument details in the configuration documentation.
In stateless mode, the migration process is almost straightforward as there are no persistent states to manage. One may simply upgrade the vmanomaly service to the latest version and restart it, up to a slight change in the config .YAML files for backward-incompatible changes, see the list below.
Breaking Changes
v1.12.0 ARIMA model is removed from built-in models; Action: replace ARIMA by Prophet or alternative seasonal models in model(s) section of your configuration files.
v1.9.0 The sampling_period parameter is now mandatory in VmReader. This change aims to clarify and standardize the frequency of input/output in vmanomaly, thereby reducing uncertainty and aligning with user expectations; Action: Add the sampling_period parameter to your VmReader configuration, e.g.:
reader:
# Other VmReader settings...
sampling_period: 1m
...