# Kopia maintenance with different owner

**URL:** <https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696>\
**Category:** General Topics\
**Created:** [November 17, 2025, 9:08am UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696 "2025-11-17T09:08:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mabod](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/mabod/32/941_2.png) [@mabod](https://kopia.discourse.group/u/mabod)\
**Post date:** [November 17, 2025, 9:08am UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696/1 "2025-11-17T09:08:43Z")

</div>

Hi,

I have a different setup than ususal. I have a pull setup where the kopia server pulls the backups. The remote folders are mounted with sshfs and then kopia does the backup from that mountpoint with a `–-override-source`.

Example:

```auto
$ mount -t sshfs root@leno:/ /tmp/tmp.zUKqYYQm3

$ kopia snapshot create --override-source=root@leno:/ --tags=id:leno@2025-11-17–10-04 /tmp/tmp.zUKqYYQm3L

```

Now I have an issue with running a full maintenance for this source:

```auto
$ kopia maintenance set --owner root@leno

$ kopia maintenance run --full
ERROR maintenance must be run by designated user: root@leno

```

What do I need to do to trigger the full maintenance for root@leno?

---

<div class="post-metadata">

**Author:** ![budy](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/budy/32/38_2.png) [@budy](https://kopia.discourse.group/u/budy)\
**Post date:** [November 18, 2025, 5:42am UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696/2 "2025-11-18T05:42:12Z")

</div>

Looks like you’re not actually connected to the repo as user root@leno…

---

<div class="post-metadata">

**Author:** ![mabod](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/mabod/32/941_2.png) [@mabod](https://kopia.discourse.group/u/mabod)\
**Post date:** [November 18, 2025, 7:55am UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696/3 "2025-11-18T07:55:46Z")

</div>

I am never connected as root@leno.

All kopia commands are executed on the sever as `root@rakete`. I am pulling the backups from the client. I am not logged into the client as `root@leno`. And, as you can see in my opening post, I overwrite the source with `--override-source=root@leno:/`.

This `override-source` is forcing kopia to ask for a "`designated user: root@leno`” when doing full maintenance. I need to find a way to covince kopia to do a full maintenance for snapshots which have been created with `override-source.`

---

<div class="post-metadata">

**Author:** ![mabod](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/mabod/32/941_2.png) [@mabod](https://kopia.discourse.group/u/mabod)\
**Post date:** [November 18, 2025, 8:15am UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696/4 "2025-11-18T08:15:41Z")

</div>

Let me add a question to this issue that came to my mind.

Lets assume I change the hostname of my server from `rakete` to `schnecke`. What happens then to the maintenance command? I assume the maintenance command will fail in the same way because the old snapshots where create for owner `root@rakete` and this owner does not exist anymore because it is now `root@schnecke`.

Is that correct? What is best practise for kopia when hostnames change?

---

<div class="post-metadata">

**Author:** ![budy](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/budy/32/38_2.png) [@budy](https://kopia.discourse.group/u/budy)\
**Post date:** [November 18, 2025, 8:23am UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696/5 "2025-11-18T08:23:15Z")

</div>

Then why did you set the maintenance owner to root@leno, anyway? Since you’re using sshfs, you’ll perform all snapshots as the user you used to connect to the repo, which is probably root@rakete and not root@leno. Since the maintenance owner should usually be the one you’re using to connect, there would be no change necessary.

Changing the owner of a snapshot would require the flag –override-user to indicate another user. You should also see all snapshots in Kopia UI right under your default user…

---

<div class="post-metadata">

**Author:** ![mabod](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/mabod/32/941_2.png) [@mabod](https://kopia.discourse.group/u/mabod)\
**Post date:** [November 18, 2025, 8:31am UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696/6 "2025-11-18T08:31:14Z")

</div>

I found the solution.

First:

`kopia repository connect filesystem --no-persist-credentials --path=/data/BACKUP/kopia-repo --override-hostname=leno --override-username=root`

Second:

`kopia maintenance set --owner root@leno`

Third:

`kopia maintenance run --full`

That is doing the trick.

@budy, thanks for your time.

---

<div class="post-metadata">

**Author:** ![mabod](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/mabod/32/941_2.png) [@mabod](https://kopia.discourse.group/u/mabod)\
**Post date:** [November 18, 2025, 8:37am UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696/7 "2025-11-18T08:37:03Z")

</div>

But now I am wondering if this maintenance thing I am doing is really neccessary.

I have one kopia repo and in this repo I have snapshots from several clients identified with `override-source.`

```auto
$ kopia snapshot list -a

root@acer:/
2023-11-17 10:40:00 CET k8c27489aeb6a612eb4365dbecf1cda9b 5.7 GB drwxr-xr-x files:44812 dirs:10347 (annual-3)
…

root@debserv:/
2024-11-27 16:41:26 CET k9342362f0090ffde52e28d4a963d6133 33.7 GB drwxr-xr-x files:270780 dirs:33045 (monthly-11)
…

root@leno:/
2023-04-23 22:54:00 CEST kc751e8c3394e0a2e190e8162dea52b75 42 GB drwxr-xr-x files:68069 dirs:10055 (annual-3)
…

root@macmini:/Users
2024-11-27 20:48:59 CET k0eb2ba9f4b21aad307c922e37e3d9c45 64 GB drwxr-xr-x files:165158 dirs:32933 (monthly-7)
…

root@macmini:extra-Platz
2024-11-27 20:55:33 CET kdfcaafee08a0fb32e199420e696a4a84 105.7 GB drwxrwxr-x files:132704 dirs:818 (monthly-7)
…

root@rakete:/
2024-12-30 19:33:08 CET kff9d63e91fba27974f21cc8509c025c6 109.5 GB drwxr-xr-x files:1206803 dirs:92069 (monthly-12,annual-2)
…

```

All this is on server rakete handled with user root@rakete. If I do a full maintenance as this user will that include all snapshots in that repo or will maintenance only happen to the snapshots with source `root@rakete`?

---

<div class="post-metadata">

**Author:** ![budy](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/budy/32/38_2.png) [@budy](https://kopia.discourse.group/u/budy)\
**Post date:** [November 18, 2025, 8:43am UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696/8 "2025-11-18T08:43:17Z")

</div>

As I said, since you’re using sshfs to pull the data, the snapshots belong to the root user of rakete, unless you’re using –overwrite-username, which would only be useful, if you ever planned to connect to that repo from a remote client. If not, you can have all the snapshots belong to the current local user root@rakete and be done.

Just keep in mind, that the user rights on the files don’t necessarily represent the snapshot username.

---

<div class="post-metadata">

**Author:** ![mabod](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/mabod/32/941_2.png) [@mabod](https://kopia.discourse.group/u/mabod)\
**Post date:** [November 18, 2025, 8:46am UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696/9 "2025-11-18T08:46:54Z")

</div>

ok. So let me double check.

I am always user root@rakete. When I do

`kopia maintenance run --full`

Will that do maintenance for the complete repo including everything, regardless of the override-source value?

---

<div class="post-metadata">

**Author:** ![budy](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/budy/32/38_2.png) [@budy](https://kopia.discourse.group/u/budy)\
**Post date:** [November 19, 2025, 12:22pm UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696/10 "2025-11-19T12:22:03Z")

</div>

Yes, the maintenance job will do all the maintenance tasks on the repo, regardless of what other owner is set. In the end the maintenance takes care of re-writing blobs, phasing out old blobs and the like. Nothing it does to the data in the repo itself, other than the juggling/removing of old fragments.

---

<div class="post-metadata">

**Author:** ![budy](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/budy/32/38_2.png) [@budy](https://kopia.discourse.group/u/budy)\
**Post date:** [November 19, 2025, 12:57pm UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696/11 "2025-11-19T12:57:34Z")

</div>

The only time, I am halting that automated maintenance is when I am performing a

`kopia repo sync-to` operation, to ensure, that the target gets a clean sync from my repo. Other than that, I am always relying on the automated maintenance.

---

<div class="post-metadata">

**Author:** ![mabod](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/mabod/32/941_2.png) [@mabod](https://kopia.discourse.group/u/mabod)\
**Post date:** [November 19, 2025, 3:21pm UTC](https://kopia.discourse.group/t/kopia-maintenance-with-different-owner/8696/12 "2025-11-19T15:21:40Z")

</div>

@budy, thank you so much.
