How to recreate a backup job


#1

From another post, duplicati quit on me and wouldn’t run any more, so i have delete and reinstalled it.

I can access all my back data via “restore”, but I don’t need to restore as it’s not lost.

I need to recreate the backup job. Does duplicati save the job in the backup somewhere?

If not, maybe it should automaticly (feature request).

So if its not saved, I will need to recreate it myself. If i do this, will it overwrite the backed up files? The backup if fairly large, I dont want to have to send all the data again.


#2

Hi @Joe. If you saved the backup job as .json file you can recreate it from the gui. If not you should be able to recreate a job and just point it to use the old .sqlite file. Let me know if you need further info.


#3

Thanks for replying. I didn’t save the jobs. Uugh!

I’ve wiped the install and done a fresh install.

I can access the remote files via restore and dupicati shows me where they all go locally, so was hoping it could recreate a job based on the backup.

My job backs up 5 whole folders and one folder that only backs up 5 or 6 sub folders.


#4

Adding a vote for that feature request.
Principle: Everything about a backup job should be easily and accurately derivable with nothing but access to the backup itself, and a fresh install of the software (former local system gone: one of the primary use-cases of a backup system).

CrashPlan called this 'adopt’ing a backup and it only took one click to trigger, as long as you could reach the backup.
It saved a lot of angst at what is usually an angst-ful time.


#5

You should be able to create a new job with the same settings (source, destination, password, etc.) as the old one and, when run, it will complain about finding unexpected remote files.

Doing a Database Repair should then gather the details needed to get you going again.


#6

Hi @JonMikelV-

So to do that i need to create a new backup job, and select NO files to backup and it will automaticly pick up the files / folders that i had selected in the original job?


#7

@Joe What you need to do is something very similar to @JonMikelV suggested. Depending on the version of Duplicati your running and the operating platform, I would suggest the following.

From the GUI

  • Make a second copy of the backup files for sanity :slight_smile:
  • Run a restore from the backup files from the GUI. Any file. This will cause Duplicati to restore the SQL Lite database from your backup files.
  • Find the .sqlite file. In Windows it’s located in C:\Users<profile>\AppData\Local\Duplicati
  • Create a new job with the same settings (source, destination, settings, etc.) Save the job but don’t schedule or run it.
  • From the GUI when you expand the job, go to to the database section and change the path to the file that was created during the restore and save.
  • Run a backup and see if it fails (it shouldn’t). When completed run some restores to make sure everything is humming the way it should

Let me know if you need further assistance.


#8

Thank for your reply. I’m trying this out on windows as its easier than messing about in freenas.

I have fresh installed duplicati, created a backup of 100 files and run it successfully.

Then i deleted duplicati, and all in the duplicati appdata folder.

Reinstalled duplicati. This simulates where i am with my “real” backup system.

I have files in a backup, and no “job”.

So, I have ran the restore, and it restores a file successfully, but it doesn’t appear to create any .sqlite files, except “Duplicati-server.sqlite” in app data, which gives me a “corrupt database” error if i use that.


#9

@Joe. Sounds like you’re running the latest release beta. Try @JonMikelV approach …


#10

With the real remote server (B2), I recreated the job, ran it, it complained about unexpected files and i ran the database repair.

It took 2 hrs to get to approx. 90% complete, and its been at 90% now for 19 hrs.

It appears to have crashed. Mono is using 100% cpu.


#11

Hey @Joe Sorry to hear about your troubles. What does the live log show? Have you tried killing the process from the gui and running it from the command line?

Duplicati.CommandLine repair []


#12

Thanks for the reply- I chose stop after current file from the GUI, and nothing happened after 8hrs overnight so I chose stop now. Again nothing happened so I restarted the jail.

There is an error in the log that says “error in worker thread”. Nothing else, unless there is another log somewhere not just the “show log” page in the gui?

I’ve started a “delete and recreate database” process this morning from the GUI and will report back later.

The backup is 186GB so not huge. It’s quite worrying that it can’t recreate the database. I wonder if i’d be able to restore files if required (!).

The devs should probably take this seriously and at least reply here.


#13

Sorry - somehow I missed your reply. You’re probably way past this, but no - you’ll still have to select your Source files since Duplicati by default doesn’t store a “copy” of the backup job anywhere.

As mentioned in the post below, there is a crash log stored in %LOCALAPPDATA%Duplicati\crashlog.txt and you can manually specify a log be created with the --log-file parameter, but otherwise all logs are stored in the .sqlite database files themselves (which is what the GUI is displaying):

I don’t know anything about jails so I don’t know where that crashlog.txt file would be. I do know that with Docker containers if I’m not careful I can end up storing logs and temp files in the container which often runs out of space - is that a possibility with a jail?


#14

I don’t think it can run out of space with a jail; I’ve not limited the amount of disk it can use.
I’ve searched and cannot find “crashlog.txt”, so it’s not been created. Probably trying to write to somewhere it can’t.
It would be useful if logs were written to a “logs” folder next to the .sqlite and suppress_donation_messages.txt file location as this definitely has correct permissions.

Here is an errors i’m seeing:

2 Dec 2017 21:06: Error in worker
System.Threading.ThreadAbortException
at Duplicati.Server.Runner.Run (Duplicati.Server.Runner+IRunnerData data, System.Boolean fromQueue) [0x00712] in :0
at Duplicati.Server.Program+<>c.b__36_4 (Duplicati.Server.Runner+IRunnerData x) [0x00000] in :0
at Duplicati.Library.Utility.WorkerThread`1[Tx].Runner () [0x00191] in <1cb5198b00f34ae59d97ee7fe7a3a16c>:0

2 Dec 2017 21:06: Failed while executing “Backup” with id: 1
System.Threading.ThreadAbortException
at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter, System.Action`1[T] method) [0x0011a] in <118ad25945a24a3991f7b65e7a45ea1e>:0
at Duplicati.Library.Main.Controller.Backup (System.String[] inputsources, Duplicati.Library.Utility.IFilter filter) [0x00068] in <118ad25945a24a3991f7b65e7a45ea1e>:0
at Duplicati.Server.Runner.Run (Duplicati.Server.Runner+IRunnerData data, System.Boolean fromQueue) [0x00454] in :0

2 Dec 2017 21:03: Error in worker
System.Threading.ThreadAbortException
at Duplicati.Server.Runner.Run (Duplicati.Server.Runner+IRunnerData data, System.Boolean fromQueue) [0x00712] in :0
at Duplicati.Server.Program+<>c.b__36_4 (Duplicati.Server.Runner+IRunnerData x) [0x00000] in :0
at Duplicati.Library.Utility.WorkerThread`1[Tx].Runner () [0x00191] in <1cb5198b00f34ae59d97ee7fe7a3a16c>:0

2 Dec 2017 21:03: Failed while executing “Repair” with id: 2
System.Threading.ThreadAbortException
at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter, System.Action1[T] method) [0x0011a] in <118ad25945a24a3991f7b65e7a45ea1e>:0 at Duplicati.Library.Main.Controller.RunAction[T] (T result, Duplicati.Library.Utility.IFilter& filter, System.Action1[T] method) [0x00007] in <118ad25945a24a3991f7b65e7a45ea1e>:0
at Duplicati.Library.Main.Controller.Repair (Duplicati.Library.Utility.IFilter filter) [0x0001a] in <118ad25945a24a3991f7b65e7a45ea1e>:0
at Duplicati.Server.Runner.Run (Duplicati.Server.Runner+IRunnerData data, System.Boolean fromQueue) [0x004a9] in :0

Hopefully that means something to someone and this can be fixed…

I can abort the repair by clicking “stop after current file”, that seems to stop the repair but I don’t want to do that, i need Duplicati to repair the database and proceed with backing up.

the only other option is to delete the remote files, and start again, but unless this bug can be found, Duplicati cannot be relied upon, which is a shame :frowning:

Is there anything in any of the recent canary builds that may fix this?

Im currently running 2.0.2.1_beta_2017-08-01


#15

Unfortunately when it comes to database repair (and potentially mono) errors I defer to others who have some experience with it. :frowning:


#16

OK Jon, thanks.

Anyone else know how to fix this?? It’s a fairly major issue!


#17

I appear to be able to restore files from the B2 backup. The “temporary” database creation succeeds and the file is restored.

Manual recreation fails. Hopefully this will help the devs find this and fix it (as i cant do a backup until its fixed).

Any ideas of how i can capture the temp database and use that instead? I couldn’t see where it was being created on disk, certainly not next to the other .sqlite database files in the config folder.


#18

@Joe, have you tried different versions of mono? Or recreating the FreeNAS jail altogether?


#19

I haven’t tried a different version of mono. The issues started when I had to reinstall duplicati into a fresh jail.

I have 2 jobs, the other is the same files to a different location using ftp and the database recreated ok.

Its the B2 database recreate that wont complete.

I may export the jobs and reinstall again to see if thats any better.


#20

I tried a complete jail reinstall and run today, here is the error:

10 Dec 2017 15:25: Failed while executing “Repair” with id: 1

System.Threading.ThreadAbortException
at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter, System.Action1[T] method) [0x0011a] in <118ad25945a24a3991f7b65e7a45ea1e>:0 at Duplicati.Library.Main.Controller.RunAction[T] (T result, Duplicati.Library.Utility.IFilter& filter, System.Action1[T] method) [0x00007] in <118ad25945a24a3991f7b65e7a45ea1e>:0
at Duplicati.Library.Main.Controller.Repair (Duplicati.Library.Utility.IFilter filter) [0x0001a] in <118ad25945a24a3991f7b65e7a45ea1e>:0
at Duplicati.Server.Runner.Run (Duplicati.Server.Runner+IRunnerData data, System.Boolean fromQueue) [0x004a9] in :0

10 Dec 2017 15:25: Error in worker

System.Threading.ThreadAbortException
at <0x00000 + 0x00000>
at Duplicati.Server.Database.Connection.OverwriteAndUpdateDb[T] (System.Data.IDbTransaction transaction, System.String deleteSql, System.Object[] deleteArgs, System.Collections.Generic.IEnumerable1[T] values, System.Boolean updateExisting) [0x00012] in <a6c0c2089b9a44ec9be5057a44f12116>:0 at Duplicati.Server.Database.Connection.RegisterNotification (Duplicati.Server.Serialization.NotificationType type, System.String title, System.String message, System.Exception ex, System.String backupid, System.String action, System.Func3[T1,T2,TResult] conflicthandler) [0x000a8] in :0
at Duplicati.Server.Runner.UpdateMetadataError (Duplicati.Server.Serialization.Interface.IBackup backup, System.Exception ex) [0x000c6] in :0
at Duplicati.Server.Runner.Run (Duplicati.Server.Runner+IRunnerData data, System.Boolean fromQueue) [0x006fb] in :0
at Duplicati.Server.Program+<>c.b__36_4 (Duplicati.Server.Runner+IRunnerData x) [0x00000] in :0
at Duplicati.Library.Utility.WorkerThread`1[Tx].Runner () [0x00191] in <1cb5198b00f34ae59d97ee7fe7a3a16c>:0