Вы просматриваете старую версию данной страницы. Смотрите текущую версию.

Сравнить с текущим просмотр истории страницы

« Предыдущий Версия 2 Следующий »

If EVI was previously running on the server as a deb package, its data (PostgreSQL and ClickHouse databases) can be migrated to the new Docker deployment. Typically, the installation wizard handles the migration, without the need to run any additional commands.

Automatic migration

During installation, the setup wizard asks whether you want to migrate data from a previous deb installation of EVI:

If the answer is “yes,” the master will:

  1. Stop the EVI deb services on the server;
  2. Take database dumps of PostgreSQL and ClickHouse;
  3. Load the data into the platform’s Docker volumes;
  4. Start the platform’s services.

The migration is performed automatically. No action is required.

Резервная копия

Data dumps are saved in the ./db_transfer_backup folder — this is a backup.

The platform is unavailable during the migration: the old (deb) services have been stopped, and the Docker stack runs after the data has been loaded.

If the answer to the wizard's question during installation was “no,” migration can be run separately:

docker compose run --rm migrate

Manual migration

If the platform is already installed but the data has not yet been transferred, use the transfer_data_to_docker.sh script included with the platform stack.

Step 1. Running the script

Open a terminal in the stack's root directory (in the folder containing the ./core либо docker-compose.yml file for the standalone stack) and run:

./transfer_data_to_docker.sh                # standard stack (./core)
./transfer_data_to_docker.sh --stack-dir .  # standalone stack in the root directory

The script will show which data will be migrated and which services will be stopped. Confirm the script running:

Step 2. Verifying the result

After migration, the platform runs from Docker. Verify that all services are running:

Проверка
docker compose ps      # all services are in a healthy state

Open the platform's web interface at the server address: if the old data (cameras, users, events) is still there, the migration was successful.

Rollback

During migration, host (deb) databases are stopped but not deleted. To revert to the previous installation, do the following:

sudo systemctl start postgresql
sudo systemctl start clickhouse-server

Data dumps are stored in the ./db_transfer_backup/<timestamp>/ folder — they can be used to restore databases.

Technical details

The essence of the migration: the migration performs a logical (dump/restore) transfer of PostgreSQL and ClickHouse data from a deb installation to Docker volumes in the EVI stack — either the Core group (./core, by default) or the standalone stack (--stack-dir .).

This logical migration was chosen intentionally: the major versions of the source and destination differ (PostgreSQL 17 → 18), which makes it impossible to copy the data catalog file by file between them.

Service shutdown: the script shuts down the EVI deb services (angie, evi-core, evi-scud, evi-analytics, evi-live, evi-archive, evi-analyzer) on its own. Otherwise, writing to the database during the dump would result in the loss of recent events. If they are already stopped, this step is disabled using the --no-stop-evi flag.

Prerequisites

  • The script runs from the stack root (the stack directory ./core or the root directory itself must be nearby);
  • The following must be available on the host: pg_dump, psql, clickhouse-client, docker compose;
  • The user must have sudo privileges (to stop systemd services and to run sudo -u postgres during peer authentication).
  • Нет меток