Kopia repository sync-to filesystem

Tried to sync location1/repo1 to location2/repo1 after connecting to location1/repo1.
Destination location2/repo1 has no data created yet, but has policy set.

$ sudo kopia repository connect filesystem --path /location1/repo1
$ sudo kopia repository sync-to filesystem --path /location2/repo1

Got this error:
kopia: error: destination repository contains incompatible data, try --help

Both repos were initialised the same way with similar policies.

Sync only works with one repository. You simply make a replica of it. It’s not suitable for merging repositories.

In other words, target needs to be an un-initialized folder?

1 Like

yes, or it must have exactly the same kopia.repository file

so… IMO this feature is documented absolutely horribly. The documentation states:

Any repository location can be used as target.

but in fact thats not true, as we see here.

The only way I’ve seen how to make this work, is to create an empty folder, copy over the kopia.repository.f file from your source repository, and then use the sync-to command. And I only got that because of this forum entry.

Well… the command implies that you already have repository configured at the remote end. It won’t do that for you. So, if you choose “sync-to filesystem”, you will need to have a repo ready on the target. Sure, not the best way to phrase it, but not that bad either. Depends on whether you’re thinking in Kopia’s “terms” or are somewhat mislead by the “filesystem”.

You probably wouldn’t expect Kopia to create you a new S3 bucket on any given provider, if you chose S3 as the target for sync-to, or would you?

The point is that it doesn’t accept just any repository. It must have certain features in common with the source repository, and which these are is not documented at all. Also not documented is the workflow to get to such a compatible repository, and I could not find anything in the CLI documentation (–help) or reference.

As it stands, AFAICT, the way you get sync-to to work is said “create an empty folder and copy over the kopia.repository.f file”, which feels really janky. But even if that is the expected way, for gods sake, document that outside of the forum…

I’d be fine writing that documentation, If I were not kinda suspecting that there is a better way, and somewhat dubious whether that approach will always work out…