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.

Second unsuccessful attempt at updating from 1.X to 2.X

May 16, 2011 12:30pm

Subscribe [4]
  • #1 / May 16, 2011 12:30pm

    walpow

    133 posts

    Yesterday I underwent my second abortive attempt at installing EE 2.X. The first go-around was on April 3, started at EE 1.6.8, and is documented here. The install program appeared to run successfully, but the site was unreachable. Going to the URL gave an empty page (no HTML), and I couldn’t debug the thing because I couldn’t get into the control panel. I backed out the changes and restored my database. After that I upgraded to 1.7.0 and let things sit for a while.

    Yesterday’s fiasco ended in the following partway through the update:

    A Database Error Occurred
    Error Number: 1050
    Table ‘exp_snippets’ already exists
    CREATE TABLE `exp_snippets` ( `snippet_id` int(10) unsigned NOT NULL auto_increment, `site_id` int(4) NOT NULL, `snippet_name` varchar(75) NOT NULL, `snippet_contents` text NULL, PRIMARY KEY (`snippet_id`), KEY `site_id` (`site_id`) )
    Filename: updates/ud_200.php
    Line Number: 1382

    This didn’t seem like the kind of thing I’d get a quick answer on on a Sunday afternoon, so I again backed out the changes and got the database restored.

    Before trying again, I want to go through what I did and point out everywhere I was the slightest bit unsure about. A couple of possibly useful pieces of info: My system directory is named fssys (the name EngineHosting gave it). My existing template directory is /templates/ under the site root. The pertinent part of my .htaccess file is:

    RewriteEngine on
    RewriteCond $1 !^(content|fssys|images|templates|themes|favicon\.ico|index\.php|robots\.txt) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L]

    Here’s what I did:

    1. Took the site offline as directed in the instructions. I had some trouble with this because (I think) of the info in the .htaccess. I only point this out to alert you to possible trouble spots farther on.

    2. Renamed (rather than deleted) 1.X directories. Uploaded the new system directory and renamed it as fssys, to match my existing system directory name. Uploaded new themes directory. (The instructions make no mention of the images directory. Do I keep the old one?). Uploaded new index.php into the site root. Copied old config.php into new /fssys/expressionengine/config/.

    Next, the instructions say to open index.php and update system path to reflect renamed system folder. Given the info in my .htaccess, is this the index.php in the root or the one in the /fssys/ directory? And please give me the exact code to put into the appropriate file – I had some trouble with this specification prior to running the update.

    3. Saving templates as flat files: during the first go-around I started a thread about the lack of clarity in the instructions about this, but I’m still hazy. The instructions have you do this before uploading files, which makes no sense, since you’d be uploading to the 1.X files that you’d delete (in my case, rename) in the next step. So I did it after uploading files. My existing templates are in /templates/ under the site root, with the EE 1.X control panel setting matching this. I copied everything from /templates/ to /fssys/expressionengine/templates/default_site/. Is this correct?

    4. Set permissions as instructed.

    5. Started update and and ran into the 1050 error above.

    Before tracking that error down I want to make sure I’ve got everything else set up correctly. Specifically, given the name of my system directory, the info in my .htaccess, and the current location of my templates directory:

    1. Which index.php am I fooling with and exactly how do I change it?
    2. Am I putting my copy of the 1.X templates in the right place?
    3. Is there anything else I’m missing?

    Thanks,
    Nathan

  • #2 / May 17, 2011 2:44am

    John Henry Donovan

    12339 posts

    Hi Nathan,

    If you had previously restored your database, ensure it was restored into a completely empty database. Otherwise there will be duplicate data. Which would cause the error above.

    I couldn’t debug the thing because I couldn’t get into the control panel.

    You don’t need to go into your control panel to debug. Just turn on debugging in your root index.php

    $debug = 1;

    This is the same index.php you update your system folder path in

    $system_path = './fssys';

    I copied everything from /templates/ to /fssys/expressionengine/templates/default_site/. Is this correct?

    Yes correct. When the upgrade process is finished you can move that default_site folder into /templates in your root. You will need to update your template base path though. It is my hunch this was the only step you needed to complete for your first attempt.

  • #3 / May 17, 2011 12:46pm

    walpow

    133 posts

    If you had previously restored your database, ensure it was restored into a completely empty database. Otherwise there will be duplicate data. Which would cause the error above.

    I’m hosted at EngineHosting. You think they would restore my database in a way that would honk up my EE installation? Frankly, during this whole process, I’ve gotten better EE tips from them than I have from you guys.

    I couldn’t debug the thing because I couldn’t get into the control panel.

    You don’t need to go into your control panel to debug. Just turn on debugging in your root index.php
    $debug = 1;

    Good info, but not relevant. This applied to the first go-around, which was a month and a half ago. Also, by “I couldn’t debug [...] because I couldn’t get into the control panel,” I wasn’t referring to PHP debugging or anything like that. I was referring to the kind of let’s-dig-into-this debugging I’ve been doing for 39 years: the system’s not up, let’s see if I’ve got a control panel setting wrong, whoops, I can’t even get into the control panel.

    This is the same index.php you update your system folder path in
    $system_path = ‘./fssys’;

    Just to be absolutely clear: you’re saying update the $system_path as shown in the index.php in the root, and keep clear of the one in the fssys (system) directory. And that this info is consistent with the info from my .htaccess file.

    I copied everything from /templates/ to /fssys/expressionengine/templates/default_site/. Is this correct?

    Yes correct. When the upgrade process is finished you can move that default_site folder into /templates in your root. You will need to update your template base path though.

    Is this in the instructions anywhere? Where will I be updating my template base path? How come the update doesn’t pick it up from my current settings?

    It is my hunch this was the only step you needed to complete for your first attempt.

    Seriously? No access to the control panel because my templates weren’t in the right place?

    Thanks again,
    Nathan

  • #4 / May 18, 2011 11:29am

    Kevin Smith

    4784 posts

    If you had previously restored your database, ensure it was restored into a completely empty database. Otherwise there will be duplicate data. Which would cause the error above.

    I’m hosted at EngineHosting. You think they would restore my database in a way that would honk up my EE installation? Frankly, during this whole process, I’ve gotten better EE tips from them than I have from you guys.

    Hi Nathan—

    I’m sorry about the frustration here. I know nothing gets more aggravating than several botched upgrades that don’t seem to have a clear cause. Let’s try to get you taken care of quickly.

    I couldn’t debug the thing because I couldn’t get into the control panel.

    You don’t need to go into your control panel to debug. Just turn on debugging in your root index.php
    $debug = 1;

    Good info, but not relevant. This applied to the first go-around, which was a month and a half ago. Also, by “I couldn’t debug [...] because I couldn’t get into the control panel,” I wasn’t referring to PHP debugging or anything like that. I was referring to the kind of let’s-dig-into-this debugging I’ve been doing for 39 years: the system’s not up, let’s see if I’ve got a control panel setting wrong, whoops, I can’t even get into the control panel.

    I see what you mean here. While you can definitely get more hands-on style troubleshooting done in the CP, you can still hard-code config variables into your config.php file. Any settings in the config.php file override those settings’ values in the database. This way, even if you don’t have CP access, you can still double-check your paths and such by hard-coding them into the config.php file. Here is the list of config variables in EE2 that can be overridden in the config.php file. It’s always included in your config.php file in the format:

    $config['variable_name'] = 'variable_value';

    This is the same index.php you update your system folder path in
    $system_path = ‘./fssys’;

    Just to be absolutely clear: you’re saying update the $system_path as shown in the index.php in the root, and keep clear of the one in the fssys (system) directory. And that this info is consistent with the info from my .htaccess file.

    Correct. The index.php located in your web root is the one that you’re updating here.

    Think of it this way: when a visitor arrives at your site’s main domain (i.e. http://www.example.com), the file served up by your web server is the index.php that’s located in your web root. That file is where everything begins with EE when it’s serving up everything except the CP.

    In short, all requests for the front-end of the website go through ./index.php

    When you visit http://www.example.com/system, your web server serves up the index.php file that’s located in your system folder. That’s where every request starts when EE is serving you anything in the CP.

    In short, all requests for the Control Panel go through ./system/index.php

    Does that make sense?

    In order to serve up the front-end of your site, EE needs to retrieve your settings and every other bit of goodness that your system folder has to offer. It can’t do that unless it knows where the system folder is. Since renaming the system folder is a good idea for security’s sake, we expect most people will need to update that setting in their ./index.php file, thus the recommendation in step 2 of the updating documentation. You’re right though, that is too ambiguous. I filed a bug report for you in order to get this straightened out.

    I copied everything from /templates/ to /fssys/expressionengine/templates/default_site/. Is this correct?

    Yes correct. When the upgrade process is finished you can move that default_site folder into /templates in your root. You will need to update your template base path though.

    Is this in the instructions anywhere? Where will I be updating my template base path? How come the update doesn’t pick it up from my current settings?

    I think John was assuming that you wanted your templates located in /templates/ again after the upgrade was complete. If that’s the case, then you’ll want to just move the files back to /templates/ after the upgrade and then update your settings (either in the CP or in config.php) to reflect the new template base path. Like so, in config.php (double-check the path):

    $config['tmpl_file_basepath'] = "/fssys/templates/";

    However, the default template file basepath in EE2 is /fssys/expressionengine/templates/
    If it’s no difference to you, I would recommend just leaving that setting as is.

    Now, with all that said, you’ve had a lot of trouble here. I want to get you taken care of as quickly as possible. Be on the lookout for an email from me, and post back here with a status report on where you’re at now.

    Kevin

  • #5 / May 18, 2011 11:54am

    walpow

    133 posts

    Thanks, Kevin. This is the kind of stuff I need. I’ve done as requested in the e-mail.

    Nathan

  • #6 / May 18, 2011 4:22pm

    Kevin Smith

    4784 posts

    Nathan—

    As I began looking through your system for upgrade snags, I noticed a big potential obstacle to upgrading for you. You have the Photo Gallery module enabled, and it looks like the site is using it to manage a photo gallery. As of right now, there’s no direct upgrade path for the EE1.x Photo Gallery since EE2 doesn’t include the photo gallery. That’s not to say this is a dead-end for you, though. We’re actually making major strides right now with the new File Manager so that we can provide a direct upgrade path for folks who used the Photo Gallery module in EE1.x. If the Photo Gallery is integral to your site, I would suggest holding off on the upgrade until we get the Photo Gallery upgrade path in place.

    I also noticed you’re using the third-party module Template Files, which seems to emulate a feature that is now part of EE2’s core: automated syncing of template files. This module would need to be disabled (and likely removed) before upgrading to EE2. Since you’ve been using this module and are more familiar with it, is removing the module something that would break your system as it is now?

    Also, be sure to check through the rest of your modules, plugins, and extensions to see if there’s an EE2-compatible version (or if you’ll even need that particular add-on in EE2).

    Once I hear back from you, we’ll go from there.

    Kevin

  • #7 / May 18, 2011 5:27pm

    walpow

    133 posts

    A week or so before the first update attempt I took the gallery out. The pages are still there, but they’re not linked to anywhere. No one has noticed. I decided I’d rather get the update done and deal with the gallery later, if necessary. The site’s going to change pretty drastically, and getting to 2.X holds priority over everything else.

    I’m pretty sure I just used Template Files to dump all the templates to files when I first decided to edit them offline. I don’t use it in anything I do, and from looking at the module it looks like it’s something that only works when you explicitly tell it to.

    Regarding extensions, I’ve made notes on what I need and what needs to be updated and the like. Mostly I have to upgrade Widon’t, and it appears Smarty Pants isn’t 2.X-ready, but that just pretties stuff up a little. Worst that will happen is that a few things will look a bit funky for a bit, or that there’ll be a couple of uninterpretable tags. (Traffic is low enough, and updating priority high enough, that I’m willing to live with that for a couple of days while I track everything down.)

    So I think I’m set to go. More soon ...

  • #8 / May 19, 2011 6:34am

    John Henry Donovan

    12339 posts

    Glad you are nearly there Nathan. Apologies that I wasn’t more thorough with my original reply to you.

    Regarding Smarty Pants, Stephen has and add-on available here that may help.

  • #9 / May 19, 2011 10:49am

    walpow

    133 posts

    Regarding Smarty Pants, Stephen has and add-on available here that may help.

    Very cool. That should take care of the last extension issue.

    Thanks,
    Nathan

  • #10 / May 19, 2011 11:21am

    Kevin Smith

    4784 posts

    Hey Nathan—

    The upgrade is complete, and the Control Panel is in working order. Simple templates are working just fine.

    NOW… Most of the rest of the front-end is throwing blank pages right now, and that’s because the templates themselves need to be updated to work with EE2 instead of EE1. Most of the the reason is because your templates are using plugins that were part of EE1 that aren’t loaded into your EE2. Go ahead and make sure your add-on situation is comparable in EE2 as it was in EE1.

    To help with this transition, I’ve enabled the output profiler and template debugger in Output and Debugging Preferences, and only Super Admins can see those. You’ll also want to change $debug to ‘1’ in ./index.php (the one in your web root) in order to show yourself all possible errors on screen. (It’s much better for debugging than just the white screen!) The errors shown thanks to this setting will be seen by everyone, though, so turn this off if you’re going to be away from your site for a bit.

    So now, you’ll want to take a run through your templates to clean them up and transition them to EE2. The updater automatically changed your weblog:entries tags to channel:entries tags, and those debugging steps above will help you transition, but not every possible template tag can be handled by the updater, so you’ll just need to go through them manually. You may want to keep the user guide for 2.0 handy:

    http://ellislab.com/expressionengine/user-guide/overview/templates.html

    I’ll keep my eye on this thread in case you hit any snags. Keep me posted on your progress!

    Kevin

  • #11 / May 19, 2011 11:33am

    walpow

    133 posts

    I’m on it ...

  • #12 / May 19, 2011 12:55pm

    walpow

    133 posts

    The blanks that are being thrown show this when debug is turned on:

    Fatal error: Channel::parse_related_entries() [function.Channel-parse-related-entries]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "DB_Cache" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /www/eh7815/public_html/fssys/expressionengine/modules/channel/mod.channel.php on line 447

    I’ve narrowed it down to (for example) this block of code:

    {exp:channel:entries channel="the-weblog" limit="8" disable="categories|member_data|pagination|trackbacks"}
          <li><a href="http://{title_permalink=">{title}</a> <span class="t-small no-break">by {related_entries id="weblog-writer"}{title}{/related_entries}</span></li>
          {/exp:channel:entries}

    If I take out the {related_entries} bit, the page displays.

    I’ve been fooling with this with the index-test template in the general group.

    Meanwhile, I’m also finding that pages that displayed fine in 1.X look a bit funky in 2.X. (For instance, /sundry/login/.) So while you guys are looking at the related entries problem, I’ll work on the funkiness.

  • #13 / May 19, 2011 2:39pm

    walpow

    133 posts

    I found out the source of the layout funkiness. During the update a bunch of stuff was stripped from the templates I embed into every page - stuff that the layout depends on. Hmmmm ...

  • #14 / May 19, 2011 3:00pm

    walpow

    133 posts

    So everything is working fine now ... except anything having to do with related entries, which will blow up without fail. I’ve got related entries all over the place. Help!

  • #15 / May 19, 2011 3:22pm

    Kevin Smith

    4784 posts

    Hey Nathan—

    Just got back from lunch and taking a look now!

    Kevin

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

ExpressionEngine News!

#eecms, #events, #releases