Importing old backups

I have an archive of backups going back several years. What’s the best way of importing these into Kopia so they show up alongside the snapshots that Kopia creates? Ideally, Kopia would treat each old backup as if it were created by Kopia itself and each backup would be associated with an appropriately old timestamp.

Assume these old backups can be mounted and treated like any other file system.

Thanks!

You can override timestamps for snapshots (using --start-time and --end-time flags) but I’m not really sure how feasible/practical it is to import an old archive of snapshots from another tool.

Here’s something you can try:

Try writing a script to restore snapshots one by one in order into a temporary directory, then kopia snapshot create --start-time ... --end-time /path/to/temp/directory (snapshots should should be reasonably quick assuming the changes were organic and incremental).

Once you have snapshots history imported you can copy/move the manifests to make them appear as history of the source directory using kopia snapshot copy-history or kopia snapshot move-history

Thank you for the method, jkowalski. Your answer gave me the elements that I needed to write my import script. I can confirm that it works. I imported from BackInTime, but it would work with any other. Only the restoration (or mounting) of snapshot depends on the original backup software.

This is the only thread I have found on this topic. Therefore, for future readers, I would like to point out two points to be careful about.

  1. The retention policy should be set carefully, at least on the eventual source path (i.e. destination of kopia snapshot move-history) and possibly on the temporary restoration directory (/path/to/temp/directory in jkowalski’s post). Otherwise, some snapshots may be removed at the next maintenance.
  2. The timestamp format involved several attempts on my part to find what was accepted by kopia. It is not documented (or I could not find it) and the ISO format (ISO 8601) is not supported. I eventually used the format displayed by kopia snapshot list, which was accepted.

I hope that this will help someone else. The ability to import my existing backups was the last thing holding me back from switching to kopia.