Export all existing configurations

Hi everyone!
How do I export all backup configurations that exist in my duplicaty installation? I’ve got plenty of them and it may be not very comfortable to click every configuration and export it and save to a file. Are there any ways of mass exporting?

1 Like

As far as I know there’s no way to bulk export jobs - they need to be done individually.

On top of that, I’m not sure you can export global settings so if your job “relies” on global settings (say, for email notifications) you may need to make note of those separately.

Note that a bulk export probably wouldn’t be too difficult to add if somebody wanted to give it a try…

1 Like

Indeed, it only relies on 2 API calls. I should give it a shot when I get some time :slight_smile: Or maybe just only implement it in my CLI tool so people have to use that :wink:

2 Likes

I added the option to export all configuration at once using the --all parameter. It will dump each config into a timestamped yaml or json file named after the backup, so you can use it as a pre backup script to always have an up to date copy of your backup configs. It works in conjunction with --output-path so you can just export it wherever you want.

1 Like

That’s great!

So now that you’ve given us a cool function but tied it to your cool CLI tool, all we have to do is follow these installation instructions and set a pre-backup script to run duc export backup --all --output=JSON --output-path=[folder included in backup]?

I hate to ask this, but is there an option to NOT have the timestamp so we can rely on Dupliacti for versioning? (Ideally it could be included as part of the dindex file and more easily accessed for system recovery than something like Entire configuration backup)

Oh - and in the Exporting Backups description you might want to mention it only does the JOB settings, not any global ones - just like Duplicati’s export. :wink:

I’ll can fix that with a parameter :slight_smile:

This is may be a little more work. Might be next up to add an option to export all global options, and then a flag on the backup export :thinking:

I think it would be cool to also add this to the Duplicati server itself, but it kinda has to be more worked into the creation of the index and obviously some logic to extract it (since it then won’t be recoverable from the restore page).

Please help me. I use this command with the last duc:

C:\Programs\Duplicati_Client>duplicati_client export backup --all --output=JSON --output-path=D:\11

And see this error:

Traceback (most recent call last):
  File "duplicati_client.py", line 1317, in <module>
  File "duplicati_client.py", line 208, in main
  File "duplicati_client.py", line 1234, in export_resource
NameError: name 'export_backup' is not defined
[12640] Failed to execute script duplicati_client

That I do wrong? I have tried many ways to write params but all without success.

Sorry for the late reply… It’s a code mistake, but I saw you found it on your github fork. Thanks :slight_smile:

I included your fix and shipped a new release: Release 0.4.22_beta_2019-09-24 · Pectojin/duplicati-client · GitHub

2 Likes

Was just trying out this export function… in my test the Sources, Settings, and Filters values are all ‘null’. Export from Duplicati itself works as expected.

Am I doing something wrong?

Thank you! I couldn’t make .exe ((( But now I have thanks to you. :upside_down_face:

Yeah the windows binary builder setup is a bit complicated.

It relies on CygWin to run a bash script because I really don’t know how to script batch :joy:

That sounds odd, what parameters are you using?

I ran this command (after login, of course):

duplicati_client.exe export backup --all --output=json

I vaguely recall some information not being provided on the backup itself through the api, but instead requiring the api endpoint for global settings, but I’ll have to look into it. I guess it also doesn’t explain the missing filter info.

I figured out the issue.

I had originally used the regular backup GET command to create the export… But there’s an actual GET backup/id/export API endpoint that provides the entire export object.

No need to do anything complicated, I just have to change the endpoints and a little bit of logic.

1 Like

Put out a new release here Release 0.4.24_beta_2019-09-28 · Pectojin/duplicati-client · GitHub

It works pretty much the same, but a bit simpler… I changed json to be the default export format since the CLI doesn’t support restoring anyway… So you’ll be needing the json version for the webUI.

duc export 42

or

duc export --all --output-path=~/test/