# Will removing a fielddefinition also remove the data?

**URL:** <https://forum.litium.com/t/will-removing-a-fielddefinition-also-remove-the-data/560>\
**Category:** Questions\
**Created:** [February 6, 2019, 8:54am UTC](https://forum.litium.com/t/will-removing-a-fielddefinition-also-remove-the-data/560 "2019-02-06T08:54:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zsrdos](https://avatars.discourse-cdn.com/v4/letter/z/74df32/32.png) [@Zsrdos](https://forum.litium.com/u/Zsrdos)\
**Post date:** [February 6, 2019, 8:54am UTC](https://forum.litium.com/t/will-removing-a-fielddefinition-also-remove-the-data/560/1 "2019-02-06T08:54:12Z")

</div>

Hi, if I create a fielddef with id “mynewfield” add it to a to a page and save “myValue” to that field.

Then remove the fielddefinition from the database or admin, will this remove myValue from my page field data, or will it still be there? Accessible if i add black the fielddef laster?

Litium version: 7.1

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [February 6, 2019, 9:08am UTC](https://forum.litium.com/t/will-removing-a-fielddefinition-also-remove-the-data/560/2 "2019-02-06T09:08:16Z")

</div>

It should remove “myValue” from the page.

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [February 6, 2019, 9:09am UTC](https://forum.litium.com/t/will-removing-a-fielddefinition-also-remove-the-data/560/3 "2019-02-06T09:09:22Z")

</div>

If you remove the field the data will also be removed.

---

<div class="post-metadata">

**Author:** ![PontvsXlent](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@PontvsXlent](https://forum.litium.com/u/PontvsXlent)\
**Post date:** [February 6, 2019, 7:06pm UTC](https://forum.litium.com/t/will-removing-a-fielddefinition-also-remove-the-data/560/4 "2019-02-06T19:06:46Z")

</div>

That does not seem to be the case in our 7.1 environment.  
I just moved a TextOption Field from the Baseproduct fields to the Variant fields via the BO, and the data is still in the db.

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [February 6, 2019, 9:16pm UTC](https://forum.litium.com/t/will-removing-a-fielddefinition-also-remove-the-data/560/5 "2019-02-06T21:16:58Z")

</div>

Removing the field is the same as delete the field definition.

Field template is used for example that the administration should know what it should render for the administrator. Moving a field to be visible on the variant instead of the base product should not remove it’s data.

The field does not need to be in the template at all to be used from the api.

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [February 6, 2019, 9:20pm UTC](https://forum.litium.com/t/will-removing-a-fielddefinition-also-remove-the-data/560/6 "2019-02-06T21:20:25Z")

</div>

> [@Zsrdos](#):
>
> Then remove the fielddefinition from the database or admin

I stronly recommend thst you should use the admin or the api from code to do changes. If you are doing changes directly in database it is to easy to miss update any related data or trigger correct events in the api that corresponding to the changes in database.

---

<div class="post-metadata">

**Author:** ![PontvsXlent](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@PontvsXlent](https://forum.litium.com/u/PontvsXlent)\
**Post date:** [February 7, 2019, 7:58am UTC](https://forum.litium.com/t/will-removing-a-fielddefinition-also-remove-the-data/560/7 "2019-02-07T07:58:37Z")

</div>

> [@patric.forsgard](#):
>
> Removing the field is the same as delete the field definition

Sorry, I missunderstood.
