Upgrading to Typo 5.3 (on Dreamhost) 2
Upgrading from Typo 4.0.3 to Typo 5.3 on Dreamhost Rail
I’ve been slacking lately on my blogging, which is a shame because I have much to write about. So much going on, no time to write about it. To help rectify that, I intend to start devoting Tuesday evenings to technology blogging, and to start things off, let’s upgrade this dumpy old Typo 4.0.3 to shiny new Typo 5.3.
I’m on Dreamhost, and they suck, but not bad enough for me to pick up and go elsewhere, so I guess that actually counts as good service. So here are one set of correct steps to upgrade a Typo 4.X installation to Typo 5.3. These are based on the Upgrading to Typo5.3 instructions, but differ at a few points for Dreamhost specifics, and to accomodate my own mistakes.
- login to the Typo web interface and uninstall all your sidebars (see note below)
- use mysqldump to dump the mysql database
mysqldump -u typo -p -h mysql.typo.pburkholder.com typo > ~/backup/typo.mysql
- use tar to copy the typo installation
tar -czf backup/typo.4.0.3.tgz ./typo.pburkholder.com/
- install the ‘typo’ gem. I’ve been using ~/.rubygems as my local gem install, so
export GEM_PATH=/usr/lib/ruby/gems:/home/pburkholder/.rubygems
gem install -i ~/.rubygems typo
- now do the install:
~/.rubygems/bin/typo install ~/typo.pburkholder.com
- move some of my old files over (the upgrade instructions suggest copying over old themes, don’t)
mkdir ~/typo.pburkholder.com/public/files/
cp typo4.pburkholder.com/public/files/* typo.pburkholder.com/public/files/
cp typo4.pburkholder.com/config/database.yml typo.pburkholder.com/config/database.yml
- run the database migration
cd ~/typo.pburkholder.com
rake RAILS_ENV=production db:migrate
rake gems:refresh_specs
(The last step may not be necessary, but worked for me)
- your old theme won’t work. Period. Simplest solution I came up with was to symlink a 5.3 theme to my old theme name. E.g., I had ‘azure’ as my theme, and ‘scribbish’ came with 5.3, so:
cd ~/typo.pburkholder.com/themes; ln -s scribbish azure
- start a single instance on port 3000 and see how things are on http://typo.pburkholder.com:3000
script/server -e production (Ctrl-C to kill)
- set up Passenger. I had been running the blog using FastCGI back before Dreamhost had any real Rails support. Now they support Passenger, which is promising. I had been running Typo using FastCGI suppor and an .htaccess file that
called dispatcher.fcgi, and it was a dog. So..
- Go to the Dreamhost panel and enable passenger support
- Disable FastCGI
- Go have fun!!
What if I skipped step 1?
I misread the upgrade instructions, and moved the sidebar code instead of ‘removing’ them from the web UI. My new Typo instance complained bitterly about missing sidebars. To remove the sidebars manually is just a matter of connecting the production MySQL database and seeing what’s in the sidebars, then removing them:
select * from sidebars\G
delete from sidebars where id>1;
Now I need to replace my old sidebar links, such as:
Comments
-
Typo 5.3 by default really screws up Textile markup, which is a huge bummer, but can't fix that tonight. Be warned!
-
Turns out that the Textile issue is fixed in Admin, under user preferences. Choose the simple editor instead of the rich text editor.