Friday, February 18, 2011

Mobile Joomla and TERAWURFL database

 Mobile Joomla! is a great extension for making your Joomla site ready for mobile viewing but it adds in a 40M worth of tables into Joomla database. This potentially causes difficulty in database backup and recovery. So here are the steps to put all the terawurfl tables in a separate database. 

1) Go into phpmyadmin and copy you Joomla database as terawurfl.

2) Go into information_schema database and run the query

select concat("drop table ",table_name,";") from tables where substr(table_name,1,4) = 'jos_' and
substr(table_name,1,13) != 'Jos_terawurfl';

Note: I am assuming you are running Joomla database with prefix 'jos_', if not then change the above accordingly

3) Copy all the drop statements into clipboard.

4) Go into terawurl database and run SQL with statements copied from the clipboard. At this stage you have a database with just the terawurfl tables.

5) Now go back to information_schema database and run the query

select concat("drop table ",table_name,";") from tables where substr(table_name,1,13) = 'Jos_terawurfl';

6) Copy the drop statements to clipboard.

7) Now go to your Joomla database and run the SQL with statements copied from the clipboard. At this stage you have a database with just the joomla tables.

The above process would have taken out the terawurfl tables and put them in a separate database.

Now go and set database name, user and pass in plugins/mobile/terawurfl.php, They are currently picked up from the configuration.php You probably will just have to change the line to set schema to terarwurfl as the user and password would still be valid as we follow the above procedure.

TeraWurflConfig::DB_SCHEMA = "terawurfl";

Now you can backup your dynamically changing Joomla database more frequently without having the overhead of copying terawurfl tables as well. Also the database recovery time for Joomla tables will be lower too.

No comments:

Post a Comment