Delete old versions of backup without running a new backup

I have an old backup configuration from a former laptop. When I started using a new laptop it was time to clean up some stuff and to rearrange things. I kept de old backups on my remote storage space (Stack) because they could contain files I might need some day. But one of those backups contains 14 versions (it was configured with the smart retention option). I want to save space on my remote storage so I want to delete the 13 oldest versions of the backup and just keep the last one. But I cannot run the backup one last time because the source has been rearranged or removed. I just want to delete the older versions.

Is that possible? And if so, how can I do that?

Hello and welcome!

Yes you can delete versions without running a new backup. In the main Web UI, click on your backup job to expand options. Click the blue “Commandline …” link. Change the dropdown to “delete”. Replace the contents of the “Commandline arguments” box with --version=1-13 (the most recent backup is version 0, so this would select the older 13 versions for deletion). Finally, click the blue “Run delete command now” button at the bottom right of the page.

Hope this helps!

4 Likes

Thanks for your clear explanation. It works!

2 Likes

All right, that works great.

Now, is there also a way to delete, let’s say, nine versions out of ten in one go?

I tried this:

–version=11-19
–version=21-29

As a result, versions 21 to 29 were deleted. The first line was ignored.

I thought of trying this (but didn’t dare):

–version=11-19;21-29

Would this work?

I did a quick test with multiple ranges and using a comma appeared to work fine. In my test I used:

--version=0-1,3

and this was the result:

  Listing remote folder ...
  Deleting file duplicati-20220227T044518Z.dlist.zip (1.22 KB) ...
  Deleting file duplicati-20220227T044527Z.dlist.zip (1.31 KB) ...
  Deleting file duplicati-20220227T044530Z.dlist.zip (1.34 KB) ...
  Deleting file duplicati-b65f1345548e147b396414ad5e3b24872.dblock.zip (792 bytes) ...
  Deleting file duplicati-i3c832b974b0c4662bed7eabb946d051b.dindex.zip (605 bytes) ...
  Deleting file duplicati-b3ea6e8ec5ff24aaa9cc389080ab793b5.dblock.zip (792 bytes) ...
  Deleting file duplicati-ibc82f1c271244e0d951ba8e47c99f8b2.dindex.zip (606 bytes) ...
These filesets were deleted:
0: 2/26/2022 8:45:30 PM
1: 2/26/2022 8:45:27 PM
3: 2/26/2022 8:45:18 PM
Return code: 0

2 Likes

Wow! Great! It works! What an incredibly flexible program. :brain:

Thank you!

hi, i have 5 version of backups. following your guide, I use --version=1-4 and it delete some backups (seems so from the logs) and show success. but in the home page. it still always show 5 version even if I restart the docker or run delete for few more times.

From what I recall the backup summary info won’t be updated until the next backup is performed.

You can check what Restore offers. Old version 0 should be the same, and old 5 would move to 1.

I hope nobody minds me jumping in on this thread, but it seems the knowledge I need is here.

I have moved to a new computer (Ubuntu Linux from Windows). I have a directory on an external HDD called Duplicati Backup. It will have loads of old versions of the backups I used to do on my old Win10 machine.

Is there a way I can identify and then delete some of the old backup, to free up space on the drive?

I would prefer to use the GUI, but currently that lists no backups, obviously, because it is a new install. I could also use the command line. I have found I can restore files from the backup location on the external HDD, but it doesn’t give me any options or show versions that are present on the drive.

Thanks for any steer.

Your situation seems a bit of a special case, so see these other recent topics too:

Changing source OS (Windows to Linux)

Deleting Files on B2 not working because old DB not found (awaiting information)

Doing it on Windows would have been far more routine. Is old system still around?
Above posts get you around need of a backup, but not around your change of OS.

Note that a backup only uploads changes, so size growth may be small, but it also
means that delete of versions might not reduce size a lot. It does depend on use…

Are you low on space? If you can migrate the backup, it shouldn’t take much more.
Migration is kind of technical. Read first link on OS change for some of the options.

Going with full Windows and full Linux backup versions could use a lot more space.
Reusing at least current source file contents in the backup might use only what the
metadata (file attributes) need, because those are very different due to OS change.

EDIT:

Each one has a dlist file, and previous methods such as linked above seem to be
editing (maybe manually) each one, if the goal is to make them fit new Linux layout.

Although all of this internal surgery is poorly charted, I found another that might help
solve the too-many-dlist-to-edit pain. It uses DB Browser for SQLite on Windows DB
to search and replace in Prefix column in PathPrefix table to change to new way.
Duplicati Repair knows how to reupload dlist files that vanish, so I hid them and a
Repair replaced them with the versions with Linux paths. Very experimental though.
Before trying this, you’ll have to decide how much risk you want to take with backup.

If this is saying that GUI provides better lead-through, yes it does. CLI takes options.
Getting help from the Command Line Tools or the manual can help pick what to use.

The FIND command

If no <filename> is specified, a list of all available backups is shown.

Restoring files from a backup is the equivalent GUI way to get numbers.

You might have built a database tied to the location, which could be used in the GUI as well.
You could look for your destination in text file ~user./config/Duplicati/dbconfig.json.

GUI database would initially have a database assigned, but no database yet, as seen by the
Delete button being unavailable (greyed out). You can save new path to CLI’s if you like that
and if you think sharing database is good. For independent GUI, Repair button will build DB.
You’ll then be able to do GUI Restore to specified folder, but more backups won’t be allowed.
The message will be as in earlier post in Changing source OS, and you decide how far to go.
Google search found some other examples of the message, if you’d like to see related topics.