Skip to content

Commit

Permalink
Merge pull request #1463 from joachimschmidt557/fix-docs-migrating
Browse files Browse the repository at this point in the history
Fix links and code blocks in migration docs
  • Loading branch information
adisbladis authored Aug 4, 2021
2 parents ba05fe5 + 9c062ec commit 8868bef
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions doc/manual/migrating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from any working directory with the ``--deployment (-d)`` parameter.
NixOps 2 however requires a file relative to the invocation working directory.
It needs to be called either ``nixops.nix`` for a traditional deployment or
``flake.nix`` for the as of yet experimental
`flakes support <https://github.com/tweag/rfcs/blob/flakes/rfcs/0049-flakes.md>`.
`flakes support <https://github.com/tweag/rfcs/blob/flakes/rfcs/0049-flakes.md>`_.

.. _sec-state-location:

Expand All @@ -32,7 +32,8 @@ make a choice where to store this state.
To implement the old behaviour of loading deployment state from the SQLite
database located in ``~/.nixops`` add the following snippet to your deployment:

::
.. code-block:: nix
{
network = {
storage.legacy = {};
Expand All @@ -41,7 +42,8 @@ database located in ``~/.nixops`` add the following snippet to your deployment:
To implement a fire-and-forget strategy use this code snippet:

::
.. code-block:: nix
{
network = {
storage.memory = {};
Expand All @@ -58,19 +60,28 @@ State migration
Migrating to any non-legacy backend from a previous deployment requires a
manual migration step.

#. Start by configuring the legacy backend as such::
1. Start by configuring the legacy backend as such

.. code-block:: nix
{
network = {
storage.legacy = {};
};
}
#. Then export the current state::
nixops export > state.json
2. Then export the current state

#. Now go ahead and configure your desired state backend.
::

$ nixops export > state.json

3. Now go ahead and configure your desired state backend.

4. And finally import the old state

::

#. And finally import the old state::
nixops import < state.json
$ nixops import < state.json

#. Make sure to remove ``state.json`` as it may contain deployment secrets.
5. Make sure to remove ``state.json`` as it may contain deployment secrets.

0 comments on commit 8868bef

Please sign in to comment.