Owncloud database migration from SQLite to MySQL – QNAP specific

One of new few features on Owncloud 7 is the possibility to migrate databases. On my case, I originally installed Owncloud on SQLite, which is fine for a small number of files and one single user, but when going into the tens of thousands of files and multi user, SQLite is no longer a solution.

Then, how do we get out of SQLite without having to start from scratch ?

  1. Set up QNAP to locally run Owncloud;
  2. Create a new mysql database;
  3. Migrate database.

1. Set up QNAP to locally run Owncloud

The script to migrate database on Owncloud is “occ”. However, when trying to run this on a QNAP machine, the following error will appear:

/mnt/ext/opt/apache/bin/php occ db:convert-type
Magic Quotes is enabled. ownCloud requires that it is disabled to work properly.
Magic Quotes is a deprecated and mostly useless setting that should be disabled. Please ask your server administrator to disable it in php.ini or in your webserver config.

Now, this is a complete nuisance because on all php.ini files I couldn’t find on QNAP specifically disable Magic Quotes. Probably this is due to the fact that there is no php.ini file set for the command line php, but this is out of the scope of this post. So the solution is making sure that the command line php would also disable it.

1. Create a new php.ini

On your Owncloud directory (it can be on any other, but this simplifies scopes) create a new php.ini file with nano, assuming your current directory is the Owncloud root directory:

nano php.ini

On this file add the following text:

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off

This should handle the magic quote things.

2.Change the occ permissions

Now, this is a small step and it shouldn’t be necessary, it on reality it is:

chmod 777 occ

This finishes what is needed to setup Owncloud.

One comment

  1. Pingback: Installing Owncloud 7 on QNAP hardware – upgrade from version 6 | Too many Bits, too little Bytes

Leave a Reply

Back to Top