Prep for moving 1.9.x Moodle to 2+ PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Ken Task   
Sunday, 05 June 2011 09:59
AddThis Social Bookmark Button

One of the items in the 'pre-conversion' check list is related to database.
Please see:
http://docs.moodle.org/en/CLI#MySQL_storage_engine_conversion

Before doing that however, one needs to know IF the DB's are currently using MyISAM.

Please see:
http://www.mysqlfaqs.net/mysql-faqs/Table-Types-or-Storage-Engines/How-to-get-storage-engines-available-on-MySQL-server

NOTE: there are other links at the bottom of the above page that need to be explored:
What is default table type of MySQL?
How-to-change-the-default-storage-engine-of-MySQL How to change the default storage engine of MySQL?
How to convert a table from one type to another in MySQL?

Here's a script (CentOS flavored) that will show versions of Apache, PHP, and MySQL (MySQL settings as well):

echo '------ VERSIONS CHECK -----';
echo '------ APACHE -----';
/usr/sbin/apachectl -version;
echo '------ PHP ------';
php -v;
echo '------ MySQL -----';
mysql -e 'status;' -u root -p[yourpassword];
echo '------ MySQL Engines ------';
mysql -e 'show engines;' -u root -p[yourpassword];
echo '------------ end versions check -----------';


Here's example of output:

[root@site]# serverversions
------ VERSIONS CHECK -----
------ APACHE -----
Server version: Apache/2.2.8 (Unix)
Server built:   Sep 15 2008 20:14:32
------ PHP ------
PHP 5.2.10 (cli) (built: Nov 13 2009 11:44:05)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
------ MySQL -----
--------------
mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1

Connection id:        142770
Current database:   
Current user:        root@localhost
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:    ;
Server version:        5.0.77 Source distribution
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
UNIX socket:        /var/lib/mysql/mysql.sock
Uptime:            40 days 13 hours 54 min 58 sec

Threads: 2  Questions: 5087703  Slow queries: 0  Opens: 681159  Flush tables: 1  Open tables: 64  Queries per second avg: 1.451
--------------

------ MySQL Engines ------

+------------+---------+----------------------------------------------------------------+
| Engine     | Support | Comment                                                        |
+------------+---------+----------------------------------------------------------------+
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         | 
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      | 
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     | 
| BerkeleyDB | YES     | Supports transactions and page-level locking                   | 
| BLACKHOLE  | NO      | /dev/null storage engine (anything you write to it disappears) | 
| EXAMPLE    | NO      | Example storage engine                                         | 
| ARCHIVE    | NO      | Archive storage engine                                         | 
| CSV        | NO      | CSV storage engine                                             | 
| ndbcluster | NO      | Clustered, fault-tolerant, memory-based tables                 | 
| FEDERATED  | NO      | Federated MySQL storage engine                                 | 
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                          | 
| ISAM       | NO      | Obsolete storage engine                                        | 
+------------+---------+----------------------------------------------------------------+
------------ end versions check -----------


One can acquire: http://sos.tcea.org/serverversions.tar

Save the above .tar file in /usr/local/bin/

cd /usr/local/bin/
wget http://sos.tcea.org/serverversions.tar

Un-tar it.

tar xvf serverversions.tar

Edit the script to replace [yourpassword] with 'your password'.

nano serverversions [ENTER]

Change permissions to make it executable by root user:

chmod u+x serverversions [ENTER]


To run it as root: serverversions [ENTER]
or one could make a Webmin Custom Commands button to run the script.

 
 
Total Views: 412