OwnCloud – migrate sqlite to MySQL

OwnCloud is a simple and great solution for working with files online, especially as you do have it on your own machine. It offers WebDAV, Sync clients and it’s extendable by a couple of plugins. In short, I am convinced of the concept.

It’s easy to set up and you don’t even need a MySQL server for a basic setup. For heavy usage a MySQL Server is recommended. Bad luck if you started out with SQLite? Not at all. Migration is possible.

SQLite is just a portable SQL database, right? Yes and No. A straight dump imported into MySQL won’t work as there are some small differences. But first of all, let’s get the dump:

sqlite owncloud.db dump >> import.sql

Looking at the data spilled out you might notice, SQLite uses ” while MySQL wants `. A simple search & replace does the trick. Next thing is dropping the transaction statement enclosing the import. Last but not least I’d prefix the table names to make it easier for some setups. Final step: adapting the config file. This isn’t anything worth mentioning as things are straight forward and working.

Author:

2 thoughts on “OwnCloud – migrate sqlite to MySQL”

  • >> Das erste was auffällt ist die Verwendung der Quotes. SQLite verwendet “, MySQL bevorzugt ` <<

    SQLite benimmt sich wie der Rest der SQL-Welt, nur MySQL braucht – wie so oft – eine Extrawurst.

    Tux2000

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.