> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/public-finance/v2.3/platform/configuration/promotion-docs/department-entity-service-promotion.md).

# Department Entity Service Promotion

Department Entity service manages the department and its hierarchies metadata. It deals with department entities and department hierarchy only. Department Entity and Department Hierarchy were earlier in the iFIX core. Now, they have been moved to the mGramSeva iFIX adapter side. This page provides details on how to migrate that data from iFIX DB to mGramSeva iFIX adapter DB.

## Steps To Migrate

1. Create (if it's not available) DB schema (Mongo) in mgramseva namespace.
2. Create (if it's not available) DB schema (Mongo) in mgramseva namespace.
3. We can drop unused collections from iFix DB using the below steps :
   1. &#x20;Connect to ifix namespace playground pod&#x20;

      &#x20;      `kubectl exec -it <playground-pod-name> -n ifix -- /bin/bash`
   2. Connect to the particular mongo db

      &#x20;       `mongo --host <hostname>:27017 -u <username> -p <password>`
   3. Use db

      &#x20;       `use  <db_name>`
   4. Check the above-mentioned collection name using the below commands

      &#x20;      `db.getCollectionNames();`
   5. If above mentioned (highlighted in bold) collections are there then drop them off using below commands

      &#x20;        `db.departmentEntity.drop();`

      &#x20;        `db.departmentHierarchyLevel.drop();`

## Steps To Use Department Entity Service&#x20;

Port-forward the Department Entity service in localhost from a specific environment (like QA/UAT/Prod). Below is the command to port-forward :

&#x20;   `kubectl port-forward <pod-name> 8032:8080 -n mgramseva`

## **Technical Doc**

#### [Department Entity Service v2.0](#inlinecard-hardbreak) <a href="#inlinecard-hardbreak" id="inlinecard-hardbreak"></a>

> [![Creative Commons License](https://i.creativecommons.org/l/by/4.0/80x15.png)*​*](http://creativecommons.org/licenses/by/4.0/)*All content on this page by* [*eGov Foundation*](https://egov.org.in/) *is licensed under a* [*Creative Commons Attribution 4.0 International License*](http://creativecommons.org/licenses/by/4.0/)*.*


---

# 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://docs.digit.org/public-finance/v2.3/platform/configuration/promotion-docs/department-entity-service-promotion.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.
