databaseDatabase Migration

Lenses 5 to 6 Migration Guide

Overview

This guide covers the migration process from Lenses 5 to Lenses 6. The migration path depends on your current database setup.

circle-info

Migration Paths Available:

  • PostgreSQL users: In-place upgrade with downtime

  • H2 users: Migration to PostgreSQL required {% endhint %}

Prerequisites

Before starting the migration:

circle-exclamation

Migration Scenarios

Scenario 1: PostgreSQL In-Place Upgrade

If you're already using PostgreSQL with Lenses 5, you can perform an in-place upgrade.

circle-check

Step-by-Step Process

1

Backup

2

Stop Lenses 5

3

Deploy & Start Lenses Agent

Instruction on how to Deploy & Start Lenses Agent can be found under:

4

Start Lenses Agent

Scenario 2: H2 to PostgreSQL Migration

For users with H2 embedded database, migration to PostgreSQL is required.

{% hint style="danger" %}

Critical: H2 embedded database is not supported in Lenses 6. Migration to PostgreSQL is mandatory. {% endhint %}

Migration Options

{% tabs %} {% tab title="Option A: Export/Import" %}

Best for: Small to medium installations (<100GB data)

1. Prepare PostgreSQL

sql

2. Export H2 Data

bash

3. Transform H2 to PostgreSQL

python

4. Import to PostgreSQL

bash

{% endtab %}

{% tab title="Option B: Migration Tool" %}

Automated Migration Tool

Best for: Large installations, minimal downtime required

Setup Migration Environment

yaml

Migration Configuration

yaml

Run Migration

bash

{% endtab %}

{% tab title="Option C: Script" %}

Comprehensive Migration Script

Best for: Full control, custom requirements

bash

{% endtab %} {% endtabs %}

Post-Migration Steps

1. Configuration Update

Update your Lenses 6 configuration to use PostgreSQL:

hocon

2. Validation Checklist

{% hint style="info" %} Complete all validation steps before considering the migration successful. {% endhint %}

Data Validation

Functional Validation

Performance Validation

3. Monitoring

Set up monitoring for the new installation:

yaml

Rollback Procedure

{% hint style="danger" %} Important: Keep Lenses 5 installation intact until migration is fully validated. {% endhint %}

PostgreSQL Users

bash

H2 Migration Rollback

bash

Troubleshooting

Common Issues

{% tabs %} {% tab title="Connection Issues" %} Problem: Cannot connect to PostgreSQL

bash

Solution: Ensure PostgreSQL is configured to accept connections:

bash

{% endtab %}

{% tab title="Migration Errors" %} Problem: Data type incompatibilities

sql

Problem: Foreign key violations

sql

{% endtab %}

{% tab title="Performance Issues" %} Problem: Slow queries after migration

sql

{% endtab %} {% endtabs %}

Support

{% hint style="warning" %} If you encounter issues not covered in this guide, please contact Lenses support with:

  • Migration logs

  • Error messages

  • Lenses version numbers (source and target)

  • Database versions {% endhint %}

\

Last updated

Was this helpful?