'Twas the night before a controlled release to stakeholders for some VoC and user testing,...
Last night I had a dangling storm cloud of uncertainty on a previously working module.
Previously, our products were categorized appropriately and effectively. We had a dynamic taxonomy/term/% view that was doing its job. Life was good.
Next, our client requested a blog. If there's any of our clients who is capable of tending a blog and keeping things up to date and relevant, it's her. So we said yes.
I installed the custom blog module that came with a responsive theme that we bought. Then it all went down hill.
I'll cut to the chase - the custom blog had a field named 'field_category' that was a taxonomy term reference so that we can tag our posts with some relevant terms. Unfortunately for me, I had named the product page term reference the same, 'field_category'. When I enabled the custom blog module, the install/enable script on the custom blog commandeered my product taxonomy into blog article taxonomy. After this, if I were to edit a product page, the category term reference would be broken, and if I saved any changes, it would be removed! Subsequently, some of my products quit appearing on their appropriate taxonomy views. Not good.
To recover, I restored a database backup to a dev server. I exported the 'field_data_category' to a .sql file.
Second, I created a new field, a term reference, in the product content type, linking it to the correct taxonomy vocabulary, and named it 'field_product_category'.
Third, I tweaked the .sql file to accommodate the new table name, then imported the old data to the new field.
Since some edits had been made to products, I sorted the Content menu by date modified, then filtered for product field. Anything modified after the blog had been installed simply needed to be opened, and re-saved. When opened, the term reference was populated correctly (since I did a direct database import), but did not yet register with the dynamic taxonomy list.