Skip to content

Instantly share code, notes, and snippets.

@bjonord
Created July 4, 2019 08:00
Show Gist options
  • Save bjonord/7d72e298c41ee21766045812ef906712 to your computer and use it in GitHub Desktop.
Save bjonord/7d72e298c41ee21766045812ef906712 to your computer and use it in GitHub Desktop.
# Get a local copy of the destination project state
cd project_dest
terraform state pull > remote.tfstate
# Move from the SRC project to the DEST project
cd ../project_src
terraform state mv \
-state-out=../project_dest/remote.tfstate \
module.XYZ module.XYZ
# Push the local file to your remote backend (eg S3)
cd ../project_dest
terraform state push remote.tfstate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment