nerdexam
HashiCorp

TA-002-P · Question #402

You need to migrate a workspace to use a remote backend. After updating your configuration, what command do you run to perform the migration? Type your answer in the field provided. The text field…

The correct answer is A. terraform init. To migrate state to a new backend, you update the backend block in your Terraform configuration and then run terraform init. Terraform detects that the backend configuration has changed and prompts you to migrate the existing state to the new backend. It handles the copy of…

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

You need to migrate a workspace to use a remote backend. After updating your configuration, what command do you run to perform the migration? Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.

Options

  • Aterraform init
  • Bterraform onit

How the community answered

(66 responses)
  • A
    86% (57)
  • B
    14% (9)

Explanation

To migrate state to a new backend, you update the backend block in your Terraform configuration and then run terraform init. Terraform detects that the backend configuration has changed and prompts you to migrate the existing state to the new backend. It handles the copy of state data automatically during this process. No separate migrate command exists - terraform init handles both initialization and backend migration. Answer A is correct.

Topics

#terraform init#Remote Backend#State Management#Terraform CLI

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice