Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm building my first site with SQLite (and i'm very noob with this database).
Can I use backup and migrate with SQLite?
I've installed module but I can't find the default database in "backup from" field in quick backup.
Thanks
Comments
Comment #1
tuccio CreditAttribution: tuccio commentedThe SQLite database is just a single file located in your filesystem (by default it is /sites/default/files/.ht.sqlite) so in order to backup the db all you have to do is copy that single file. To find the location of the SQLite file in case you changed the default path, you can look at settings.php.
Comment #2
RaulMuroc CreditAttribution: RaulMuroc commentedMaybe this should be a group discussion.
Ok, i know how to backup and restore = copy and paste. But what I have want to modify it through phpmyadmin? Because host provider doesn't detect it. Is there another appart of: http://drupal.org/project/dbtng_migrator converting to mysql, modifying, converting to sqlite with the risk it entails of losing data, bad conversion, etc?
Comment #3
RaulMuroc CreditAttribution: RaulMuroc commentedComment #4
Talkless CreditAttribution: Talkless commentedI would like to suggest reconsidering SQLite backup support.
It's not that simple. First of all, it's not single file all the times, it creates -journal or -wal files during transactions. And even if you try to copy journal/WAL files also, it's not quite safe either, because.. well... database is in changing state.
Please see section 1.2 in How To Corrupt An SQLite Database File:
So, if you have very simple shared PHP hosting, without access to shell, and without possibility to stop web server to make sure no new transactions will be started, it is dangerous to rely on simple file copy.
As a side note, if someone wants to make atomic SQLite dump, can try to use this snippet:
But most probably shell_exec() / exec() will disabled in shared hosting...
Another alternative would be opening (NORMAL/EXCLUSIVE ?) transaction in PDO and copying a file during transaction?