By FrenchHope on
With Drupal 7 it seems easy to choose and install Drupal on an SQLite database, but what about an existing Drupal website ?
After a Drupal 6 to Drupal 7 upgrade, will I be able to convert a Drupal MySQL database to a Drupal SQLite database ?
Thanks.
Comments
A few steps
Hi,
there might be a more efficient solution, but here is what I would do:
- upgrade from DP6 to DP7
- convert the mySQL database to SQLite (there are many ways to do that: google "mysql sqlite migration" for example)
- change the $databases array in settings.php to redirect it from mySQL to SQLite
Let me know the result if you ever try it :c)
I tried. No good luck to
I tried. No good luck to migrate.
Used several scripts to convert MySQL to SQLite, output many errors, finally there's only 31 tables exist in SQLite, while there are 88 in MySQL.
Lost many tables!
I found there's a project:
http://drupal.org/project/dbtng_migrator
But it still in developing.
I'll try it later.
A script to convert Drupal 7 MySQL to SQLite
No good luck for me to use dbtng_migrator, and I can't find any detailed documentation, maybe it's still in developing.
But I find this project is great:
https://gist.github.com/943776
But the original version(while writing this post) still need a bit adjusting to fit our situation, below is the one that works for Drupal 7.
In my case: Drupal 7.7, MySQL 5.0, SQLite 3.7
This script works fine for me(Based on https://gist.github.com/943776):
http://525183.serverbox.org/drupal7/mysql2sqlite.sh
After converting, adjust site setting.php file properly. Clean all caches, and refresh site page several times, it will all works fine.
The script does not do much for me...
Hi I did the following.
1) Export the MySql database from my host
2) Imported locally in my machine
3) Run the script ./mysql2sqlite.sh --no-data -u user -p password databasename | sqlite3 database.sqlite
4) I get only a message 'memory' and the script does basically nothing...
any suggestions?
(I am running linux mint 10 if can help, but I tried on windows with Cygwin)
Thanks
Subscribing, while hunting
Subscribing, while hunting for info.
open your mind open the source
express yourself, share your tools
tried DBTNG Migrator
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 -
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-
I have 184 tables in the db. How can i solve these issues.
Work-around technique
I've hit a number of edge cases this script doesn't handle. A useful technique for debugging is to break up the steps, and use a a text editor to tweak things as necessary.
./mysql2sqlite -u root -pMySecretPassWord myDbase > sqliteimport.sqlsqlite3 database.sqlite < sqliteimport.sqlI've also found it useful to break out the initial dump (so I can see what's coming from mysql versus what's coming out of mysql2sqlite.sh), like this:
mysqldump -u root pMySecretPassWord --compatible=ansi --skip-extended-insert --compact temp_for_mysql2sqlite > mysqldump.sqlReplace this line:
With this one:
./mysql2sqlite.sh mysqldump.sqlI know this is a 12 year old
I know this is a 12 year old post, but for those who are looking for a sane way to migrate from a drupal mysql db to sqlite, I highly recommend this project: https://github.com/techouse/mysql-to-sqlite3
I was able to migrate a drupal 9.5 (with many fields and views) to a sqlite db in a matter of seconds!
Work-around technique · Run
Work-around technique · Run the script, exporting to a file instead of piping to sqlite3: ./mysql2sqlite -u root -pMySecretPassWord myDbase i tried to migrate the db of my d7 website from spacebar counter mysql to sqlite. I changed the settings.php file as follows If it's possible to make joins between the Drupal database and your source database (e.g., under MySQL, if they are on the same server, your connections ... 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 ...Drupal now has the ability to migrate an entire database from one server type to another! Thats right, Drupal can migrate itself from MySQL to PostgreSQL and ...