Search code examples
phpdatabaseexpressionengine

Database errors when deleting channel fields within an ExpressionEngine site using Multisite Manager


I'm using ExpressionEngine 2.5.2 with my Media Temple site.

I recently added a second site using Multisite Manager on my local environment, staging environment, and production environment. The installation is complete and I have my second templates working correctly. I am only working on my local set up, but as soon as I have this up and running without errors, I will be moving all of my changes over to my staging site, then production site. Locally, when I try to add new channels field groups to my second site within my ExpressionEngine control pannel, my newly created channel field groups are automatically showing the channel fields from my primary site. I cannot delete the old channel fields, because I am receiving the following database error(s):

Error Number: 1091

Can't DROP 'field_id_176'; check that column/key exists

ALTER TABLE exp_channel_data DROP field_id_176

Filename: libraries/api/Api_channel_fields.php

Line Number: 434

This error is different depending on the channel field I try to delete. It will vary by listing a different database entry that it cannot drop (i.e . 'field_id_176,' 'field_id_178,' etc.)

If I manually delete those fields in my database, it removes them from my second site, but it also removes them from my primary site. Obviously this is a problem because I am racking up too many fields which is very confusing. I'm also worried that this will cause an even larger problem when I move to working on my production server. Help would be greatly appreciated.

I also cannot delete the second site, because it gives me the same database errors. When I try to hook up a third site, it does not recognize the folder with my templates in it and the Template Manager page shows up with no templates or template groups (the folders exist locally and all of my paths to the appropriate directories are correct).

Thanks!


Here is a screenshot of a newly-created channel field group on my second site. I just created this new field group, "News and Video," and did not add the fields listed in the group. - they are just automatically showing up in the group. Those channel fields are fields from my primary site. enter image description here


Solution

  • Unfortunately I wasn't able to problem solve the exact issue on my computer, however (luckily!) we had a second copy running without errors on a computer. I ended copying all of those files onto my machine, then importing that database and all is working fine now.