I'm trying to move a resource between local stacks...
# general
a
I'm trying to move a resource between local stacks using this command:
pulumi state move -y --source dev --dest dev2 '$URN'
, but I'm getting an error: > error: failed to get project name of source stack
l
You're in the project directory and you're moving resources between two stacks in the same project?
a
Correct.
l
It should work the way you expect. But it's a new command, maybe you've hit a corner case. Have you tried qualifying the stack name with org and project?
a
It's a local backend; I don't have an org.
When I try
project/dev
, I get an error:
error: a stack name may only contain alphanumeric, hyphens, underscores, or periods: invalid character '/' at position 10
l
You need org/stack or org/project/stack
But that error message is saying that none of those are going to work...
a
What's the org for a local backend?
l
I forget.. I'm pretty sure they added a meta-org for local, to get around this sort of thing. But I haven't used local in years...
a
For self-managed backends, the orgName portion of the stack name must always be the constant value organization
l
Aha!
Either way it won't work, because of
/
a
Right.
l
I don't know. I'd turn the verbosity way up, see if there's a more helpful debug message. And raise an issue if you can't sort it.
a
I got it.
l
Would it be feasible to rename the stack and start the old stack again from scratch?
๐Ÿคจ
a
The state was in an old format that didn't have a project set.
l
Ooo.
How did you sort it?
a
I ran
pulumi state upgrade
, and it prompted me to set the project name.
Once I did that, the move command worked.
l
Ah. Good. That should be in a FAQ or even on the CLI doc page, for at least a while.
๐Ÿ‘ 1
a
Or maybe even have the CLI check the state version to see if it supports a project.
l
Yes, a better error message would have sorted you immediately.
๐Ÿ‘ 1