Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't convert to MySQL from SQLite (8.2.6) #25458

Closed
Sreadon opened this issue Jul 12, 2016 · 9 comments
Closed

Can't convert to MySQL from SQLite (8.2.6) #25458

Sreadon opened this issue Jul 12, 2016 · 9 comments

Comments

@Sreadon
Copy link

Sreadon commented Jul 12, 2016

Hi,

Steps to reproduce

  1. Install an OwnCloud Server 8.2.6 with SQLite
  2. Try to convert to a MySQL database with dbconvert

Expected behaviour

It should convert all the SQLite database into a working MySQL Database

Actual behaviour

I have an error telling me that:

"An exception occurred while executing 'INSERT INTO oc_filecache (fileid, storage, parent, name, mimetype, mimepart, mtime, encrypted, path_hash, etag, storage_mtime, path, permissions, size, unencrypted_ size, checksum) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["1", "1", "-1", "", "2", "1", "1468314435", "0", "d41d8cd98f00b204e9800998ecf8427e", "5784b343e7837", "1468314128", "", "0", "13093746", "0", n
ull]:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'checksum' in 'field list'
"

So I checked into the MySQL database, and yes, the "checksum" field in oc_filecache is missing, should I create it myself?

Server configuration

Operating system: Ubuntu Server 12.04

Web server: Apache 2

Database: SQLite / MySQL

PHP version: 5.4

ownCloud version: 8.2.6

Updated from an older ownCloud or fresh install: Updated.

Where did you install ownCloud from: Official Page (Zip) - Manual Install


List of activated apps:
Enabled:

  • files: 1.4.4
  • files_pdfviewer: 0.8.1
  • files_sharing: 0.9.1
  • files_texteditor: 2.1
  • files_trashbin: 0.8.0
  • files_versions: 1.2.0
  • firstrunwizard: 1.1
  • gallery: 14.5.0
  • user_ldap: 0.8.0

Disabled:

  • activity
  • appframework
  • encryption
  • external
  • files_antivirus
  • files_external
  • files_locking
  • files_mv
  • files_videoviewer
  • news
  • notifications
  • provisioning_api
  • templateeditor
  • updater
  • user_external
  • user_webdavauth

The content of config/config.php:

{
"system": {
"mail_smtpdebug": false,
"mail_smtpmode": "smtp",
"mail_smtphost": "mail.--.fr",
"mail_smtpport": 25,
"mail_smtptimeout": 10,
"instanceid": "51aa5b2110704",
"passwordsalt": "_REMOVED SENSITIVE VALUE",
"datadirectory": "/var/www/owncloud/data",
"dbtype": "sqlite3",
"version": "8.2.6.2",
"installed": true,
"ldapIgnoreNamingRules": false,
"theme": "",
"maintenance": false,
"force ssl": true,
"trusted_domains": [
"cloud.--.fr",
"--.--.fr"
],
"secret": "_REMOVED SENSITIVE VALUE
",
"forcessl": false,
"loglevel": 0,
"trashbin_retention_obligation": "auto"
}
}

Are you using encryption: no

Logs

Don't have them but if really needed, I can reproduce the bug to have them.

*** IMPORTANT PRECISION! ***
I tried to move to SQLite after a fail during a migration to the 9.0.3 (Database locked) and because SQLIte is definitly not meant to be used on a production server. After the migration's fail, I moved back the whole /data directory to the old owncloud folder, so I think this fail should not have any incidence on this "bug".

Thanks and sorry if I'm the bug..

@PVince81
Copy link
Contributor

@Sreadon it looks like you tried to migrate the database while a DB upgrade wasn't complete. Best would be to restore your old instance, then perform the upgrade. And after a successful upgrade, do the conversion.

Or, do the DB conversion before doing the upgrade. But don't do both at the same time as the database schema will not match.

@Sreadon
Copy link
Author

Sreadon commented Jul 13, 2016

Thanks for the answer.

The thing is I already did the revert, the SQLite DB that I'm trying to convert to a MySQL DB is a perfectly working version of OwnCloud (8.2.6), that's why I don't understand where is the problem..

I have another idea to start on very good basis, should it be difficult to create a new OwnCloud's instance (ie, new directory/vhost/DB) based on MySQL and manually import my users and files? (I've only 10-15 LDAP Users), and should I be able to use the same salt etc in the config file?

Thanks!

@PVince81
Copy link
Contributor

You'd still need to convert the database, because you need to keep the metadata else you'll lose shares and other information.

@Sreadon
Copy link
Author

Sreadon commented Jul 13, 2016

Okay thanks. Still, I really don't know why the migration is bugging, may be one day during an update something went wrong an I've not been advised, don't know.

Anyways, is there somewere where I can find the SQL database schema to find the differences between 8.2.6 and 9.0? So I can "manually" try to correct the problem with the columns and even if it take me some time, do this migration..

Thanks.

@bboule
Copy link

bboule commented Jul 13, 2016

You might consider installing fresh copies of both (8.2.6 and 9) using MariaDB as the back end and then use a tool like navicat to run the scheme diff and then compare that to your current DB to see if anything needs to be adjusted manually (I would revert to your 8.2.6 backup and compare that to the scheme of the fresh 8.2.6 for starters and see if anything odd is happening and adjust accordingly).

@Sreadon
Copy link
Author

Sreadon commented Jul 15, 2016

Thanks for the help, I'lll try to do this and will keep you in touch.

@Sreadon
Copy link
Author

Sreadon commented Jul 26, 2016

Hi,

For your information, I ended up installing fresh copy of the 9.1 version using the manual method because during my holidays the auto-updater reverted some of the app's files from 8.2.6 to 8.1.2 (or something like that, can't remember sorry).

I really don't know what happened but I think my ownCloud installation was half broken before my migration due to using SQLite for what's it's not designed: production environnement.

Anyways, we are now using a proper version of ownCloud with a "real" SQL Environnement.

Thanks for your help & time,
Steven

@Sreadon Sreadon closed this as completed Jul 26, 2016
@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label needs info is set and there were no updates for 14 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.

@lock
Copy link

lock bot commented Jul 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants