# \[v0.8.10\] Simple File Versioning

**URL:** https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259
**Category:** Announce
**Created:** [May 25, 2014, 6:59pm UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259 "2014-05-25T18:59:16Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [May 25, 2014, 6:59pm UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/1 "2014-05-25T18:59:16Z")

</div>

Version 0.8.10 brings “Simple File Versioning”. It can be enabled among the repo settings:

![](https://forum.syncthing.net/uploads/default/33/027f0658e4bddde3.png)

When enabled, each time syncthing replaces or deletes a file the old version will be moved into a directory called `.stversions` in the same directory as the file. The file name will have a date stamp (YYYYmmdd-HHMMSS) appended to it. Only the latest _N_ versions are kept, with _N_ being the value set in the config.

Given a file `repoRoot/foo/bar` to be replaced, it would be moved to `repoRoot/foo/.stversions/bar~20140525-211000`. If there were already _N_ versions of `bar` in `.stversions`, the oldest would be removed.

The `.stversions` directory will not be synced to other nodes.

Note that versioning does _not_ apply to changes you make to files locally. Versioning only applies to changes done by _syncthing_ as a result of changes announced by other nodes.

If this versioning scheme does not fulfill your needs (needs vary, and it will certainly not suit everyone), you are able to implement your own (given some knowledge of programming in Go):

> [@Implementing new versioning schemes](http://forum.syncthing.net/t/implementing-new-versioning-schemes/260):
>
> The first versioning scheme is “Simple File Versioning”. It’s useful on its own but also serves as a template for how to implement new versioning schemes. The versioning stuff is modular and can be extended simply by adding new types that implement the Versioner interface. To start out, simply copy the file [https://github.com/calmh/syncthing/blob/master/versioner/simple.go](https://github.com/calmh/syncthing/blob/master/versioner/simple.go) to a new file in the same directory. You will need to rename the type and constructor functions and modify the code in init…

---

<div class="post-metadata">

### Author: ![jedie](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jedie](https://forum.syncthing.net/u/jedie)
#### Post date: [May 26, 2014, 6:33am UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/2 "2014-05-26T06:33:27Z")

</div>

Great! One of my favourites missed feature!

I think it should be enabled by default! HDD space is cheap and better to have some “backups” than more fee space.

---

<div class="post-metadata">

### Author: ![jpjp](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@jpjp](https://forum.syncthing.net/u/jpjp)
#### Post date: [May 26, 2014, 6:26pm UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/3 "2014-05-26T18:26:36Z")

</div>

hdd space might be cheap, but ssd space is very expensive

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [May 27, 2014, 6:12am UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/4 "2014-05-27T06:12:58Z")

</div>

I’ll let the guiding principle here be to avoid surprises as far as possible. Creating new directories and files and stuff all over the place is more surprising than not doing it, unless it was asked for explicitly. 🙂

---

<div class="post-metadata">

### Author: ![jedie](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jedie](https://forum.syncthing.net/u/jedie)
#### Post date: [May 27, 2014, 6:59am UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/5 "2014-05-27T06:59:38Z")

</div>

My opinion: It’s better to create backups than to loose something. We have a protection in the case:

1. The user accidentally deleted something.
2. syncthing has a bug.

IMHO safety fist: Enable file versioning by default. Experts can simply disable it if needed. Why we have everywhere a Trash for deleted files by default?

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [May 27, 2014, 10:16am UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/6 "2014-05-27T10:16:58Z")

</div>

It’s debatable in either direction and boils down to opinion. In this case, the default stays off. It’s anyway not something that should be changed in a patch release (even introducing the feature is borderline, but hey, 0.x!).

---

<div class="post-metadata">

### Author: ![jablan](https://forum.syncthing.net/user_avatar/forum.syncthing.net/jablan/32/5295_2.png) [@jablan](https://forum.syncthing.net/u/jablan)
#### Post date: [May 27, 2014, 11:03am UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/7 "2014-05-27T11:03:19Z")

</div>

IMO the name of the option is a bit misleading (at least for the casual user). “Simple versioning” implies that there is a non-simple versioning which is going on by default, and which is somehow _simplified_ by turning this option on. At least it should be clarified that by default there is no file versioning whatsoever. Perhaps drop “simple” from the name altogether.

---

<div class="post-metadata">

### Author: ![jpjp](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@jpjp](https://forum.syncthing.net/u/jpjp)
#### Post date: [May 27, 2014, 8:37pm UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/8 "2014-05-27T20:37:01Z")

</div>

A casual user won’t be reading that though…

---

<div class="post-metadata">

### Author: ![jedie](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jedie](https://forum.syncthing.net/u/jedie)
#### Post date: [May 28, 2014, 8:07am UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/9 "2014-05-28T08:07:05Z")

</div>

> [@jablan](#):
>
> “Simple versioning” implies that there is a non-simple versioning which is going on by default, and which is somehow simplified by turning this option on.

I am also agree with you.

> [@jablan](#):
>
> Perhaps drop “simple” from the name

Have i done with:

[https://github.com/calmh/syncthing/pull/305](https://github.com/calmh/syncthing/pull/305)

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [May 28, 2014, 9:27am UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/10 "2014-05-28T09:27:23Z")

</div>

Merged. For the record I found it non-confusing (but then again I wrote it) and the reason for the “Simple” prefix is that I envision there fairly soon being other variants. _But_ there’s not point in preparing that which doesn’t need preparing, and when that time comes the widget will be something like a radio button selecting between “No Versioning” / “Simple File Versioning” / “Super Duper Versioning” etc.

---

<div class="post-metadata">

### Author: ![jedie](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jedie](https://forum.syncthing.net/u/jedie)
#### Post date: [June 16, 2014, 9:51am UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/11 "2014-06-16T09:51:37Z")

</div>

> [@calmh](#):
>
> When enabled, each time syncthing replaces or deletes a file the old version will be moved into a directory called .stversions in the same directory as the file. The file name will have a date stamp (YYYYmmdd-HHMMSS) appended to it. Only the latest N versions are kept, with N being the value set in the config.
> 
> Given a file repoRoot/foo/bar to be replaced, it would be moved to repoRoot/foo/.stversions/bar~20140525-211000. If there were already N versions of bar in .stversions, the oldest would be removed.
> 
> The .stversions directory will not be synced to other nodes.
> 
> Note that versioning does not apply to changes you make to files locally. Versioning only applies to changes done by syncthing as a result of changes announced by other nodes.

I have add this to the unofficial FAQ: [FAQ · jedie/syncthing Wiki · GitHub](https://github.com/jedie/syncthing/wiki/FAQ#how-does-the-file-versioning-work)

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [June 23, 2015, 7:47pm UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/12 "2015-06-23T19:47:48Z")

</div>



---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [June 23, 2015, 7:47pm UTC](https://forum.syncthing.net/t/v0-8-10-simple-file-versioning/259/13 "2015-06-23T19:47:54Z")

</div>


