> For the complete documentation index, see [llms.txt](https://lern.sunbird.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lern.sunbird.org/use/developer-guide/lms-service/reports/other-jobs/cassandra-migrator-job.md).

# Cassandra Migrator Job

To make data analysis more efficient, we are creating a new table called "***report\_user\_enrolments***" in the core cluster. In this table, the partitioning key will be "batchid" instead of "user\_id" as in the current "***sunbird\_courses.user\_enrolments***" table. Both tables have the same columns and datatypes. To migrate the data from the "***user\_enrolments***" table to the "***report\_user\_enrolments***" table, a Cassandra migration job will be used. The Cassandra migrator job performs the data migration from one Cassandra table to another. It reads data from a source table specified in the configuration, performs optional repartitioning based on provided columns, and writes the data to a target table using the Cassandra connector. After the migration is completed successfully, the code generates a metric event with information about the migration, such as the total number of records migrated and the time taken. This metric event is dispatched to a Kafka topic if the configuration allows it. In case of an exception or failure during the migration process, appropriate error handling is performed. The error is logged, and a metric event indicating the failure is generated and dispatched to the Kafka topic if configured.

**Data provider:**

**Cassandra**

1. user\_enrolments

<div data-full-width="true"><figure><img src="/files/embedztRD0iRAuUo8oQJ" alt=""><figcaption></figcaption></figure></div>

\ <br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://lern.sunbird.org/use/developer-guide/lms-service/reports/other-jobs/cassandra-migrator-job.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
