<p>It sounds like something/someone is updating which could be causing the migrations to run and then subsequently fail... that could cause data loss but that's hard to say or know exactly.</p>

<p>When this sort of thing happens, you should be reverting to a last known good backup and then figuring out what went wrong.</p>

<p>That's going to be the only sane way to debug this. I wouldn't try to push something locally onto a bad state on production unless you overwrite everything (which is a hail mary move to restore to a good state).</p>

<p>Are you using Craft 3? The Migration Manager plugin is now called Migration Assistant. Make sure you're using updated versions of the software, as old versions can cause weird issues.</p>

CC BY-SA 4.0
2019-11-25T14:50:34.697Z
Thanks for the advice. Sadly, the issue wasn't immediately caught and when it was I freaked out and rushed towards a solution, thus my ill-advised attempt to recreate the missing fields via Migration Manager. I hadn't noticed that the plugin is now called Migration Assistant, I am going to work on getting that installed today.
muddygrey
CC BY-SA 4.0
2019-11-22T16:10:52.743Z
2019-11-22T16:10:52.743Z
RitterKnight
<p>Recently the organization I work for started a podcast and wanted to add a section on the site where people could find some information about the podcast, some links to subscribe, and more details about each individual episode.</p>

<p>So I created some fields, a field group, and a couple of sections and created migration files using the Migration Manager plugin. Everything was fine for over a month, I am not sure if it was the deployment of some other work or a bug but one day I was alerted to the fact that the podcast episodes on the site were missing information. I went into the control panel to add the data back and was surprised to see those fields were no longer available on the entry. I check the field layout and they were missing there too as well as in the list of fields. So I went back to my local dev environment and created new migration files using Migration Manager. After another deployment that restored the fields. I added the data back and went on with my life. It happened again shortly after and I repeated the process of creating new migration files for the missing fields.</p>

<p>That was a couple weeks back. It happened this morning and I decided that not only was recreating migration files not a sustainable solution but it may be causing more issues.</p>

<p>I logged into the database using Sequel Pro and can see that the fields and the field group no longer exist there, but it looks like the data that was previously entered still exists in the <code>content</code> table as it looks like a new column is created for each field in the system. Additionally, I can see duplicate fields that were almost definitely the result of my multiple migration files. Those fields have their names appended with what looks like some encoded information (ex: <code>field_episodeTeaser_Z9E6Zcu6PN</code>).</p>

<p>Has anyone run into an issue like this? At this point, I am nervous to implement any solution as I have no idea what has caused/is causing this issue. Any help would be greatly appreciated.</p>

CC BY-SA 4.0
2020-04-16T10:17:54.733Z
I've also had this issue - Mysterious fields missing from control panel, only some fields and both craft and some plugins. I did loads of database wrangling to try to fix. My reason was that 'unsafe-eval' was not enabled in my websites CSP headers (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src). Caught me out for a while as I hadn't checked the browser console ‍♀️ Apologies for this being an answer, I'm unable to comment due to not having rep but wanted to reply in case others have this problem.
tomkiss
CC BY-SA 4.0
2019-11-22T23:39:45.167Z
Is project config being used in your setup?
Matthias Redl-Mann
CC BY-SA 4.0
2019-11-25T14:51:09.427Z
Project config is not currently being used. After I get this all sorted out I want to work on getting that set up.
muddygrey
CC BY-SA 4.0
2019-11-26T08:02:12.093Z
OK, good. We had a couple of problems with Project Config and the symptoms were similar to how you described the problem. Anyway, without project config you can ignore my idea.
Matthias Redl-Mann
<craft3><field>
Fields Missing. Gone from Database as Well as Control Panel
# Fields Missing. Gone from Database as Well as Control Panel

(Asked by: username_0 on 2019-11-20)

Recently the organization I work for started a podcast and wanted to add a section on the site where people could find some information about the podcast, some links to subscribe, and more details about each individual episode.

So I created some fields, a field group, and a couple of sections and created migration files using the Migration Manager plugin. Everything was fine for over a month, I am not sure if it was the deployment of some other work or a bug but one day I was alerted to the fact that the podcast episodes on the site were missing information. I went into the control panel to add the data back and was surprised to see those fields were no longer available on the entry. I check the field layout and they were missing there too as well as in the list of fields. So I went back to my local dev environment and created new migration files using Migration Manager. After another deployment that restored the fields. I added the data back and went on with my life. It happened again shortly after and I repeated the process of creating new migration files for the missing fields.

That was a couple weeks back. It happened this morning and I decided that not only was recreating migration files not a sustainable solution but it may be causing more issues.

I logged into the database using Sequel Pro and can see that the fields and the field group no longer exist there, but it looks like the data that was previously entered still exists in the `content` table as it looks like a new column is created for each field in the system. Additionally, I can see duplicate fields that were almost definitely the result of my multiple migration files. Those fields have their names appended with what looks like some encoded information (ex: `field_episodeTeaser_Z9E6Zcu6PN`).

Has anyone run into an issue like this? At this point, I am nervous to implement any solution as I have no idea what has caused/is causing this issue. Any help would be greatly appreciated.

**Tags:** craft3, field

> **Comments:**
> **username_2**: Is project config being used in your setup?  
> **username_0**: Project config is not currently being used. After I get this all sorted out I want to work on getting that set up.  
> **username_2**: OK, good. We had a couple of problems with Project Config and the symptoms were similar to how you described the problem. Anyway, without project config you can ignore my idea.  
> **username_1**: I've also had this issue - Mysterious fields missing from control panel, only some fields and both craft and some plugins. I did loads of database wrangling to try to fix. My reason was that 'unsafe-eval' was not enabled in my websites CSP headers (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src). Caught me out for a while as I hadn't checked the browser console ‍♀️ Apologies for this being an answer, I'm unable to comment due to not having rep but wanted to reply in case others have this problem.  

---

## 1 answers

### Answer by username_3 on 2019-11-22. Score: 1

It sounds like something/someone is updating which could be causing the migrations to run and then subsequently fail... that could cause data loss but that's hard to say or know exactly.

When this sort of thing happens, you should be reverting to a last known good backup and then figuring out what went wrong.

That's going to be the only sane way to debug this. I wouldn't try to push something locally onto a bad state on production unless you overwrite everything (which is a hail mary move to restore to a good state).

Are you using Craft 3? The Migration Manager plugin is now called Migration Assistant. Make sure you're using updated versions of the software, as old versions can cause weird issues.

> **Comments:**
> **username_0**: Thanks for the advice. Sadly, the issue wasn't immediately caught and when it was I freaked out and rushed towards a solution, thus my ill-advised attempt to recreate the missing fields via Migration Manager. I hadn't noticed that the plugin is now called Migration Assistant, I am going to work on getting that installed today.  

---

