Skip to main content
Knowledge Base

How do I migrate to a new folder structure using Terragrunt?

Answer

A naive copy paste causes the state file to be lost because the `relative_path_to_include` function changes due to the difference in folder paths.

You can migrate folder paths by doing the following: 1. In the old folder structure, dump out the state to a known, temporary location using `terragrunt state pull > $PATH_TO_TEMP_LOCATION` 2. Switch to the new folder structure and import the state using `terragrunt state push $PATH_TO_TEMP_LOCATION`