Upgrade Guide CX4.10.3 to CX5.0 (Single Tenant/On-Prem)
Before upgrading, ensure that the system is idle, i.e; all agents are logged out from the AgentDesk.
Make sure to FLUSH the Redis before proceeding with the upgrade
Database Migrations
Use the following script to migrate data in MongoDB: MTT_Mongo_Data_Migration_Script.js
Use this guide to run the above script.
Use the following script to migrate data for license manager in Postgresql: lis-manager-mtt-migration.sql
Follow these steps to execute the above SQL script
# Check PostgreSQL Helm release status
helm -n ef-external status ef-postgresql
# This will output some instructions. Follow the next steps based on that output.
# Get the password for "postgres"
# (Copy and run the command that starts with "export" shown after this line in the Helm output)
export POSTGRES_PASSWORD=<your_password>
# Get the password for "sa"
# (Copy and run the command that starts with "export" shown after this line in the Helm output)
export SA_PASSWORD=<your_password>
# Connect to PostgreSQL
# Copy the 3-line command shown in the Helm output after the text:
# "To connect to your database run the following command:"
# Example:
kubectl run ef-postgresql-client --rm --tty -i --restart='Never' \
--namespace ef-external --image gitimages.expertflow.com/general/postgresql:14.5.0-debian-11-r21 \
--env="PGPASSWORD=$POSTGRES_PASSWORD" --command -- psql \
--host ef-postgresql -U postgres -d licenseManager
# Verify youโre inside the PostgreSQL client
# You should now see a prompt like this:
# licenseManager=>
# If not, press Enter once.
# Copy your .sql script into the PostgreSQL pod (if itโs on your local machine)
# Replace ef-postgresql-0 with the actual pod name if it differs.
kubectl cp ./lis-manager-mtt-migration.sql ef-postgresql-0:/tmp/lis-manager-mtt-migration.sql -n ef-external
# Inside the PostgreSQL client, execute your .sql script:
\i /tmp/lis-manager-mtt-migration.sql
# Verify that the table was created
\dt;
# Exit the PostgreSQL client
\q
Custom Configuration Strategy
For detailed guidelines on applying environment-specific configurations using custom values.yaml layering,
Refer to the CX Helm Chart Custom Configuration Strategy guide.
Refer to this guide to see the complete change log
1. Update Helm Repo
helm repo update expertflow
2. Clone the CX Repository on the Target Server
# Create 4.10.1_CLCC-173 directory from root
mkdir 4.10.1_CLCC-173
# Navigate to 4.10.1_CLCC-173
cd 4.10.1_CLCC-173
# Clone the 4.10.1_CLCC-173 branch of cim-solution repository
git clone -b 4.10.1_CLCC-173 https://efcx:RecRpsuH34yqp56YRFUb@gitlab.expertflow.com/cim/cim-solution.git $HOME/4.10.1_CLCC-173
# Navigate to root (previous directory)
cd ..
3. Change Directory to the Current Deployment
cd CX-4.10.3/kubernetes
4. Apply Redis ACL Secret
kubectl -n ef-external create secret generic ef-redis-acl-secret --from-literal=superuser=Expertflow464
5. Deploy Redis
helm show values expertflow/redis --version 5.0-alpha > helm-values/ef-redis-custom-values.yaml
helm upgrade --install=true --namespace=ef-external --values=helm-values/ef-redis-custom-values.yaml redis expertflow/redis --version 5.0-alpha
6. Deploy ActiveMQ
helm show values expertflow/activemq --version 5.0-alpha > helm-values/ef-activemq-custom-values.yaml
7. Deploy Vault
helm show values expertflow/vault --version 5.0-alpha > helm-values/ef-vault-custom-values.yaml
helm uninstall -n vault vault
kubectl get secret mongo-mongodb-ca -n ef-external -o yaml | sed 's/namespace: ef-external/namespace: vault/' | kubectl create -f -
helm upgrade --install --namespace vault --create-namespace vault --debug --values helm-values/ef-vault-custom-values.yaml expertflow/vault --version 5.0-alpha
๐ Use the following guide: Vault Dynamic Database Configuration
8. Copy Schemas and Rule Files for Routing Engine
# Copy GraphQL schemas
cp -r ../../4.10.1_CLCC-173/kubernetes/pre-deployment/routing-engine/graphql/schemas pre-deployment/routing-engine/graphql/schemas
# Copy memory rules
cp ../../4.10.1_CLCC-173/kubernetes/pre-deployment/routing-engine/graphql/graphql-memory-rules.json pre-deployment/routing-engine/graphql/graphql-memory-rules.json
# Copy Redis rules
cp ../../4.10.1_CLCC-173/kubernetes/pre-deployment/routing-engine/graphql/graphql-redis-rules.json pre-deployment/routing-engine/graphql/graphql-redis-rules.json
9. Apply ConfigMaps for Routing Engine
kubectl create configmap -n expertflow routing-engine-graphql-schemas --from-file=./pre-deployment/routing-engine/graphql/schemas
kubectl create configmap -n expertflow routing-engine-graphql-memory-rules --from-file=./pre-deployment/routing-engine/graphql/graphql-memory-rules.json
kubectl create configmap -n expertflow routing-engine-graphql-redis-rules --from-file=./pre-deployment/routing-engine/graphql/graphql-redis-rules.json
10. Upgrade CX Core
helm upgrade --install --namespace expertflow --create-namespace ef-cx --debug --values helm-values/ef-cx-custom-values.yaml expertflow/cx --version 5.0-alpha
11. Upgrade Agent Desk
# Copy translation files
cp -r ../../4.10.1_CLCC-173/kubernetes/pre-deployment/app-translations/unified-agent/i18n pre-deployment/app-translations/unified-agent/i18n
kubectl -n expertflow delete configmap ef-app-translations-cm
kubectl -n expertflow create configmap ef-app-translations-cm --from-file=pre-deployment/app-translations/unified-agent/i18n
# Copy supervisor dashboard file
cp -r ../../4.10.1_CLCC-173/kubernetes/post-deployment/config/grafana/supervisor-dashboards/Supervisor_Dashboard_CIM.json
# Copy agent dashboard file
cp -r ../../4.10.1_CLCC-173/kubernetes/post-deployment/config/grafana/supervisor-dashboards/Agent_Dashboard_CIM.json
kubectl -n expertflow delete configmap ef-grafana-supervisor-dashboard
kubectl -n expertflow create configmap ef-grafana-supervisor-dashboard --from-file=post-deployment/config/grafana/supervisor-dashboards/Supervisor_Dashboard_CIM.json
kubectl -n expertflow delete configmap ef-grafana-agent-dashboard
kubectl -n expertflow create configmap ef-grafana-agent-dashboard --from-file=post-deployment/config/grafana/supervisor-dashboards/Agent_Dashboard_CIM.json
helm upgrade --install --namespace expertflow --set global.efCxReleaseName="ef-cx" cx-agent-desk --debug --values helm-values/cx-agent-desk-custom-values.yaml expertflow/agent-desk --version 5.0-alpha
12. Upgrade Channels
helm upgrade --install --namespace expertflow --set global.efCxReleaseName="ef-cx" --debug cx-channels --values helm-values/cx-channels-custom-values.yaml expertflow/channels --version 5.0-alpha
13. Upgrade Campaigns
helm upgrade --install --namespace expertflow --set global.efCxReleaseName="ef-cx" cx-campaigns --debug --values helm-values/cx-campaigns-custom-values.yaml expertflow/campaigns --version 5.0-alpha
14. Upgrade QM
helm upgrade --install --namespace=expertflow --set global.efCxReleaseName="ef-cx" qm --debug --values=helm-values/cx-qm-custom-values.yaml expertflow/qm --version 5.0-alpha
15. Reporting Configuration
Add the following line to pre-deployment/reportingConnector/reporting-connector.conf:
tenant_id = expertflow
Recreate the ConfigMap:
kubectl -n expertflow delete configmap ef-reporting-connector-conf-cm
kubectl -n expertflow create configmap ef-reporting-connector-conf-cm --from-file=pre-deployment/reportingConnector/reporting-connector.conf
Upgrade Reporting:
helm upgrade --install --namespace expertflow --set global.efCxReleaseName="ef-cx" cx-reporting --debug --values helm-values/cx-reporting-scheduler-custom-values.yaml expertflow/reporting --version 5.0-alpha
16. Upgrade Transflux
helm upgrade --install --namespace expertflow --set global.efCxReleaseName="ef-cx" cx-transflux --debug --values helm-values/cx-transflux-custom-values.yaml expertflow/transflux --version 5.0-alpha
17. Metabase Deployment
Deployment Options
Separate Server: Metabase Deployment Guide
Same Server: Follow steps below.
Dependencies
PostgreSQL (application database)
APISIX (reverse proxy / API gateway)
Deploy Metabase
Navigate to the 4.10.1_CLCC-173/kubernetes/ directory:
cd 4.10.1_CLCC-173/kubernetes/
Step 1: Create Custom Values File
vi helm-values/metabase-custom-values.yaml
Step 2: Add Minimum Required Configuration
global:
ingressRouter: <CUSTOM-FQDN>
๐ Replace
<CUSTOM-FQDN>with your actual domain, e.g.devops.example.com.
Step 3: Deploy
helm upgrade --install=true --debug --namespace=metabase --create-namespace --values=helm-values/metabase-custom-values.yaml metabase expertflow/metabase --version 5.0-alpha
Check Pod
kubectl get pod -n metabase
Access Metabase
Open in browser:
https://<FQDN>/metabase
You should see the Metabase setup page.
Follow this guide to complete setup:
๐ Metabase Setup Guide
Login credentials:
Email: superadmin@admin.com
18. EFCX-Bootstrapping
Webhooks Registeration
First of all we need to add webhooks information in the mongo database for the components which required bootstraping upon teant registration.
Export mongo certs using:
mkdir /tmp/mongodb_certs
CERTFILES=($(kubectl get secret mongo-mongodb-ca -n ef-external -o go-template='{{range $k,$v := .data}}{{$k}}{{"\n"}}{{end}}'))
for f in ${CERTFILES[*]}; do kubectl get secret mongo-mongodb-ca -n ef-external -o go-template='{{range $k,$v := .data}}{{ if eq $k "'$f'"}}{{$v | base64decode}}{{end}}{{end}}' > /tmp/mongodb_certs/${f} 2>/dev/null; done
Go inside kubernets directory and execute command to import data inside webhook collections. Following are commands
cd 4.10.1_CLCC-173/kubernetes
kubectl -n ef-external run mongo-tools --image=mongo:6.0 --restart=Never -- sleep 3600
kubectl -n ef-external cp ./post-deployment/cim-tenant.webhooks.json mongo-tools:/tmp/cim-tenant.webhooks.json
kubectl -n ef-external cp /tmp/mongodb_certs/mongodb-ca-cert mongo-tools:/tmp/mongodb-ca-cert
kubectl -n ef-external cp /tmp/mongodb_certs/client-pem mongo-tools:/tmp/combined.pem
kubectl -n ef-external exec mongo-tools -- \
mongoimport \
--host mongo-mongodb.ef-external.svc.cluster.local \
--port 27017 \
--db cim-tenant \
--collection webhooks \
--file /tmp/cim-tenant.webhooks.json \
--jsonArray \
--ssl \
--sslCAFile /tmp/mongodb-ca-cert \
--sslPEMKeyFile /tmp/combined.pem \
--username root \
--password Expertflow123 \
--authenticationDatabase admin
kubectl -n ef-external delete pod mongo-tools
19. Tenant Onboarding
Step 1: Register a New Tenant
Copy create_tenant.sh from 4.10.1_CLCC-173/kubernetes/post-deployment to post-deployment
Edit
create tenant scriptin post deployment folder, and update the values of tenantId and the fqdn
cd 4.10.1_CLCC-173/kubernetes/post-deployment
vi create_tenant.sh
Set tenantId as expertflow
chmod +x create_tenant.sh
./create_tenant.sh
Step 2: Register Tenant FQDN on Grafana allowedHosts
Follow the steps on this guide.