Typo Upgrade from Hell

Well OK maybe it wasn't quite THAT bad, but it was certainly difficult enough that the Ruby novice would have really had trouble. I upgraded from Typo 4.1 to 5.3 on DreamHost. It turned out to be quite a hassle. There were several obstacles. Before upgrading I read over the Typo upgrade checklist. It was pretty straightforward other than I interpreted removing my sidebar items to mean just reprogramming them. Apparently you should remove (at least some of them) from the database altogether. First challenge was getting migrations working. Dreamhost kept killing my migration in progress due to the high memory usage. So I ended up doing a mysql dump:
mysqldump -u USER -p PASS -h HOST > clog.mysql
I copied that over to my macbook where I loaded the typo gem, created a skeleton blog app and loaded the db for the migrations. Still no luck, I could not get typo to load at all on my mac. I kept getting this error:
[BUG] cross-thread violation of rb_gc()
ruby 1.8.6 (2008-08-11) [universal-darwin9.0]
I have ruby 1.8.7 installed via ports so this was definitely incorrectly linking to the original ruby install on my mac. Even after renaming ruby binaries, libs and reinstalling all gems I still had this problem. Others had luck with this but not me.. I decided the path of least resistance would be to use Ubuntu. So I copied my dump file over to my Ubuntu machine, did the migration (it worked - YAY!), made a new dump (clognew.mysql) and uploaded back to my Dreamhost account. There I loaded it directly into the database and restarted Typo. It worked! Well... almost... My sidebars wouldn't work, I would get the following error and could not find a way to fix it: It seems something went wrong. Maybe some of your sidebars are actually missing and you should either reinstall them or remove them manually So I started a Rails console:
script/console production
And tried to pull all sidebar models:
>> Sidebar.all
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'AimpresenceSidebar'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Sidebar.inheritance_column to use another column for that information.
So my problem is that this Aimpresence model no longer exists. To fix the problem I actually created it in the console
>> class AimpresenceSidebar < Sidebar
>> end
=> nil
And finally I found the model to delete (querying by name would probably be better, but for me just pulling the 'fourth' worked) NOTE that your Sidebar probably will be in a different position
Sidebar.find(:all, :order => 'active_position ASC', :limit => 4).last.destroy
Now finally querying for all sidebars works and the production error is gone.. hopefully this will help others that find themselves in this situation

Posted by chrisp Tue, 01 Sep 2009 16:00:00 GMT