pbek / nextbackup

NextBackup is the simple database backup solutions for your Nextcloud / ownCloud installation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Restore backup problem

tofublock opened this issue · comments

Hi,
I'm trying to restore my calendar tables. When I do that, Ownbackup says "Restoring your tables" but nothing happens. When I just try to restore "oc_calendarobjects", I get
Table(s) could not be restored: Inserting data row failed: An exception occurred while executing 'INSERT INTO oc_calendarobjects (id,calendardata,uri,calendarid,lastmodified,etag,size,componenttype,firstoccurence,lastoccurence,uid) SELECT ?,?,?,?,?,?,?,?,?,?,? FROM oc_calendarobjectsWHEREid= ? ANDcalendardata= ? ANDuri= ? ANDcalendarid= ? ANDlastmodified= ? ANDetag= ? ANDsize= ? ANDcomponenttype= ? ANDfirstoccurence= ? ANDlastoccurence= ? ANDuid= ? HAVING COUNT(*) = 0' with params ["1", "BEGIN:VCALENDAR\r\nPRODID:-\/\/Mozilla.org\/NONSGML Mozilla Calendar [...]
Can somebody help me on this? Is there a manual way to restore the tables?
Thanks!
Ah, right: Owncloud 9.0.5 on Ubuntu 14.04 server with Apache 2.4.7 and mysql 14.14.
More info: No updates in between backup (today) and my attempt at restoring. Same tables, same everything.

Doesn't ring any bell for me... ownbackup uses the internal ownCloud api to store and restore tables, maybe the api doesn't recognises some data.

Thanks for the quick response. So - no hints on where to go from here?

Once someone had troubles with longblob fields, I posted that as ownCloud issue at owncloud/core#25316.

Hm, that looks a lot like my error. That means I'm out of luck for now. Is there a way to extract the backup to a format I can work with manually?

If you had the problem from the issue you could try to edit your data/ownbackup/1489393802/oc_calendarobjects/structure.xml (use your timestamp instead of 1489393802) and set the longblob field to something like <type>clob</type><notnull>false</notnull>.

Other than that you would have to consult ownCloud for their (private) api...

Not that I can really break more at this point, but could you tell me exactly which tag to change, please?
Here's the full error:

Table(s) could not be restored: Inserting data row failed: An exception occurred while executing 'INSERT INTO oc_calendarobjects (id,calendardata,uri,calendarid,lastmodified,etag,size,componenttype,firstoccurence,lastoccurence,uid) SELECT ?,?,?,?,?,?,?,?,?,?,? FROM oc_calendarobjectsWHEREid= ? ANDcalendardata= ? ANDuri= ? ANDcalendarid= ? ANDlastmodified= ? ANDetag= ? ANDsize= ? ANDcomponenttype= ? ANDfirstoccurence= ? ANDlastoccurence= ? ANDuid = ? HAVING COUNT(*) = 0' with params [...CALENDAR ENTRY HERE...]: Column not found: 1054 Unknown column 'calendardata' in 'where clause'

Thanks for all your help and best regards from Vienna to Graz.

Ah, sorry. I didn't read carefully enough. I'll report back.

It worked. That was a lifesaver. Thanks so much!
For anyone with the same problem: Changing <field><name>calendardata</name></field> to <field><name>calendardata</name><type>clob</type><notnull>false</notnull></field> fixed the restore problem for me.

It took me several hours to reverse engineer that back then, I'm glad my findings were of use to you. 😄