Skip to content
Merged
Changes from 3 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ddd87a8
first version with breaking changes
lorerod Sep 12, 2025
e8cc4ce
fix content
lorerod Sep 12, 2025
fb25939
improve CHT 4.x to 5.x migration guide after local k3s testing
lorerod Sep 15, 2025
a9565fa
improve overview
lorerod Sep 15, 2025
6848986
remove warning
lorerod Sep 15, 2025
039f202
remove warning
lorerod Sep 15, 2025
e99d1f3
improve title
lorerod Sep 15, 2025
72bd771
use native hextra steps
lorerod Sep 16, 2025
c8d6c50
condense breaking changes section into a reference table
lorerod Sep 23, 2025
6c4b5b1
remove unnecessary directory navigation from migration steps
lorerod Sep 23, 2025
999c763
add Hextra tabs
lorerod Sep 23, 2025
f2f5f35
set preExistingDataAvailable to false
lorerod Sep 23, 2025
42c6263
calm down the formatting
lorerod Oct 8, 2025
14552ff
calm down the formatting
lorerod Oct 8, 2025
1533c25
remove redundant statement
lorerod Oct 8, 2025
6002e97
be clear about the edit step
lorerod Oct 8, 2025
1f86f56
remove quoted and add indent
lorerod Oct 8, 2025
cd6187a
be consistent with the use of --namespace
lorerod Oct 8, 2025
baa3230
be consistent with the use of --namespace
lorerod Oct 8, 2025
d076a61
be consistent with the use of --namespace
lorerod Oct 8, 2025
3a9a196
Update content/en/hosting/cht/migration/helm-charts-4x-to-5x-migratio…
lorerod Oct 8, 2025
be684e3
remove quotes
lorerod Oct 8, 2025
1cded21
calm down the formatting
lorerod Oct 8, 2025
d2b17b4
merge overview
lorerod Oct 8, 2025
0a0a731
calm down the formatting
lorerod Oct 8, 2025
e8573a9
calm down the formatting
lorerod Oct 8, 2025
6bd500a
calm down the formatting
lorerod Oct 8, 2025
5a9351d
fix tabbed section broken by the indent
lorerod Oct 8, 2025
1b0cc8f
clarify clustering configuration and fix boolean type issue
lorerod Oct 13, 2025
9212e6d
cleanup booleans
lorerod Oct 23, 2025
3247c53
line up the numbering
lorerod Oct 23, 2025
9dccc2f
line up the numbering
lorerod Oct 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions content/en/hosting/cht/migration/helm-charts-4x-to-5x-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# CHT 4.x to 5.x Helm Charts Migration Guide

This guide covers the migration from CHT 4.x deployments using the legacy Helm charts in the [medic/helm-charts](https://github.com/medic/helm-charts) repository to the new charts introduced in CHT 5.x within the [medic/cht-core](https://github.com/medic/cht-core) repository.

## Overview

The Community Health Toolkit (CHT) has moved its Helm charts from a separate repository (`medic/helm-charts`) to the main CHT Core repository (`medic/cht-core`).
Comment thread
lorerod marked this conversation as resolved.
Outdated

### Key Differences

#### Chart Naming
- **Old**: `medic/cht-chart-4x`
- **New**: `cht-chart` (local chart from cht-core repository)

## Breaking Changes Summary
Comment thread
lorerod marked this conversation as resolved.
Outdated

**IMPORTANT**: The following breaking changes require updates to your existing `values.yaml` files.
Comment thread
lorerod marked this conversation as resolved.
Outdated

### Critical Breaking Changes (Must Fix)
Comment thread
lorerod marked this conversation as resolved.
Outdated

#### 1. Field Name Changes

| Old (4.x) | New (5.x) | Impact |
|-----------|-----------|---------|
| `clusteredCouch_enabled` | `couchdb.clusteredCouchEnabled` | **CRITICAL** - Must be updated |
| `local.diskPath` | `local_storage.preExistingDiskPath-1` | **CRITICAL** - Must be updated |

#### 2. New Required Fields

| Field | Value | Impact |
|-------|-------|---------|
| `api.service.type` | `ClusterIP` | **CRITICAL** - Must be added to values file |
| `preExistingDataAvailable` | `"true"` | **CRITICAL** - Must be set for existing deployments |

#### 3. Storage Configuration Changes

| Change | Impact |
|--------|---------|
| **Removed default storage sizes** | **CRITICAL** - Must explicitly set `couchdb.couchdb_node_storage_size` |
| **No default persistent volume sizes** | **CRITICAL** - Must set platform-specific storage sizes |

#### 4. Values File Structure Changes

| Change | Impact |
|--------|---------|
| **Hierarchical structure** | **MEDIUM** - May need to restructure flat values files |
| **Nested couchdb configuration** | **MEDIUM** - CouchDB settings now under `couchdb:` section |

### Platform-Specific Storage Changes

#### GKE (Google Kubernetes Engine)
- **Required**: `couchdb.persistent_disk.size` (no default)

#### EKS (Amazon Elastic Kubernetes Service)
- **Required**: `ebs.preExistingEBSVolumeSize` (no default)

### Minor Changes

#### Storage Class Changes
- **K3s-K3d Storage Class**: `local-storage` (4.x) → `local-path` (5.x) - **MINOR CHANGE**
- **Action Required**: Update K3s-K3d storage class if using defaults

### Getting Help

If you encounter issues during migration:

1. Check the [CHT Documentation](https://docs.communityhealthtoolkit.org/)
2. Review the [CHT Forum](https://forum.communityhealthtoolkit.org/)
3. Open an issue in the [CHT Core Repository](https://github.com/medic/cht-core/issues)

## Migration Steps

### Step 1: Prepare Migration Values File
Comment thread
lorerod marked this conversation as resolved.

1. **Get current values** from your existing 4.x deployment:
Comment thread
lorerod marked this conversation as resolved.
Outdated
```bash
helm get values <your-release-name> -n <your-namespace> > migration-5x-values.yaml
Comment thread
lorerod marked this conversation as resolved.
Outdated
```

Comment thread
lorerod marked this conversation as resolved.
2. **Apply breaking changes** to your values file:
Comment thread
lorerod marked this conversation as resolved.
Outdated

#### Critical Changes (Must Apply)
Comment thread
lorerod marked this conversation as resolved.
Outdated
```yaml
# Change field names
couchdb:
clusteredCouchEnabled: false # was: clusteredCouch_enabled: false

# Set pre-existing data flag in the case this is a migration
preExistingDataAvailable: "true"

# Add required API service configuration
api:
service:
type: ClusterIP

# Update image versions to 5.x
chtversion: "5.0.0" # or "master" for latest development
cht_image_tag: "5.0.0" # or "master" for latest development
Comment thread
lorerod marked this conversation as resolved.
Outdated
```

#### Platform-Specific Storage Configuration
Comment thread
lorerod marked this conversation as resolved.
Outdated
Comment thread
lorerod marked this conversation as resolved.
Outdated

**For GKE:**
```yaml
couchdb:
persistent_disk:
size: "<size>" # Set appropriate size for your needs
```

**For EKS:**
```yaml
ebs:
preExistingEBSVolumeSize: "<size>" # Set appropriate size for your needs
```

**For K3s-K3d:**
```yaml
couchdb:
storage_class: "local-path" # was: "local-storage"
```

### Step 2: Perform the Migration

1. **Navigate to your 4.x helm chart directory**:
```bash
cd /path/to/your/4x/helm/charts
Comment thread
lorerod marked this conversation as resolved.
Outdated
```

2. **Run the migration upgrade**:
```bash
helm upgrade <your-release-name> /path/to/cht-core/scripts/build/helm \
-f migration-5x-values.yaml \
--namespace <your-namespace>
```
Comment thread
lorerod marked this conversation as resolved.
Outdated

3. **Monitor the upgrade**:
```bash
helm status <your-release-name> --namespace <your-namespace>
kubectl get pods -n <your-namespace>
Comment thread
lorerod marked this conversation as resolved.
Outdated
```

### Step 3: Verify Migration Success

1. **Check pod status**:
Comment thread
lorerod marked this conversation as resolved.
Outdated
```bash
kubectl get pods -n <your-namespace>
```

2. **Verify new 5.x components**:
Comment thread
lorerod marked this conversation as resolved.
Outdated
```bash
# Look for the new couchdb-nouveau component
kubectl get pods -n <your-namespace> | grep nouveau
Comment thread
lorerod marked this conversation as resolved.
Outdated
```

3. **Test data integrity**

4. **Test application access**
Comment thread
lorerod marked this conversation as resolved.
Outdated

## Best Practices

> **⚠️ WARNING**:
Comment thread
lorerod marked this conversation as resolved.
Outdated
1. **Test First**: Always test migrations in a non-production environment
2. **Backup Data**: Ensure complete data backup before migration
3. **Monitor Closely**: Watch deployment logs and metrics during migration
4. **Document Changes**: Keep track of any custom configurations
5. **Plan Downtime**: Schedule migrations during maintenance windows