How to exorcize SEBLOD from Joomla

It turns out that the SEBLOD Content Construction Kit (CCK)  for Joomla is either completely overwhelming for your Joomla App or is so full of unexpected side effects and instabilities that it is impossble to run a reliable application with it. Critisisms against are that breaks the cardinal rule of altering the meaning of  your Joomla framework-managed data by inserting its own undocumented tags, and messes with your normal content editing functions and Joomla's standard Read-more behaviour. Because of this undeclared tight functional coupling between SEBLOD and Joomla, you can now only upgrade your Joomla installation if there is a SEBLOD version that supports it. If you don't keep in lock-step when you upgrade Joomla, things break. I have felt this pain! And can you remove it again like a well-behaved Joomla component should allow you to? No. 


SEBLOD should come with a health warning. So, if you have inadvertently installed SEBLOD on your Joomla installation, here is how to remove it:


Step 1: Call a priest.  SEBLOD is evil. It must be banished back to the Netherworld and your server must be sprinkled with Holy Water. Prepare to perform some incantations in BASH and SQL on a terminal. 

Step 2: Uninstall the SEBLOD component from the Joomla's Package Manager

Step 3: Fix the broken data. The biggest problem is the annoying tags that get inserted in normal Joomla article content (no, really!), like these:

::cck::[:digit:]::/cck::,  ::/?introtext::, ::/?fulltext::, ::/?description::

Run these holy incantations in a terminal that has access to your MySQL database, and replace the database and the table prefix where appropriate:

mysqldump $DATABASE -t josprefix_content | sed \
 -e 's|::cck::[0-9]*::/cck::||g' \
 -e 's|::/?introtext::||g' \
 -e 's|::/?fulltext::||g' \
 -e 's|::/?description::||g' \> content_cleaned.sql
mysqldump $DATABASE josprefix_content > content_backup.sql
mysql $DATABASE -e 'delete from josprefix_content'
mysql $DATABASE < content_cleaned.sql

You can leave the other content records that SEBLOD created for its lists intouched.

Step 4: You probably already have a replacement solution for SEBLOD and have migrated the content the contents from the #__cck_form... tables. If you used the attachments feature in SEBLOD, then here is a starting point that lists your attachements alongside your record Id (all one command): 

mysql $database -B -e "
  from josprefix_content c
 inner join josprefix_cck_store_form_XXXX i
    on =
 where case locate('::XXX_diagrams::', c.introtext)
       when 0 then 0
       else replace(substr(c.introtext,locate('::XXX_diagrams::', introtext)+length('::XXX_diagrams::'),2),':','')
       end > 0
       case locate('::XXX_documents::', c.introtext)
       when 0 then 0
       else replace(substr(c.introtext,locate('::XXX_documents::', introtext)+length('::XXX_documents::'),2),':','')
       end > 0
" | sed \
 -e 's/XXX_diagrams:://g' \
 -e 's/XXX_documents:://g' \
 -e 's|::/*XXX_diagram||g' \
 -e 's|::/*XXX_document||g' \
 -e 's/cck:://g' \
 -e 's|::[0-9]*::/||g' \
 -e 's/|[0-9]|//g' \
 -e 's| | |g' \
 -e 's/\t/ /g' \
 -e 's/ / /g' \
 -e 's/ / /g' \
 -e 's/ images/, images/g' > attachments.csv

- which outputs:

1, images/seblod/file1, images/seblod/file2
5, images/seblod/file3, images/seblod/file4, images/seblod/file5

Use this CSV output in Excel to create SQL insert statements and file-move commands  for your new target environment, whatever you have chosen it to be.


Step 5: Clean up your categories

SEBLOD in its wisdom decides to despoil your article-content category descriptions too, regardless of wether they have anything to do with your CCK data or not. If you do not have too many categories for articles, you can manually go through them and remove offending strings like this: 

::cck::56::/cck::<br />::description::::/description::

Aye, caramba! Why, oh why?


Step 6: Pay the priest, or risk getting reposessed!


No more SEBLOD on your system! Stuff will now work again and your content data is now unadulturated.