How can I rename a project which has its state at ...
# general
How can I rename a project which has its state at I've destroyed stack resources, but when I change the name in Pulumi.yaml,
pulumi preview
doesn't list stacks anymore. If I revert name change, select stack lists correctly. How can I migrate an existing stack to use the new project name?
Tried to follow, but I can't find any relevant stacks in
. This is because I'm hosting state at
If all the stack resources are gone, then do you need the stacks? You can just
pulumi stack init ...
to create them in the new project name. You will also need to
pulumi stack rm
in the old project.
But if you want to rename a project (which works even if you haven't deleted the resources) then you can use
pulumi stack rename
There's a little comment in the help output:
You can also rename the stack's project by passing a fully-qualified stack name as well. For example:
'robot-co/new-project-name/production'. However in order to update the stack again, you would also need
to update the name field of Pulumi.yaml, so the project names match.
👍 1
Thanks a lot @little-cartoon-10569!
👍 1