My ownCloud upgrade failed due to MySQL data corruption.
Examining the error log, it appears that the corruption affects the owncloud.oc_filecache table.
I tried running check table owncloud.oc_filecache; from the MySQL console but MySQL still crashed.
The name suggests that the table holds only cache data and that it should be possible to regenerate it.
Is there any way I can drop and recreate the table from scratch?
Answer
To clear the table, enter the MySQL console:
mysql -uroot p
Log on with your password and enter:
truncate owncloud.oc_filecache;
check table owncloud.oc_filecache;
quit
(owncloud is the database name and oc_ is the table name prefix, both of which are specified during setup and can differ on your system.)
This will delete the entire contents of the table—which is OK for oc_filecache, as it will get rebuilt by the server, but do not do this on a random table unless you know what you are doing.
After that, I retried running occ upgrade and got another error, this time for the oc_activity table.
After a quick search revealed that oc_activity holds recent activity data (from which entries eventually expire), I re-ran the above operation on oc_activity (sacrificing the “Recent Activity” entries of all users in the system) and retried occ upgrade.
This time, the upgrade went through smoothly without any errors. I had to run occ maintenance:mode --off manually, then re-enable my apps, and things look OK now.
No comments:
Post a Comment