github.com/hugorut/terraform@v1.1.3/website/docs/cli/commands/state/push.mdx (about)

     1  ---
     2  page_title: 'Command: state push'
     3  description: The `terraform state push` command pushes items to the Terraform state.
     4  ---
     5  
     6  # Command: state push
     7  
     8  The `terraform state push` command is used to manually upload a local
     9  state file to [remote state](/language/state/remote). This command also
    10  works with local state.
    11  
    12  This command should rarely be used. It is meant only as a utility in case
    13  manual intervention is necessary with the remote state.
    14  
    15  ## Usage
    16  
    17  Usage: `terraform state push [options] PATH`
    18  
    19  This command will push the state specified by PATH to the currently
    20  configured [backend](/language/settings/backends).
    21  
    22  If PATH is "-" then the state data to push is read from stdin. This data
    23  is loaded completely into memory and verified prior to being written to
    24  the destination state.
    25  
    26  Terraform will perform a number of safety checks to prevent you from
    27  making changes that appear to be unsafe:
    28  
    29  - **Differing lineage**: If the "lineage" value in the state differs,
    30    Terraform will not allow you to push the state. A differing lineage
    31    suggests that the states are completely different and you may lose
    32    data.
    33  
    34  - **Higher remote serial**: If the "serial" value in the destination state
    35    is higher than the state being pushed, Terraform will prevent the push.
    36    A higher serial suggests that data is in the destination state that isn't
    37    accounted for in the local state being pushed.
    38  
    39  Both of these safety checks can be disabled with the `-force` flag.
    40  **This is not recommended.** If you disable the safety checks and are
    41  pushing state, the destination state will be overwritten.
    42  
    43  For configurations using
    44  [the `remote` backend](/language/settings/backends/remote)
    45  only, `terraform state push`
    46  also accepts the option
    47  [`-ignore-remote-version`](/language/settings/backends/remote#command-line-arguments).