Automatic backups stopped AND rolled back when restoring drive image of Ubuntu-partition

This problem is a bit complex - I think: :slight_smile:

On Sept. the 13th I created a drive image backup of the Ubuntu partition on my Laptop. The SSD is dual-boot, so it also contains a Windows-OS-partition, an NTFS data-partition with all my personal files, and some very small hidden system partitions.

On Oct. the 6th something went seriously wrong, and I had to restore the Ubuntu partition backup.

Now I have just discovered that when logging in on http://localhost:8200/ngax/index.html#/restore/1 it says that the newest backup is from Sept. the 12th - just before making the drive image backup I restored on Oct. the 6thā€¦

But when looking directly into the backup-ā€˜bucketā€™ in Backblaze B2, the newest backup seems to be from Oct. the 5th: [duplicati-20181005T192200Z.dlist.zip.aes]ā€¦

I am almost ā€œproudā€ of being able to cause such a complicated problemā€¦ :wink:
Does anyone have any good ideas about what to do?

NB! I created 3 somewhat similar topics in June-July:

"How to make Duplicati start automatically with Ubuntu?
ā€œAutomatic backups stopped on June 23rd!ā€
ā€œAutomatic backups not running after Ubuntu restartā€

I received excellent help on all of them. Thank you!

Best regards,
Henrik R.

Important addition!:
I DO have a drive image backup of the Ubuntu partition from just before it was deleted by the restore!
I use a quite good free backup software called Paragon HD Manager 16 Basic.

NB: It seems to me that the basic cause of this problem is something I have experienced with several other data backup solutions:
There seems to be an index database about which files are backed up, but itā€™s not on the same partition as the actual files. That seems to be a logical error from my point of view.

Iā€™m glad you figured it out.

Iā€™m still trying to catch up with the ā€œcomplicated problemā€ :wink:. My impression is it was like this:

Ubuntu runs Duplicati to do a file backup of Ubuntu to B2.

Windows runs Paragon Hard Disk Manager to do an image backup of Ubuntu to somewhere.

Ubuntu breaks.

Paragon image restores Ubuntu, including Duplicati databases used to track destination info.

Duplicati confusingly looks older than B2. Does Direct restore from backup files look correct?

Possibly running The REPAIR command might be enough to bring things back into alignment.

If repair canā€™t align, a stronger version of it is to (maybe slowly) recreate from the destination.

The easy way is Database management. Other harder options are safer or more informative.

If youā€™re willing to use the UI Comandline option, ā€“dry-run would let you see what it proposes.

I forget whether you also need to set the ā€“log-level, e.g. to Information, to see what it reports.

If you want recent files and donā€™t care about old, simply direct restore to 20181005T192200Z.

You could then start fresh by exporting the job, deleting it and destination files, then importing.

Time for fresh backup depends on how big the backup is, but at least I think B2 upload is free.

Some people elect to backup the job database right after the actual backup. For now, itā€™s DIY.
Databases can become quite large, and local activity can cause a lot of data to get uploaded.
Generally the desire is to speed up recovery in case of disk loss. It avoids database recreate.

Lots of options available. Which ones are best for you depends on situation and preferences.

Duplicati will keep a local database with information about your backup. Itā€™s located in ~/.config of the user Duplicati is running under.

In any case you restored it to an old date, so you should either restore the database from your most recent backup or ask Duplicati to recreate (not repair) the local database.

Thanks for pointing out the location. I thought, though, that this is what was restored (stale) from the image, with no other backup copies of the database. Iā€™m still not sure of the exact situation, but I pitched my theory on it. :grin:

It sounds like youā€™re pretty sure repair canā€™t sort this out. Ideally, itā€™d recreate only the new backup it hadnā€™t seen. Maybe one day there will be better documentation on abilities and limitations of the several Duplicati repair tools.

Honestly repair might work but Iā€™m a bit paranoid about suggesting it in this case after this issue was reported Repair command deletes remote files for new backups Ā· Issue #3416 Ā· duplicati/duplicati Ā· GitHub

It looks like Recreate beats Repair, not only because of paranoia (weā€™ll have to figure out how to either obtain a code solution or an advice solution for that ā€“ never running Repair isnā€™t practical, plus itā€™s being enhanced), but because when I tried to set up this situation by copying an old database over a current one, Repair failed:

Failed to accept new index file: duplicati-i12c3a7d045f9433c9e9ea9e9b49c62d1.dindex.zip, message: Volume duplicati-b559c362a31984483b5a7c4d7cc520c19.dblock.zip has local state Deleting
System.Exception: Volume duplicati-b559c362a31984483b5a7c4d7cc520c19.dblock.zip has local state Deleting

and beyond just tripping over itself, it also ā€œsolvedā€ inconsistency by deleting destination to fit its own record, which is similar to your concern on #3416. --dry-run would have caught this (maybe after some deciphering).

Hi Pectojin and ts678!

Thank you for your suggestions!

Restoring the Duplicati database from the drive image backup made just before restoring an older drive image, thus trying to make it correspond to the current situation, seemed the smartest and easiest thing to do. So I did that. But now, when I login to Duplicati (http://localhost:8200/ngax/index.html#/log/1) I get this red error at the bottom of the screen:

" Error while running Lenovo-Ubuntu
The database disk image is malformed database disk image is malformed "

And when I press ā€œShowā€, I get this:

" Error
Failed to connect: The database disk image is malformed database disk image is malformed "

So what do I do?
The Repair command sounds a bit risky!
What about Recreate?
The problem is to get Duplicati to start doing automatic backups again EVERY day ā€œeternallyā€ :wink:

Clarification:
Login to Duplicati web-interface, and choosing Restore, is what shows that the last backup is from Sept. 12th.
While Backblaze shows the last backup is from Oct. 5th.

Bah, this error is annoying. Itā€™s possible itā€™s just an error in the database index. You can try the steps described here Database disk image is malformed - #23 by kenkendk

Alternatively Iā€™d recreate. Iā€™m afraid I canā€™t explain why the sqlite malforms as itā€™s not expected behavior.

Iā€™m unsure of chronology and detail. Is the Duplicati database restore-from-image thought to be new enough that if fixed it would be near the latest B2 destination of 20181005T192200Z and the difference could be left to Duplicati to delete in Repair (maybe after a --dry-run sanity check) if thatā€™s what happened? Letā€™s try to fix only if it may be fruitful. If not, maybe a Recreate (keep old DB copy just in case) might be better, however if you want things back faster, and possibly also dodge any latent issues in older versions, try a direct restore. Getting back to normal backup operations can then be done more leisurely. This depends on your priorities. Should your priorities include maximum data safety, a B2 snapshot is even more protection than a --dry-run.

It sounds like this image was taken just before the Oct 6 restore of Sep 12 image, so it might be worth fixing, however the conflicting result is that somehow youā€™re having things come up only showing Sep 12 backupā€¦

If this was an isolated restore of the job .sqlite file, be warned that itā€™s not always a single file you might need to restore, but maybe related ones with different suffixes, especially if Duplicati might have been active then. See this for some types, and this commenting on suffixes. You could possibly just restore the entire folderā€¦ Thereā€™s also a question of how healthy Ubuntu was at the time. Iā€™m not sure what ā€œwent seriously wrongā€ isā€¦

Iā€™m having a hard time reconciling the SQLite ā€œDatabase disk image is malformedā€ error (which can also be directly looked for in a web search, in hope of finding other ideas) with the Restore being healthy enough to give a surprisingly old date, given that the image was perhaps made on Oct 6 just before restoring Sep 12.

Looking inside that database (if can be opened) with something like DB Browser for SQLite to look over the Operation table would show the chronology of operations. Timestamps are UNIX, so converters are plentiful. You can also do SQL commands for repair (if youā€™re an expert ā€“ Iā€™m not) or for a ā€œPRAGMA integrity_check;ā€ from the ā€œDatabase disk image is malformedā€ link above (and there are also some precautions given there).

OK. This seems to have solved the problem:

In Duplicati: Advanced -> Database -> Recreate

After that, automatic backups have resumed.
And it was faster and much more practical than my failed attempt to restore the database from the Paragon drive image backup.
So now everything is back to normal.
Thank you.

Henrik

Hi ts678

I am not really sure what you are trying to say in this last post. But my problem is solved, so thank you.