0

I want to convert my site's database from MySQL to SQLite. So i got the DBTNG-Migrator and tried using it. I changed the settings.php files as follows -

$databases = array (
  'default' => 
  array (
    'default' => 
    array (
      'driver' => 'mysql',
      'database' => 'db_name',
      'username' => 'root',
      'password' => 'password',
      'host' => 'localhost',
      'port' => '',
      'prefix' => '',
    ),
  ),
  'dest' => array (
        'default' =>
          array (
            'database' => 'drupal/sqlite_db/.ht.sqlite',
              'driver' => 'sqlite',
              'prefix' =>'',
            ),
        ),
);

I had changed the permissions of the folder sqlite_db so that it is writable by others. Then i go to the configuration page of DBTNG and go to Migrator database check. There i choose the destination as sqlite and mysql as origin. When i hit check i get a lot of warnings and this error-

PDOException: SQLSTATE[HY000]: General error: 1 no such table: accesslog:     
INSERT INTO {accesslog} (title, path, url, hostname, uid, sid, timer, timestamp) 
VALUES (?, ?, ?, ?, ?, ?, ?, ?); Array ( [0] => Migrator [1] =>               
admin/structure/dbtng/migrator/check [2] => http://localhost/drupal/admin    
/structure/dbtng/migrator/check [3] => 127.0.0.1 [4] => 1 [5] =>              
Rz1A861RV5SIJ4jGM_CqnriF-L6nhUObQ5ILcNV4iMo [6] => 900 [7] => 1352377186 )     
in statistics_exit() (line 93 of /var/www/drupal/modules/statistics          
/statistics.module).

If i change the destination to sites/default/files/.ht.sqlite there is a different error -

block does not existing in dest
PDOException: SQLSTATE[HY000]: General error: 1 no such table: block: SELECT     
b.* FROM {block} b WHERE (b.theme = :db_condition_placeholder_0) AND          
(b.status = :db_condition_placeholder_1) ORDER BY b.region ASC, b.weight       
ASC, b.module ASC; Array ( [:db_condition_placeholder_0] => gtt               
[:db_condition_placeholder_1] => 1 ) in _block_load_blocks() (line 727 of       
/var/www/drupal/modules/block/block.module).

Both the tables accesslog and block are present in the database. Do i need to manually create all the tables here? I have 184 tables in the db. How can i solve these issues.

  • I hope this is not your production database you're converting? I've known of people who've caused big problems by thinking "oh yeah, no problem, SQLite can handle the load I'm gonna get with this site". – iconoclast Nov 8 '12 at 17:10
  • no im tryin it on localhost first but with no success as of now – Dan Nov 12 '12 at 9:32
  • but you're planning on doing it in production if you get it working on localhost? I don't think that's likely to work out. Of course your case may be different, but it's not generally advised to use SQLite in production, and I personally know of a case where it was done with bad results. Please think hard before you do it. – iconoclast Nov 12 '12 at 17:10
  • yes i am planning to do it in production as well. The site is a small one. The main reason of shifting to SQLite is that mysql db is of 15 MB and i think its getting too big now which is also slowing down the performance of the site. – Dan Nov 13 '12 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.