FAQ/When do I update stateVersion: Difference between revisions

From NixOS Wiki
imported>Samueldr
Sdht0 (talk | contribs)
Fix tags
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{FAQ/breadcrumb}}{{#tweekihide:firstHeading}}<onlyinclude>
{{FAQ/breadcrumb}}<onlyinclude>
== When do I update <code>stateVersion</code> ==
== When do I update <code>stateVersion</code> ==


Line 15: Line 15:
* <em>Do NOT</em> change the <code>stateVersion</code> in the configuration; <nowiki>[it]</nowiki> tells nixos what version your state is; changing it will break the things <nowiki>[it is]</nowiki> meant to fix.<ref>https://logs.nix.samueldr.com/nixos/2017-10-18#1508341107-1508341130;</ref>
* <em>Do NOT</em> change the <code>stateVersion</code> in the configuration; <nowiki>[it]</nowiki> tells nixos what version your state is; changing it will break the things <nowiki>[it is]</nowiki> meant to fix.<ref>https://logs.nix.samueldr.com/nixos/2017-10-18#1508341107-1508341130;</ref>


</onlyinclude><noinclude><hr />
<strong>When can I update <code>stateVersion</code>?</strong>
 
When:
# You have read all [https://nixos.org/manual/nixos/unstable/release-notes.html release notes] starting from your <code>stateVersion</code>.
# You have verified all instances of <code>stateVersion</code> in the code in <tt><nowiki><nixpkgs/nixos></nowiki></tt>.
# You have made all manual interventions as required by the changes previously inventoried.</onlyinclude><noinclude>
 
== References ==
== References ==
</noinclude>
</noinclude>

Latest revision as of 22:12, 20 May 2024

When do I update stateVersion

Keep stateVersion to the version you originally installed.[1]

The system.stateVersion option is described as such:

Every once in a while, a new NixOS release may change configuration defaults in a way incompatible with stateful data. For instance, if the default version of PostgreSQL changes, the new version will probably be unable to read your existing databases. To prevent such breakage, you can set the value of this option to the NixOS release with which you want to be compatible. The effect is that NixOS will option defaults corresponding to the specified release (such as using an older version of PostgreSQL).

Frequent answers:

  • stateVersion has nothing to do with the current version of the system[2]
  • Do NOT change the stateVersion in the configuration; [it] tells nixos what version your state is; changing it will break the things [it is] meant to fix.[3]

When can I update stateVersion?

When:

  1. You have read all release notes starting from your stateVersion.
  2. You have verified all instances of stateVersion in the code in <nixpkgs/nixos>.
  3. You have made all manual interventions as required by the changes previously inventoried.

References