ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Explanation of how 'weblog' is converted to 'channel' in upgrading from 1.x to 2.4?

February 02, 2012 11:09am

Subscribe [2]
  • #1 / Feb 02, 2012 11:09am

    Steve D

    11 posts

    First, is there anything that explains any differences between the two terms in the two versions?

    Second, it appears there is some mondo search/replace going on in the upgrade process and this seems to have snagged me.  I have some templates with ‘weblog’ in their names and embeds appear to have changed the template name from ‘weblog_body’ to ‘channel_body’ (for example) without changing the template name.

    I’m going to back out and start over but want to make sure I catch all instances where any search/replace may catch me.

    My main template group, for example, is ‘weblog’ - is that going to hose me?

    Thanks,

    Steve

  • #2 / Feb 02, 2012 1:33pm

    ewn

    100 posts

    In terms of weblog vs. channel, there is no difference.  It’s just a name change to reflect that EE “channels” aren’t just used for Blogs…

  • #3 / Feb 03, 2012 5:33pm

    Dan Decker

    7338 posts

    Hi Steve,

    I’m sorry the name change snagged you.

    Functionally, there is no difference between “weblog” and “channel”. Channel was simply the most non-descript, yet meaningful name we could come up with 😉

    You are correct, there is a massive find/replace that take place as part of the upgrade process. I’m afraid there is no guard against *where* it looks to make the changes.

    I am going to ask one of the developers to be sure.

    Hang tight.

    Cheers,

  • #4 / Feb 04, 2012 4:30pm

    Steve D

    11 posts

    Thanks, Dan.  I need to get all my templates saved as text files again, too, so I can search for all the permutations.

  • #5 / Feb 06, 2012 6:40pm

    Shane Eckert

    7174 posts

    Hello Steve D,

    I am glad that wen and Dan could get you sorted.

    Is there anything else we can help you with? Any more questions or concerns?

    Cheers,

  • #6 / Feb 07, 2012 7:33am

    Steve D

    11 posts

    Well, I don’t know that I’m ‘sorted’ yet.  I still don’t know what the logic is behind search/replace for ‘weblog’. 

    I just know how I’ll approach debugging once I know this.

  • #7 / Feb 09, 2012 5:23pm

    Dan Decker

    7338 posts

    Hi Steve,

    Robin got back to us with this:

    Yep- looks like user is squared away, but for the record, it’s getting caught in this:

    $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, 'weblog:weblog_name', 'channel:channel_name')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, 'exp:weblog', 'exp:channel')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, '{assign_variable:', '{preload_replace:')"; // this is necessary before the following query
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, '{preload_replace:my_weblog=', '{preload_replace:my_channel=')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, '{my_weblog}', '{my_channel}')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, '{weblog}', '{channel}')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, 'weblog_', 'channel_')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, '_weblog', '_channel')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, 'weblog=', 'channel=')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, '{blog_title}', '{channel_title}')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, '{blog_description}', '{channel_description}')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, '{blog_encoding}', '{channel_encoding}')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, '{blog_lang}', '{channel_lang}')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, '{blog_url}', '{channel_url}')";

    Now- it doesn’t change template names- which is good.  We don’t want to hose up their urls.  But within the templates, it’s a pretty massive change.  It really shouldn’t change embeds though.  Since it’s not changing the template names, that leads to a negative result.  And really shouldn’t change paths for the same reason.  These two are the replaces that might have those issues:

    $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, 'weblog_', 'channel_')";
      $Q[] = "UPDATE `exp_templates` SET `template_data` = REPLACE(`template_data`, '_weblog', '_channel')";

    So it seems there *is* the potential for a conflict. To be safe, I would go down the path you have chosen. Get your templates into files before the update, and do a find/replace for the affected tags and use something unrelated. After running the upgrade, you can get them back out as files and find/replace again for your unrelated word.

  • #8 / Feb 09, 2012 7:08pm

    Steve D

    11 posts

    Dan,

    Thanks!  I think this should help. 

    Steve

  • #9 / Feb 13, 2012 2:17pm

    Dan Decker

    7338 posts

    Alright Steve,

    I’m going to close this down for now. If you bump into trouble again, just let us know in a new thread.

    We are here to help!

    Cheers!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases