Skip to main content
Skip table of contents

Data Migration-Structural Changes (CX4.4.x-CX4.5)

The primary changes from CX4.4.x to CX4.5 can be reviewed from the Release Notes. However, from a technical perspective, this document outlines the major structural changes required to perform in CX4.4.x-based data to migrate it successfully to CX4.5.

Conversation Manager DB

  1. There is an addition of 1 new collection under Conversation Manager DB (conversation-manager_db) named: rooms To know more about rooms, you can refer to the release document for a detailed description.

    DB: conversation-manager_db

In [4.4] Collections were:

In [CX4.5] Collections are:

conversations

conversations

CustomerTopicEvents

CustomerTopicEvents

ConversationActivities

ConversationActivities

rooms

  1. In conversations collection, roomInfo is added in each conversation document at root level. Sample difference in payload is mentioned below:

In [4.4] conversation Payload was:

In [4.5] conversation Payload is:

CODE
{
  "_id": {
    ...  
  },
  "customer": {
    ...  
  },
  ...  
  "participants": [],
  "state": "CLOSING",
  "conversationDirection": "INBOUND",
  "channelSession": "...",
  "creationTime": {
    ...  
  },
  "endTime": {
    ...  
  },
  "conversationData": {},
  "botId": "...",
  "lastUsedChannelSession": "...",
  ...  
  "_class": "com.ef.conversationmanager.model.ConversationEntity"
}
CODE
{
  "_id": {
    ...  
  },
  "customer": {
    ...  
  },
  ...  
  "participants": [],
  "state": "CLOSING",
  "conversationDirection": "INBOUND",
  "channelSession": "...",
  "creationTime": {
    ...  
  },
  "endTime": {
    ...  
  },
  "conversationData": {},
  "botId": "679b833b0c24fc53293e139c",
  "lastUsedChannelSession": "67bc229ad3513931ff306f7f",
  "roomInfo": {
    "_id": {
      "$oid": "..."
    },
    "mode": "CONTACT_CENTER"
  },
  ...  
  "_class": "com.ef.conversationmanager.model.ConversationEntity"
}

  1. In the CustomerTopicEvents collection, multiple types of events exist. Common changes in all events are the addition of roomId and roomInfo at different points of the document.

    For all the events, the roomId attribute is added at the root level of an event with the room id. Also, the roomInfo attribute is added at the root level of the cimEvent attribute. Additionally, if the cimEvent attribute contains the channelSession attribute as well, then roomInfo is also added at the root level of it.

    document.roomId = <roomInfo-Id>;
    document.cimEvent.roomInfo = { _id: <roomInfo-Id>, mode: "CONTACT_CENTER" };
    document.cimEvent.channelSession.roomInfo = { _id: <roomInfo-Id>, mode: "CONTACT_CENTER" };

    Other than this, there are some new attributes as well that are added in different events. Lets review each type of documents below:

    1. For event with name CHANNEL_SESSION_STARTED and CHANNEL_SESSION_ENDED and CHANNEL_SESSION_EXPIRED

      1. document.cimEvent.data.roomInfo = {
        id: <roomInfo-Id>,
        mode: "CONTACT_CENTER"
        };

    2. For event with name REMOVE_CHANNEL_SESSION

      1. document.cimEvent.data.channelSession.roomInfo = {
        id: <roomInfo-Id>,
        mode: "CONTACT_CENTER"
        };

    3. For event with name TOPIC_STATE_CHANGE_EVENT

      1. document.cimEvent.data.roomInfo = {
        id: <roomInfo-Id>,
        mode: "CONTACT_CENTER"
        };

      2. document.cimEvent.data.agentSla = {
        totalDuration: null,
        action: null,
        startTime: null
        };

      3. document.cimEvent.data.holdTimerDetails = {
        totalDuration: null,
        startTime: null
        };

      4. document.cimEvent.data.cachedAgentSlaDuration = 0;

      5. document.cimEvent.data.channelSession.roomInfo = {
        id: <roomInfo-Id>,
        mode: "CONTACT_CENTER"
        };

      6. document.cimEvent.data.metadata.lastUsedChannelSession.roomInfo = {
        id: <roomInfo-Id>,
        mode: "CONTACT_CENTER"
        };

      7. Also, the attribute event.cimEvent.data.metadata.agentRequestStatus is deleted from this event’s data.

    4. For event with name TASK_STATE_CHANGED, now there are 2 items in task. Task and TaskMedia. One Task can contain more than one TaskMedia. The details of all the changes related to Task changes can be found in Release Notes. However, the data migration related difference in TASK_STATE_CHANGED event is mentioned below:

In [4.4] TASK_STATE_CHANGED was:

In [4.5] TASK_STATE_CHANGED is:

CODE
{
  "_id": {
    "$oid": "..."
  },
  "customerId": "...",
  "topicId": "...",
  "cimEvent": {
    "_id": {
      "$oid": "..."
    },
    "name": "TASK_STATE_CHANGED",
    "type": "NOTIFICATION",
    "timestamp": {
      ...    
    },
    "conversationId": "...",
    ...    
    "data": {
      "id": "...",
      "channelSession": {
        "participantType": "ChannelSession",
        "id": "...",
        ...        
        "channelSessionDirection": "INBOUND",
        "active": true
      },
      "mrd": {
        "id": "...",
        "name": "CHAT",
        "description": "Standard chat MRD",
        "interruptible": false,
        "maxRequests": 5,
        "managedByRe": true
      },
      "queue": {
        "id": "...",
        "name": "Queue-1"
      },
      "priority": 1,
      "state": {
        "name": "QUEUED",
        "reasonCode": null
      },
      "type": {
        "direction": "INBOUND",
        "mode": "QUEUE",
        "metadata": {
          "offerToAgent": true
        }
      },
      "assignedTo": null,
      "enqueueTime": {
        "$numberLong": "..."
      },
      "answerTime": null,
      "handleTime": 0
    }
  },
  ...  
  "_class": "com.ef.conversationmanager.model.TopicEventEntity"
}
CODE
{
  "_id": {
    "$oid": "..."
  },
  "customerId": "...",
  "topicId": "...",
  "cimEvent": {
    "_id": {
      "$oid": "..."
    },
    "name": "TASK_STATE_CHANGED",
    "type": "NOTIFICATION",
    "timestamp": {
      ...    
    },
    "conversationId": "...",
    ...    
    "data": {
      "task": {
        "id": "...",
        "conversationId": "...",
        "state": {
          "name": "ACTIVE",
          "reasonCode": null
        },
        "assignedTo": null,
        "agentRequestTtlTimerId": "...",
        "activeMedia": [
          {
            "id": "...",
            "mrdId": "...",
            "taskId": "...",
            "queue": {
              "id": "...",
              "name": "Queue-1"
            },
            "type": {
              "direction": "INBOUND",
              "mode": "QUEUE",
              "metadata": {
                "offerToAgent": true
              }
            },
            "priority": 1,
            "state": "QUEUED",
            "requestSession": {
               ...            
            },
            "channelSessions": [
              {
                "participantType": "ChannelSession",
                "id": "...",
                ...              
              }
            ],
            "enqueueTime": {
              "$numberLong": "..."
            },
            "answerTime": 0
          }
        ]
      },
      "taskStateChanged": true,
      "mediaStateChanges": [
        "<TaskMediaId>"
      ]
    },
    "roomInfo": {
      "_id": {
        "$oid": "..."
      },
      "mode": "CONTACT_CENTER"
    }
  },
  "timestamp": {
    ...  
  },
  "recordCreationTime": {
    ...
  },
  "roomId": "...",
  ...  
  "_class": "com.ef.conversationmanager.model.TopicEventEntity"
}

e. For event with name TASK_ENQUEUED and AGENT_RESERVED, the changes related to its data is mentioned below:

In [4.4] TASK_ENQUEUED and AGENT_RESERVED was:

In [4.5] TASK_ENQUEUED and AGENT_RESERVED is:

CODE
{
  "_id": {
    ...  
  },
  "customerId": "...",
  "topicId": "...",
  "cimEvent": {
    "_id": {
      ...    
    },
    "name": "TASK_ENQUEUED",
    "type": "NOTIFICATION",
    "timestamp": {
      ...    
    },
    "conversationId": "...",
    ...    
    "data": {
      "task": {
        "id": "...",
        "channelSession": {
          ...          
          "channelSessionDirection": "INBOUND",
          "active": true
        },
        "mrd": {
          "id": "...",
          "name": "CHAT",
          "description": "Standard chat MRD",
          "interruptible": false,
          "maxRequests": 5,
          "managedByRe": true
        },
        "queue": {
          "id": "...",
          "name": "Queue-1"
        },
        "priority": 1,
        "state": {
          "name": "QUEUED",
          "reasonCode": null
        },
        "type": {
          "direction": "INBOUND",
          "mode": "QUEUE",
          "metadata": {
            "offerToAgent": true
          }
        },
        "assignedTo": null,
        "enqueueTime": {
          "$numberLong": "..."
        },
        "answerTime": null,
        "handleTime": 0
      },
      "queue": {
        "id": "...",
        "name": "Queue-1"
      }
    }
  },
  "timestamp": {
    ...  
  },
  "recordCreationTime": {
    ...  
  },
  ...  
  "_class": "com.ef.conversationmanager.model.TopicEventEntity"
}
CODE
{
  "_id": {
    ...  
  },
  "customerId": "...",
  "topicId": "...",
  "cimEvent": {
    "_id": {
      ...    
    },
    "name": "TASK_ENQUEUED",
    "type": "NOTIFICATION",
    "timestamp": {
      ...    
    },
    "conversationId": "...",
    ...    
    "data": {
      "task": {
        "id": "...",
        "conversationId": "...",
        "state": {
          "name": "ACTIVE",
          "reasonCode": null
        },
        "assignedTo": null,
        "agentRequestTtlTimerId": "...",
        "activeMedia": [
          {
            "id": "...",
            "mrdId": "...",
            "taskId": "...",
            "queue": {
              "id": "...",
              "name": "Queue-1"
            },
            "type": {
              "direction": "INBOUND",
              "mode": "QUEUE",
              "metadata": {
                "offerToAgent": true
              }
            },
            "priority": 1,
            "state": "QUEUED",
            "requestSession": {
              ....            
            },
            "channelSessions": [
              {
                "participantType": "ChannelSession",
                "id": "...",
                ...                
                "roomInfo": {
                  "id": "...",
                  "mode": "CONTACT_CENTER"
                },
                "state": {
                  "name": "STARTED",
                  "reasonCode": "CUSTOMER"
                },
                "channelSessionDirection": "INBOUND",
                "active": true
              }
            ],
            "enqueueTime": {
              "$numberLong": "..."
            },
            "answerTime": 0
          }
        ]
      },
      "queue": {
        "id": "...",
        "name": "Queue-1"
      }
    },
    "roomInfo": {
      "_id": {
        "$oid": "..."
      },
      "mode": "CONTACT_CENTER"
    }
  },
  "timestamp": {
    ...  
  },
  "recordCreationTime": {
    ...  
  },
  ...  
  "roomId": "...",
  "_class": "com.ef.conversationmanager.model.TopicEventEntity"
}
  1. In ConversationActivities collection, there are multiple types of activities that exists. Common changes in all activities is the addition of roomId and roomInfo at different points of the document.

    For all the activities, roomId attribute is added at root level of activity with the room id. Also, roomInfo attribute is added at root level of activity attribute. Additionally, if the activity attribute contains channelSession attribute as well, then roomInfo is also added at root level of it.

    document.roomId = <roomInfo-Id>;
    document.activity.roomInfo = { _id: <roomInfo-Id>, mode: "CONTACT_CENTER" };
    document.activity.channelSession.roomInfo = { _id: <roomInfo-Id>, mode: "CONTACT_CENTER" };

    Other than this, there are some new attributes as well that are added in different activities. Lets review each type of activities below:

    1. For activity with name CHANNEL_SESSION_STARTED and CHANNEL_SESSION_ENDED and CHANNEL_SESSION_EXPIRED
      document.activity.data.roomInfo = {
      id: <roomInfo-Id>,
      mode: "CONTACT_CENTER"
      };

    2. For activity with name REMOVE_CHANNEL_SESSION

      1. document.activity.data.channelSession.roomInfo = {
        id: <roomInfo-Id>,
        mode: "CONTACT_CENTER"
        };

    3. For activity with name TOPIC_STATE_CHANGE_EVENT

      1. document.activity.data.roomInfo = {
        id: <roomInfo-Id>,
        mode: "CONTACT_CENTER"
        };

      2. document.activity.data.agentSla = {
        totalDuration: null,
        action: null,
        startTime: null
        };

      3. document.activity.data.holdTimerDetails = {
        totalDuration: null,
        startTime: null
        };

      4. document.activity.data.cachedAgentSlaDuration = 0;

      5. document.activity.data.channelSession.roomInfo = {
        id: <roomInfo-Id>,
        mode: "CONTACT_CENTER"
        };

      6. document.activity.data.metadata.lastUsedChannelSession.roomInfo = {
        id: <roomInfo-Id>,
        mode: "CONTACT_CENTER"
        };

      7. Also, the attribute document.activity.data.metadata.agentRequestStatus is deleted from this activity’s data.

    4. For activity with name TASK_STATE_CHANGED, again, now there are 2 items in task. Task and TaskMedia. One Task can contain more than one TaskMedia. The details of all the changes related to Task changes can be found in Release Notes. However, the data migration related difference in TASK_STATE_CHANGED activity is mentioned below:

In [4.4] TASK_STATE_CHANGED was:

In [4.5] TASK_STATE_CHANGED is:

CODE
{
  "_id": {
    "$oid": "..."
  },
  "customerId": "...",
  "conversationId": "...",
  "channelSessionId": "...",  
  "activity": {
    "_id": {
      "$oid": "..."
    },
    "name": "TASK_STATE_CHANGED",
    "type": "NOTIFICATION",
    "timestamp": {
      ...    
    },
    "conversationId": "...",
    ...    
    "data": {
      "id": "...",
      "channelSession": {
        "participantType": "ChannelSession",
        "id": "...",
        ...        
        "channelSessionDirection": "INBOUND",
        "active": true
      },
      "mrd": {
        "id": "...",
        "name": "CHAT",
        "description": "Standard chat MRD",
        "interruptible": false,
        "maxRequests": 5,
        "managedByRe": true
      },
      "queue": {
        "id": "...",
        "name": "Queue-1"
      },
      "priority": 1,
      "state": {
        "name": "QUEUED",
        "reasonCode": null
      },
      "type": {
        "direction": "INBOUND",
        "mode": "QUEUE",
        "metadata": {
          "offerToAgent": true
        }
      },
      "assignedTo": null,
      "enqueueTime": {
        "$numberLong": "..."
      },
      "answerTime": null,
      "handleTime": 0
    }
  },
  ...  
}
CODE
{
  "_id": {
    "$oid": "..."
  },
  "customerId": "...",
  "conversationId": "...",
  "channelSessionId": "...",  
  "activity": {
    "_id": {
      "$oid": "..."
    },
    "name": "TASK_STATE_CHANGED",
    "type": "NOTIFICATION",
    "timestamp": {
      ...    
    },
    "conversationId": "...",
    ...    
    "data": {
      "task": {
        "id": "...",
        "conversationId": "...",
        "state": {
          "name": "ACTIVE",
          "reasonCode": null
        },
        "assignedTo": null,
        "agentRequestTtlTimerId": "...",
        "activeMedia": [
          {
            "id": "...",
            "mrdId": "...",
            "taskId": "...",
            "queue": {
              "id": "...",
              "name": "Queue-1"
            },
            "type": {
              "direction": "INBOUND",
              "mode": "QUEUE",
              "metadata": {
                "offerToAgent": true
              }
            },
            "priority": 1,
            "state": "QUEUED",
            "requestSession": {
               ...            
            },
            "channelSessions": [
              {
                "participantType": "ChannelSession",
                "id": "...",
                ...              
              }
            ],
            "enqueueTime": {
              "$numberLong": "..."
            },
            "answerTime": 0
          }
        ]
      },
      "taskStateChanged": true,
      "mediaStateChanges": [
        "<TaskMediaId>"
      ]
    },
    "roomInfo": {
      "_id": {
        "$oid": "..."
      },
      "mode": "CONTACT_CENTER"
    }
  },
  "timestamp": {
    ...  
  },
  "recordCreationTime": {
    ...
  },
  "roomId": "...",
  ...  
}

e. For event with name TASK_ENQUEUED and AGENT_RESERVED, the changes related to its data is mentioned below:

In [4.4] TASK_ENQUEUED and AGENT_RESERVED was:

In [4.5] TASK_ENQUEUED and AGENT_RESERVED is:

CODE
{
  "_id": {
    ...  
  },
  "customerId": "...",
  "conversationId": "...",
  ...  
  "activity": {
    "_id": {
      ...    
    },
    "name": "TASK_ENQUEUED",
    "type": "NOTIFICATION",
    "timestamp": {
      ...    
    },
    "conversationId": "...",
    ...    
    "data": {
      "task": {
        "id": "...",
        "channelSession": {
          ...          
          "channelSessionDirection": "INBOUND",
          "active": true
        },
        "mrd": {
          "id": "...",
          "name": "CHAT",
          "description": "Standard chat MRD",
          "interruptible": false,
          "maxRequests": 5,
          "managedByRe": true
        },
        "queue": {
          "id": "...",
          "name": "Queue-1"
        },
        "priority": 1,
        "state": {
          "name": "QUEUED",
          "reasonCode": null
        },
        "type": {
          "direction": "INBOUND",
          "mode": "QUEUE",
          "metadata": {
            "offerToAgent": true
          }
        },
        "assignedTo": null,
        "enqueueTime": {
          "$numberLong": "..."
        },
        "answerTime": null,
        "handleTime": 0
      },
      "queue": {
        "id": "...",
        "name": "Queue-1"
      }
    }
  },
  "timestamp": {
    ...  
  },
  "recordCreationTime": {
    ...  
  },
  ...  
}
CODE
{
  "_id": {
    ...  
  },
  "customerId": "...",
  "conversationId": "...",
  ...  
  "activity": {
    "_id": {
      ...    
    },
    "name": "TASK_ENQUEUED",
    "type": "NOTIFICATION",
    "timestamp": {
      ...    
    },
    "conversationId": "...",
    ...    
    "data": {
      "task": {
        "id": "...",
        "conversationId": "...",
        "state": {
          "name": "ACTIVE",
          "reasonCode": null
        },
        "assignedTo": null,
        "agentRequestTtlTimerId": "...",
        "activeMedia": [
          {
            "id": "...",
            "mrdId": "...",
            "taskId": "...",
            "queue": {
              "id": "...",
              "name": "Queue-1"
            },
            "type": {
              "direction": "INBOUND",
              "mode": "QUEUE",
              "metadata": {
                "offerToAgent": true
              }
            },
            "priority": 1,
            "state": "QUEUED",
            "requestSession": {
              ....            
            },
            "channelSessions": [
              {
                "participantType": "ChannelSession",
                "id": "...",
                ...                
                "roomInfo": {
                  "id": "...",
                  "mode": "CONTACT_CENTER"
                },
                "state": {
                  "name": "STARTED",
                  "reasonCode": "CUSTOMER"
                },
                "channelSessionDirection": "INBOUND",
                "active": true
              }
            ],
            "enqueueTime": {
              "$numberLong": "..."
            },
            "answerTime": 0
          }
        ]
      },
      "queue": {
        "id": "...",
        "name": "Queue-1"
      }
    },
    "roomInfo": {
      "_id": {
        "$oid": "..."
      },
      "mode": "CONTACT_CENTER"
    }
  },
  "timestamp": {
    ...  
  },
  "recordCreationTime": {
    ...  
  },
  ...  
  "roomId": "...",
  ...
}

Routing Engine DB

DB: routing-engine_db

  1. mrdTypes collection is added which contains the MRD types. The already defined MRD Types are CHAT CX_VOICE CISCO_CC only. All MRDs now must belongs to any of MRD Type.

  2. A type attribute is added, interruptible and managedByRe is removed from each MRD document from mediaRoutingDomains collection as mentioned in the payload below.

In [4.4] MRD payload was:

In [4.5] MRD payload is:

CODE
{
  "_id": {
    "$oid": "..."
  },
  "name": "CHAT",
  "description": "Standard chat MRD",
  "maxRequests": 5,
  "interruptible": false,
  "managedByRe": true,
  ...
}
CODE
{
  "_id": {
    "$oid": "..."
  },
  "type": "...<id>",
  "name": "CHAT",
  "description": "Standard chat MRD",
  "maxRequests": 5,  
  ...
}
  1. In precisionQueues collection, agentSlaDuration attribute is added at the root level.

Admin Panel DB

DB: adminPanel

  1. In pullmodelists collection, agentSlaDuration attribute is added at root level with 120 as default value.

  2. In agentdesksettings collection, isAutoAnswerEnabled attribute is added at root level with false as default value.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.