# Modify DocumentTypes

**URL:** <https://community.bloomreach.com/t/modify-documenttypes/2202>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [October 31, 2020, 7:07am UTC](https://community.bloomreach.com/t/modify-documenttypes/2202 "2020-10-31T07:07:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/thomas/32/753_2.png) [@Thomas](https://community.bloomreach.com/u/Thomas)\
**Post date:** [October 31, 2020, 7:07am UTC](https://community.bloomreach.com/t/modify-documenttypes/2202/1 "2020-10-31T07:07:18Z")

</div>

After some month of development. I am cleaning up my code.  
To follow my own conventions I would like to change some names in document types.

So I tried to change the name of a document type from `osde_40:Glossar` to `osde_40:glossar` !  
I did the changes in the exported YAML-Files and bootstraped the application with the changes.

That worked so far.

When using a document with that type in a list I get a log entry saying that the document type `osde_40:Glossar` is not found by the DocTypeService (?) and the bean attributes are not availiable in the template. After filtering the list by a facet and removing the filter everything works fine.

I assume I missed to change the name somewhere. Can you give me a hint ?  
Is my approach for that kind of change the correct one?  
Is there a better way to achieve, what I want?

---

<div class="post-metadata">

**Author:** ![jeroen.hoffman](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jeroen.hoffman/32/43_2.png) [@jeroen.hoffman](https://community.bloomreach.com/u/jeroen.hoffman)\
**Post date:** [November 2, 2020, 8:59am UTC](https://community.bloomreach.com/t/modify-documenttypes/2202/2 "2020-11-02T08:59:10Z")

</div>

Hi Thomas,  
Document type names are also present in your .cnd file. Unfortunately cnd is very strict and only fields additions and type additions are changes that are backwards compatible, see [1]. So this may seems to be alright locally on clean bootstrapped data, but once you deploy on existing data there is going to be a RepositoryException.

So before looking into the dropdown issue, I’d test a deployment locally on existing storage to see how the upgrade behaves. I’m not expecting this change to take in.

Regards, Jeroen

[1] [https://documentation.bloomreach.com/11/about/upgrade/namespace-migration.html](https://documentation.bloomreach.com/11/about/upgrade/namespace-migration.html)

---

<div class="post-metadata">

**Author:** ![Thomas](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/thomas/32/753_2.png) [@Thomas](https://community.bloomreach.com/u/Thomas)\
**Post date:** [November 2, 2020, 9:32am UTC](https://community.bloomreach.com/t/modify-documenttypes/2202/3 "2020-11-02T09:32:27Z")

</div>

Hi Jeroen,

I forgot to mention, that I also changed the .cnd file.

> [@jeroen.hoffman](#):
>
> So this may seems to be alright locally on clean bootstrapped data, but once you deploy on existing data there is going to be a RepositoryException.

**What exactly does that mean ?**

Here are all steps I performed:

1. I changed the name in the .cnd file
2. I changed the yaml of the documentType in `src/main/resources/hcm-config/namespaces/osde_40/Glossar.yaml`
3. I changed the documents, created with that documenmt-type under `src/main/resources/hcm-content/content/documents/osde_40/glossar.yaml`
4. I changed the filter in the facet: `src/main/resources/hcm-content/content/documents/osde_40/glossarFacets.yaml`
5. I deleted the gnerated bean-Class
6. I deleted storage- and target folder, before starting the application

Shouldn’ that work?  
I know decided to create a new document-type and deleted the other one- since I do not have a productive version yet, that is an option.

**But I would like to really understand what is going on!!**

---

<div class="post-metadata">

**Author:** ![jeroen.hoffman](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jeroen.hoffman/32/43_2.png) [@jeroen.hoffman](https://community.bloomreach.com/u/jeroen.hoffman)\
**Post date:** [November 2, 2020, 11:02am UTC](https://community.bloomreach.com/t/modify-documenttypes/2202/4 "2020-11-02T11:02:04Z")

</div>

This should work yes but I expect this to fail if you do NOT delete local storage, i.e. deploy on a storage with osde\_40:Glossar in the cnd (and instances).

However, if you don’t have osde\_40:Glossar definition nor instances in production yet, it can work.

Then you should have a look where the log entry (saying `osde_40:Glossar` is not found) comes from, based on what data (facets, right?).

HTH  
Jeroen

---

<div class="post-metadata">

**Author:** ![Thomas](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/thomas/32/753_2.png) [@Thomas](https://community.bloomreach.com/u/Thomas)\
**Post date:** [November 2, 2020, 11:21am UTC](https://community.bloomreach.com/t/modify-documenttypes/2202/5 "2020-11-02T11:21:05Z")

</div>

Thanks for your response.  
As I decided to create a new doctype and delete the old one-  
I can not reproduce the error (I also did not commit the changes ☹ )  
But as I remember it was the `DocumentTypesService’ !

At the end for me is important, that I had the correct approach 🙂
