# Repository Synchronization: kopia vs rsync

**URL:** <https://kopia.discourse.group/t/repository-synchronization-kopia-vs-rsync/79>\
**Category:** Support\
**Created:** [September 4, 2020, 12:04pm UTC](https://kopia.discourse.group/t/repository-synchronization-kopia-vs-rsync/79 "2020-09-04T12:04:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maclm](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/maclm/32/61_2.png) [@maclm](https://kopia.discourse.group/u/maclm)\
**Post date:** [September 4, 2020, 12:04pm UTC](https://kopia.discourse.group/t/repository-synchronization-kopia-vs-rsync/79/1 "2020-09-04T12:04:22Z")

</div>

My setup in a nutshell.

At the office (local):

- a few workstations (Macs and Wondows)
- a Linux server running [Rockstor](http://rockstor.com/) for data sharing, also used for Kopia Repo Server (KRS) with one single repo

At home (offsite):

- Synology NAS where I’d like to store copy of our Kopia repo

My question is about the last part: Is [Repository Synchronization](https://kopia.io/docs/repository-synchronization/) provided by Kopia any better (define _better_ the way you like) than rsync over ssh (which I used up until I stumble across Kopia)?

And maybe step zero: is running Kopia on Synology achievable?

---

<div class="post-metadata">

**Author:** ![francisco](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/francisco/32/40_2.png) [@francisco](https://kopia.discourse.group/u/francisco)\
**Post date:** [September 7, 2020, 3:59pm UTC](https://kopia.discourse.group/t/repository-synchronization-kopia-vs-rsync/79/2 "2020-09-07T15:59:01Z")

</div>

+1 on this question of whether one can rsync a repo.  
i.e. if I have  
client → sftp  
can one rsync the sftp repo to another server and switch the client to the new server?

I would suspect the answer is yes, but would be nice to get confirmation.

> [@maclm](#):
>
> Is [Repository Synchronization](https://kopia.io/docs/repository-synchronization/) provided by Kopia any better (define _better_ the way you like) than rsync over ssh (which I used up until I stumble across Kopia)?

maclm if I understand your qestions you are asking of doing an Rsync from machine A to machine B is better than copying the kopia repo? I think it is different  
rsync = always latest version. No history  
kopia = backups with multiple versions / history based on a policy

So I think the answer to your question may be no. It is not the same to rsync a folder than to copy a kopia repo from one machine to another (if I understood your question correctly)

---

<div class="post-metadata">

**Author:** ![jkowalski](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/jkowalski/32/3_2.png) [@jkowalski](https://kopia.discourse.group/u/jkowalski)\
**Post date:** [September 7, 2020, 4:40pm UTC](https://kopia.discourse.group/t/repository-synchronization-kopia-vs-rsync/79/3 "2020-09-07T16:40:06Z")

</div>

Kopia synchronization is not a file copy, but rather a blob copy, which leverages blob storage layer. Some blob storage providers (filesystem, SFTP, WebDav) introduce sharded directory structure to help with performance, while others (S3, GCS, Azure) use flat structure. Kopia repo sync can copy between those efficiently by only copying files that have changed.

Blob storage layer has one more important property - file writes are always atomic (file is written in its entirety or not written at all) and repository synchronization can leverage it too.

To your question - yes, it is possible to connect to a replica just fine, even if it’s been moved to a different storage provider.

My personal backup strategy is to backup N hosts to the cloud and have one of those also do periodic sync to local NAS. This way cloud is the source of truth but I have local NAS replica in case I need to quickly restore large amounts of data.

---

<div class="post-metadata">

**Author:** ![maclm](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/maclm/32/61_2.png) [@maclm](https://kopia.discourse.group/u/maclm)\
**Post date:** [September 8, 2020, 1:58pm UTC](https://kopia.discourse.group/t/repository-synchronization-kopia-vs-rsync/79/4 "2020-09-08T13:58:23Z")

</div>

Hi folks,

thanks for following-up on this.

> [@jkowalski](#):
>
> yes, it is possible to connect to a replica just fine, even if it’s been moved to a different storage provider.

That’s both comforting and good to know.

> [@francisco](#):
>
> if I understand your questions you are asking of doing an Rsync from machine A to machine B is better than copying the kopia repo?

I realize my question wasn’t particularly well formed. Of course `rsync` ins’t as interesting for backing stuff up, as it is a _sync_ utility, not a _backup_ utility. But to maintain a perfect copy of a repo, `rsync` should do.

That said, let me back up and clarify a little bit. I’ve settled on using `kopia` for backing-up workstations over LAN to Server-A (Rockstor running a `Kopia Repo Server`). Since everything happens within the LAN, all snapshots are pretty fast and frequent (~ once/hour).

Plus, Server-A internally uses `kopia` to backup its own data (files that are shared via SMB in the work environnement) to that same repo (this time accessed via `filesystem`).

That gives me a single repo that contains everything (complete), is deduplicated (small) and encrypted (secure). 🥳

Questions arise when it comes to maintain a remote copy of that single repo on Server-B (Synology):

1. Can we use `rsync` to copy a repo to a remote location?

2. Is `kopia repository synchronization` better than `rsync` for maintaining that remote copy?

3. Will `kopia` run on Synology? – I’ll have to try and report back.

@jkowalski thanks for making `kopia`!

---

<div class="post-metadata">

**Author:** ![jkowalski](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/jkowalski/32/3_2.png) [@jkowalski](https://kopia.discourse.group/u/jkowalski)\
**Post date:** [September 8, 2020, 2:42pm UTC](https://kopia.discourse.group/t/repository-synchronization-kopia-vs-rsync/79/5 "2020-09-08T14:42:50Z")

</div>

#1. Yes  
#2 - if you have filesystem on both sides, rsync is equivalent to kopia sync.  
#3 - I haven’t tried it, but Golang can target all kinds of OSes and architectures so we should be able to make it work.
