mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-04-11 06:01:36 -04:00
Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com> Signed-off-by: Damian Stasik <920747+damianstasik@users.noreply.github.com> Signed-off-by: Roman Grinovski <roman.grinovski@gmail.com> Co-authored-by: Damian Stasik <920747+damianstasik@users.noreply.github.com> Co-authored-by: Roman Grinovski <roman.grinovski@gmail.com>
25 lines
1.1 KiB
Plaintext
25 lines
1.1 KiB
Plaintext
---
|
|
description: >-
|
|
Learn how to restore state backups and override OpenTofu state protections to fix state errors with the OpenTofu CLI.
|
|
|
|
---
|
|
|
|
# Recovering from State Disasters
|
|
|
|
If something has gone horribly wrong (possibly due to accidents when performing
|
|
other state manipulation actions), you might need to take drastic actions with
|
|
your state data.
|
|
|
|
- [The `tofu force-unlock` command](../commands/force-unlock.mdx) can
|
|
override the protections OpenTofu uses to prevent two processes from
|
|
modifying state at the same time. You might need this if a OpenTofu process
|
|
(like a normal apply) is unexpectedly terminated (like by the complete
|
|
destruction of the VM it's running in) before it can release its lock on the
|
|
state backend. Do not run this until you are completely certain what happened
|
|
to the process that caused the lock to get stuck.
|
|
|
|
- [The `tofu state pull` command](../commands/state/pull.mdx) and
|
|
[the `tofu state push` command](../commands/state/push.mdx) can
|
|
directly read and write entire state files from and to the configured backend.
|
|
You might need this for obtaining or restoring a state backup.
|