github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/enterprise/state/resolving-conflicts.html.md (about)

     1  ---
     2  layout: "enterprise"
     3  page_title: "Resolving Conflicts - State - Terraform Enterprise"
     4  sidebar_current: "docs-enterprise-state-resolving"
     5  description: |-
     6    Resolving conflicts with remote states.
     7  ---
     8  
     9  # Resolving Conflicts in Remote States
    10  
    11  Resolving state conflicts can be time consuming and error prone, so it's
    12  important to approach it carefully.
    13  
    14  There are several tools provided by Terraform Enterprise to help resolve
    15  conflicts and fix remote state issues. First, you can navigate between state
    16  versions in the changes view of your environment (after toggling on the remote
    17  state checkbox) and view plain-text differences between versions.
    18  
    19  This allows you to pinpoint where things may have gone wrong and make a educated
    20  decision about resolving the conflict.
    21  
    22  ### Rolling Back to a Specific State Version
    23  
    24  The rollback feature allows you to choose a new version to set as the "Head"
    25  version of the state. Rolling back to a version means it will then return that
    26  state upon request from a client. It will not increment the serial in the state,
    27  but perform a hard rollback to the exact version of the state provided.
    28  
    29  This allows you to reset the state to an older version, essentially forgetting
    30  changes made in versions after that point.
    31  
    32  To roll back to a specific version, navigate to it in the changes view and use
    33  the rollback link. You'll need to confirm the version number to perform the
    34  operation.
    35  
    36  ### Using Terraform Locally
    37  
    38  Another way to resolve remote state conflicts is by manual intervention of the
    39  state file.
    40  
    41  Use the [`state pull`](/docs/commands/state/pull.html) subcommand to pull the
    42  remote state into a local state file.
    43  
    44  ```shell
    45  $ terraform state pull > example.tfstate
    46  ```
    47  
    48  Once a conflict has been resolved locally by editing the state file, the serial
    49  can be incremented past the current version and pushed with the
    50  [`state push`](/docs/commands/state/push.html) subcommand:
    51  
    52  ```shell
    53  $ terraform state push example.tfstate
    54  ```
    55  
    56  This will upload the manually resolved state and set it as the head version.