I'm trying to move my stack from 1 project to anot...
# general
I'm trying to move my stack from 1 project to another to simply the setup, but when I try to do a previiew now iit wants to delete and create all of the resources, how do i fix this?
The name of the project and the stack has changed, it was previously
for the stack, but now its
You’ll need to use aliases
I’m on phone at the moment but googling Pulumi aliases should help
Yep all the resource URNs contain the project and stack name, so they are all different now. I believe you can get the current URNs with
pulumi stack --show-urns
and then manually add
aliases: [<the old URN>]
to every resource. it’s a slow & painstaking process if you have a lot of resources and/or abstractions like component resources, but you should be able to get there 🙂
a friendly tip though: do this BEFORE you try to change any of the actual resources, or you’ll probably get burned like I did here https://pulumi-community.slack.com/archives/C84L4E3N1/p1620756393016100
(I spent four hours fixing the mess I made, including reverting all changes to my (fortunately backed-up) stack file twice 😅)
I went through and did a find replace on the stack for the URN to match what it would be if i recreated it, that seems to have worked. Any reason for that being bad?