# I deleted my repository.config while KopiaUI runnig

**URL:** <https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172>\
**Category:** Support\
**Created:** [July 22, 2023, 9:40pm UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172 "2023-07-22T21:40:04Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrei](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Andrei](https://kopia.discourse.group/u/Andrei)\
**Post date:** [July 22, 2023, 9:40pm UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/1 "2023-07-22T21:40:04Z")

</div>

Hello all!

I am happy user of KopiaUI, but suddenly I decide to play with kopia.exe CLI.

While KopiaUI running in background as usual, I created new repository with

```auto
kopia repository create filesystem --path=C:\kopia_test

```

Then i take a look at `%USERPROFILE%\AppData\Roaming\kopia\` to see what changes in `repository.config`. I suppose that the new section will be added to it, or new config file will be created. But I found that my old `repository.config` file was overwritten with new one. Panicked, I disconnected from the new repository:

```auto
kopia repository disconnect

```

then `repository.config` file disappear.

Now I have KopiaUI running, still connected to my main repository, and in Repository tab of KopiaUI indicated `repository.config` that actually is absent. Next snapshot scheduled in 3 hours.

Is it OK? Did I do something wrong (except for not backing up huh)? Will KopiaUI continue to work? What will happens after restarting computer?

---

<div class="post-metadata">

**Author:** ![ZebCorp](https://avatars.discourse-cdn.com/v4/letter/z/5fc32e/32.png) [@ZebCorp](https://kopia.discourse.group/u/ZebCorp)\
**Post date:** [July 23, 2023, 7:41am UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/2 "2023-07-23T07:41:06Z")

</div>

If there no other repository.config exists (e.g all repositories are disconnected), Kopia create a new repository.config. If repository.config exists Kopia creates repository-XXX.config. For multiple repositories, you can create a “dummy” repository.config (e.g, non used, empty repository) and then connect another ones, which each gets its own repository-XXX.config.

You can delete repository.config file and connect again to the repository. Kopia just create a new config file.

---

<div class="post-metadata">

**Author:** ![Andrei](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Andrei](https://kopia.discourse.group/u/Andrei)\
**Post date:** [July 23, 2023, 8:02am UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/3 "2023-07-23T08:02:07Z")

</div>

> [@ZebCorp](#):
>
> If there no other repository.config exists (e.g all repositories are disconnected), Kopia create a new repository.config. If repository.config exists Kopia creates repository-XXX.config.

I was hoping for this since the documentation [says](https://kopia.io/docs/reference/command-line/#configuration-file)

> For each repository connection, Kopia maintains a configuration file…

But this is not happen in my case. The repository.config existed, but the program created a new one with the same name, overwriting the old one. Is this a bug?

---

<div class="post-metadata">

**Author:** ![ZebCorp](https://avatars.discourse-cdn.com/v4/letter/z/5fc32e/32.png) [@ZebCorp](https://kopia.discourse.group/u/ZebCorp)\
**Post date:** [July 23, 2023, 8:29am UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/4 "2023-07-23T08:29:17Z")

</div>

> [@Andrei](#):
>
> repository.config existed,

Hm. If repository.config existed, Kopia should created a new xxx one. But, if your repository was disconnected, then Kopia overwrite the existed one. New ones (repository-xxx.config) are created in situation of connected repositories.

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [July 23, 2023, 9:04am UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/5 "2023-07-23T09:04:49Z")

</div>

When using both UI and cmd with multiple repos good practice is to explicitly specify which config file you want to use with every kopia cmd command, e.g.:

`kopia repository create filesystem --path=/path/to/repo --config-file %USERPROFILE%\AppData\Roaming\kopia\repository_local_testing.config`

This way you will never have surprises.

---

<div class="post-metadata">

**Author:** ![Andrei](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Andrei](https://kopia.discourse.group/u/Andrei)\
**Post date:** [July 23, 2023, 9:20am UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/6 "2023-07-23T09:20:46Z")

</div>

I sure that repository.config existed and repository was connected, because KopiaUI was runnig and showing my main repository detais on all tabs.

---

<div class="post-metadata">

**Author:** ![Andrei](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Andrei](https://kopia.discourse.group/u/Andrei)\
**Post date:** [July 23, 2023, 9:23am UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/7 "2023-07-23T09:23:45Z")

</div>

I did the test with copia CLI only. This wrong behavior confirmed:

(notice the repository.config.mlock file still exists after first incident)

> **CLI log**
>
> ```auto
> PS C:\Users\Andrey\AppData\Roaming\kopia> dir
> 
> Каталог: C:\Users\Andrey\AppData\Roaming\kopia
> 
> Mode LastWriteTime Length Name
> ---- ------------- ------ ----
> -a---- 7/23/2023 3:45 AM 0 repository.config.mlock
> -a---- 7/23/2023 12:00 AM 57 ui-preferences.json
> 
> PS C:\Users\Andrey\AppData\Roaming\kopia> kopia repository create filesystem --path=C:\kopia\repo1
> Enter password to create new repository:
> Re-enter password for verification:
> Initializing repository with:
> block hash: BLAKE2B-256-128
> encryption: AES256-GCM-HMAC-SHA256
> Connected to repository.
> 
> NOTICE: Kopia will check for updates on GitHub every 7 days, starting 24 hours after first use.
> To disable this behavior, set environment variable KOPIA_CHECK_FOR_UPDATES=false
> Alternatively you can remove the file "C:\Users\Andrey\AppData\Roaming\kopia\repository.config.update-info.json".
> 
> Retention:
> Annual snapshots: 3 (defined for this target)
> Monthly snapshots: 24 (defined for this target)
> Weekly snapshots: 4 (defined for this target)
> Daily snapshots: 7 (defined for this target)
> Hourly snapshots: 48 (defined for this target)
> Latest snapshots: 10 (defined for this target)
> Compression disabled.
> 
> To find more information about default policy run 'kopia policy get'.
> To change the policy use 'kopia policy set' command.
> 
> NOTE: Kopia will perform quick maintenance of the repository automatically every 1h0m0s
> and full maintenance every 24h0m0s when running as Andrey@desktop-49rbbuq.
> 
> See https://kopia.io/docs/advanced/maintenance/ for more information.
> 
> NOTE: To validate that your provider is compatible with Kopia, please run:
> 
> $ kopia repository validate-provider
> 
> PS C:\Users\Andrey\AppData\Roaming\kopia> dir
> 
> Каталог: C:\Users\Andrey\AppData\Roaming\kopia
> 
> Mode LastWriteTime Length Name
> ---- ------------- ------ ----
> -a---- 7/23/2023 3:45 AM 0 repository.config.mlock
> -a---- 7/23/2023 2:57 PM 139 repository.config.update-info.json
> -a---- 7/23/2023 12:00 AM 57 ui-preferences.json
> 
> PS C:\Users\Andrey\AppData\Roaming\kopia> type .\repository.config
> {
> "storage": {
> "type": "filesystem",
> "config": {
> "path": "C:\\kopia\\repo1",
> "fileMode": 384,
> "dirMode": 448,
> "dirShards": null
> }
> },
> "caching": {
> "cacheDirectory": "..\\..\\Local\\kopia\\fc52e8fb826eabc2",
> "maxCacheSize": 5242880000,
> "maxMetadataCacheSize": 5242880000,
> "maxListCacheDuration": 30
> },
> "hostname": "desktop-49rbbuq",
> "username": "Andrey",
> "description": "Repository in Filesystem: C:\\kopia\\repo1",
> "enableActions": false,
> "formatBlobCacheDuration": 900000000000
> }
> PS C:\Users\Andrey\AppData\Roaming\kopia> kopia repository create filesystem --path=C:\kopia\repo2
> Enter password to create new repository:
> Re-enter password for verification:
> Initializing repository with:
> block hash: BLAKE2B-256-128
> encryption: AES256-GCM-HMAC-SHA256
> Connected to repository.
> 
> NOTICE: Kopia will check for updates on GitHub every 7 days, starting 24 hours after first use.
> To disable this behavior, set environment variable KOPIA_CHECK_FOR_UPDATES=false
> Alternatively you can remove the file "C:\Users\Andrey\AppData\Roaming\kopia\repository.config.update-info.json".
> 
> Retention:
> Annual snapshots: 3 (defined for this target)
> Monthly snapshots: 24 (defined for this target)
> Weekly snapshots: 4 (defined for this target)
> Daily snapshots: 7 (defined for this target)
> Hourly snapshots: 48 (defined for this target)
> Latest snapshots: 10 (defined for this target)
> Compression disabled.
> 
> To find more information about default policy run 'kopia policy get'.
> To change the policy use 'kopia policy set' command.
> 
> NOTE: Kopia will perform quick maintenance of the repository automatically every 1h0m0s
> and full maintenance every 24h0m0s when running as Andrey@desktop-49rbbuq.
> 
> See https://kopia.io/docs/advanced/maintenance/ for more information.
> 
> NOTE: To validate that your provider is compatible with Kopia, please run:
> 
> $ kopia repository validate-provider
> 
> PS C:\Users\Andrey\AppData\Roaming\kopia> dir
> 
> Каталог: C:\Users\Andrey\AppData\Roaming\kopia
> 
> Mode LastWriteTime Length Name
> ---- ------------- ------ ----
> -a---- 7/23/2023 3:45 AM 0 repository.config.mlock
> -a---- 7/23/2023 3:02 PM 139 repository.config.update-info.json
> -a---- 7/23/2023 12:00 AM 57 ui-preferences.json
> 
> PS C:\Users\Andrey\AppData\Roaming\kopia> type .\repository.config
> {
> "storage": {
> "type": "filesystem",
> "config": {
> "path": "C:\\kopia\\repo2",
> "fileMode": 384,
> "dirMode": 448,
> "dirShards": null
> }
> },
> "caching": {
> "cacheDirectory": "..\\..\\Local\\kopia\\1d3beccdd5e99fe1",
> "maxCacheSize": 5242880000,
> "maxMetadataCacheSize": 5242880000,
> "maxListCacheDuration": 30
> },
> "hostname": "desktop-49rbbuq",
> "username": "Andrey",
> "description": "Repository in Filesystem: C:\\kopia\\repo2",
> "enableActions": false,
> "formatBlobCacheDuration": 900000000000
> }
> PS C:\Users\Andrey\AppData\Roaming\kopia> kopia repository disconnect
> deleted repository password for C:\Users\Andrey\AppData\Roaming\kopia\repository.config.
> PS C:\Users\Andrey\AppData\Roaming\kopia> dir
> 
> Каталог: C:\Users\Andrey\AppData\Roaming\kopia
> 
> Mode LastWriteTime Length Name
> ---- ------------- ------ ----
> -a---- 7/23/2023 12:00 AM 57 ui-preferences.json
> 
> PS C:\Users\Andrey\AppData\Roaming\kopia> kopia --version
> 0.13.0 build: 7f69502bddd6650e7cb7a132291bc54920e58988 from: kopia/kopia
> 
> ```

---

<div class="post-metadata">

**Author:** ![Andrei](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Andrei](https://kopia.discourse.group/u/Andrei)\
**Post date:** [July 23, 2023, 9:33am UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/8 "2023-07-23T09:33:45Z")

</div>

> [@ZebCorp](#):
>
> But, if your repository was disconnected, then Kopia overwrite the existed one.

As i show in my previous message, in my experience, when repository disconnecting, Kopia deletes repository.config. Hence, if repository was disconnected, then nothing exists to overwrite.

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [July 23, 2023, 9:33am UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/9 "2023-07-23T09:33:48Z")

</div>

It is not “wrong behaviour”. Simply cmd always uses `repository.config` file unless you specify otherwise using `--config-file` flag.

When you use UI only then it does it for you, when you use cmd it is your responsibility.

---

<div class="post-metadata">

**Author:** ![Andrei](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Andrei](https://kopia.discourse.group/u/Andrei)\
**Post date:** [July 23, 2023, 9:41am UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/10 "2023-07-23T09:41:32Z")

</div>

I see, thanks!

But maybe then [this](https://kopia.io/docs/reference/command-line/#configuration-file) documentation statement

> For each repository connection, **Kopia maintains** a configuration file…

should be changed to something like

> For each repository connection, **user maintains** a configuration file…

😃

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [July 23, 2023, 9:42am UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/11 "2023-07-23T09:42:58Z")

</div>

Agree. You can update documentation and post PR. It is never ending work in progress like most open source projects.

---

<div class="post-metadata">

**Author:** ![Andrei](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Andrei](https://kopia.discourse.group/u/Andrei)\
**Post date:** [July 23, 2023, 9:51am UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/12 "2023-07-23T09:51:53Z")

</div>

I understand and approve of the open source movement, but to my shame the git is rocket-science for me. ☹

And thanks again for the replies.

---

<div class="post-metadata">

**Author:** ![97b4958b055b](https://avatars.discourse-cdn.com/v4/letter/9/47e85d/32.png) [@97b4958b055b](https://kopia.discourse.group/u/97b4958b055b)\
**Post date:** [April 26, 2025, 12:21pm UTC](https://kopia.discourse.group/t/i-deleted-my-repository-config-while-kopiaui-runnig/2172/13 "2025-04-26T12:21:05Z")

</div>

**It is wrong behavior.** More specifically it is wholly unexpected behavior resulting in data loss (the conf file) and deeply symptomatic of abysmally poor architecture/design, quality control.

> [@kapitainsky](#):
>
> When you use UI only then it does it for you, when you use cmd it is your responsibility.

QED… & yet another indication of a lack of any attention to feature parity.

_TWO YEARS LATER_ and this is _still_ an issue.

> [@Bug: v0.19.0: CLI/GUI/AppImage: repository.config Over-writes Without Warning](https://kopia.discourse.group/t/bug-v0-19-0-cli-gui-appimage-repository-config-over-writes-without-warning/3899/9):
>
> So the esteemed minds behind Kopia didn’t bother to write a conditional check against an existing repository.conf & autogen a repository-N.config. Spectacular. Apparently end users are expected to know beforehand that conf files will be over written unless using --config-file during kopia repo create. I’ve successfully connected three file system repos all under the same volume. Here’s a template: # define conf="$HOME/.config/kopia/fs-000-repo.config" passwd="secret" path="/media/usb-drive/ko…
