Mroonga blog

2012-01-29

Mroonga 1.20 has been released

Mroonga 1.20 has been released!

How to install:: Install

CAUTION!

This release requires database dump and restore for upgrading. Here are upgrade sequence.

In this release, mroonga has two changes that requires database recreation:

  1. Storage engine name is changed to "mroonga" from "groonga".
  2. Groonga's native time data value are used for DATE, DATETIME and TIMESTAMP type values.

We need to modify dumped database to change "ENGINE=groonga" in "CREATE TABLE" SQL. Here are upgrade sequence.

We dump a database that uses mroonga:

% mysqldump MY_MROONGA_DATABASE > database-groonga.dump

We convert storage engine in dump file:

% sed -e 's/^) ENGINE=groonga/) ENGINE=mroonga/' database-groonga.dump > database-mroonga.dump

We confirm that ENGINE=groonga only in CREATE TABLE is replaced with ENGINE=mroonga. We need to check @ ... @ line includes CREATE TABLE. If the line includes CREATE TABLE, the hunk will be a change for CREATE TABLE:

% diff -up database-groonga.dump database-mroonga.dump
--- database-groonga.dump     2012-01-29 16:53:20.732624670 +0900
+++ database-mroonga.dump     2012-01-29 16:54:47.608420981 +0900
@@ -29,7 +29,7 @@ CREATE TABLE `diaries` (
   PRIMARY KEY (`id`),
   FULLTEXT KEY `title_index` (`title`),
   FULLTEXT KEY `body_index` (`body`)
-) ENGINE=groonga DEFAULT CHARSET=utf8;
+) ENGINE=mroonga DEFAULT CHARSET=utf8;
 /*!40101 SET character_set_client = @saved_cs_client */;

 --

We drop the existing database:

% mysql -u root -e 'DROP DATABASE MY_MROONGA_DATABASE'

We upgrade to "mroonga" storage engine. We will use apt-get on Debian GNU/Linux or Ubuntu and yum on CentOS or Fedora.

apt-get:

% sudo apt-get install -y mysql-server-mroonga

yum:

% sudo yum remove -y mysql-mroonga
% sudo yum install -y mysql-mroonga

CAUTION!: We don't forget to run yum remove before yum install. If we forget to run yum remove, we will break a MySQL's system table.

We recreate a database:

% mysql -u root -e 'CREATE DATABASE MY_MROONGA_DATABASE'

We restore a database by modified dump file:

% mysql -u root MY_MROONGA_DATABASE < database-mroonga.dump

Now, we can use mroonga 1.20.

Changes

Changes since 1.11: Release 1.20 - 2012/01/29