Convert InnoDB > MyISAM and Back Again...

Posted by John
on Friday, 28 December 2007

Convert Typo InnoDB > MyISAM

Simple script to convert your Typo database tables from InnoDB to MyISAM format.

use mytypo_production;
ALTER TABLE articles_tags ENGINE = MyISAM;
ALTER TABLE blacklist_patterns ENGINE = MyISAM;
ALTER TABLE blogs ENGINE = MyISAM;
ALTER TABLE categories ENGINE = MyISAM;
ALTER TABLE categorizations ENGINE = MyISAM;
ALTER TABLE contents ENGINE = MyISAM;
ALTER TABLE feedback ENGINE = MyISAM;
ALTER TABLE notifications ENGINE = MyISAM;
ALTER TABLE page_caches ENGINE = MyISAM;
ALTER TABLE pings ENGINE = MyISAM;
ALTER TABLE redirects ENGINE = MyISAM;
ALTER TABLE resources ENGINE = MyISAM;
ALTER TABLE schema_info ENGINE = MyISAM;
ALTER TABLE sessions ENGINE = MyISAM;
ALTER TABLE sidebars ENGINE = MyISAM;
ALTER TABLE sitealizer ENGINE = MyISAM;
ALTER TABLE tags ENGINE = MyISAM;
ALTER TABLE text_filters ENGINE = MyISAM;
ALTER TABLE triggers ENGINE = MyISAM;
ALTER TABLE users ENGINE = MyISAM;

Now What?

Change mytypo_production to your Typo database's name.

Save it as convert.sql

Run it via,

mysql -u root
source convert.sql

You will get a load of check messages and hopefully no errors or warnings. If all goes ok you should now be over to MyISAM.

Convert Typo MyISAM > InnoDB

use mytypo_production;
ALTER TABLE articles_tags ENGINE = INNODB;
ALTER TABLE blacklist_patterns ENGINE = INNODB;
ALTER TABLE blogs ENGINE = INNODB;
ALTER TABLE categories ENGINE = INNODB;
ALTER TABLE categorizations ENGINE = INNODB;
ALTER TABLE contents ENGINE = INNODB;
ALTER TABLE feedback ENGINE = INNODB;
ALTER TABLE notifications ENGINE = INNODB;
ALTER TABLE page_caches ENGINE = INNODB;
ALTER TABLE pings ENGINE = INNODB;
ALTER TABLE redirects ENGINE = INNODB;
ALTER TABLE resources ENGINE = INNODB;
ALTER TABLE schema_info ENGINE = INNODB;
ALTER TABLE sessions ENGINE = INNODB;
ALTER TABLE sidebars ENGINE = INNODB;
ALTER TABLE sitealizer ENGINE = INNODB;
ALTER TABLE tags ENGINE = INNODB;
ALTER TABLE text_filters ENGINE = INNODB;
ALTER TABLE triggers ENGINE = INNODB;
ALTER TABLE users ENGINE = INNODB;

Also...

Also make sure you Tune your MySQL Install...

And optimize the Tables,

Optimize Typo Tables

Posted by John
on Thursday, 27 December 2007

Quick article on Optimizing your Typo MySQL database, does take a bit and only works on MyISAM and BDB Tables.

mysql -u root
use mytypo_db;
show tables;

Now the beef;

optimize table articles_tags, blacklist_patterns, blogs, categories, categorizations, contents, feedback, notifications, page_caches, pings, redirects, resources, schema_info, sessions, sidebars, sitealizer, tags, text_filters, triggers, users;

Does take a while but should clean up your Typo 4.1.1 Database Tables.

Typo Tuning

Posted by John
on Friday, 09 November 2007

A note on permissions from the Typo README:

"Typo needs write access to several directories in order to function correctly. These need to be writable by the user that runs the Typo process--in a hosted environment this may be your user; on dedicated systems it may be something like 'httpd' or 'www-data'.

The specific directories in question are 'log/' (and everything underneath it), 'cache/', and 'public/'. Strictly speaking, Rails will continue to work if public isn't writable, but Typo's page caching code will work properly and this will cause Typo to be slower and use much more CPU time. For the security conscious, Rails really only needs the ability to change a half-dozen files and subdirectories under public/, ask on the Typo mailing list for more details.

aka...

cd /mytypoinstall
mkdir cache
chmod -R a+rw cache
chmod -R a+rw public
chmod -R a+rw log

Done.

Converting to Rails

Posted by John
on Sunday, 22 July 2007

...just to let you know, i've finally taken the plunge and am in the process of switching over my blog RED91.com to the Ruby-on-Rails platform so sorry if things appear sparse for a while.

...UPDATE pretty much got it all together again, still a lot to do but now i can officially say my blog RED91.COM is now a fully coherent Ruby On Rails application, using SVN to keep things in sync and sitting on a powerful 64-bit box. ...ROCKIN!

Sincerely,

John.