{"record":{"id":"3e3a454d0a19bcf1","repo":"pulumi/pulumi","slug":"the-current-backend-s-does-not-provide-the-abil","errorCode":null,"errorMessage":"the current backend (%s) does not provide the ability to export previous deployments","messagePattern":"the current backend \\((.+?)\\) does not provide the ability to export previous deployments","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/stack/stack_export.go","lineNumber":87,"sourceCode":"\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tvar deployment *apitype.UntypedDeployment\n\t\t\t// Export the latest version of the checkpoint by default. Otherwise, we require that\n\t\t\t// the backend/stack implements the ability the export previous checkpoints.\n\t\t\tif version == \"\" {\n\t\t\t\tdeployment, err = backend.ExportStackDeployment(ctx, s)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Check that the stack and its backend supports the ability to do this.\n\t\t\t\tbe := s.Backend()\n\t\t\t\tspecificExpBE, ok := be.(backend.SpecificDeploymentExporter)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn fmt.Errorf(\"the current backend (%s) does not provide the ability to export previous deployments\",\n\t\t\t\t\t\tbe.Name())\n\t\t\t\t}\n\n\t\t\t\tdeployment, err = specificExpBE.ExportDeploymentForVersion(ctx, s, version)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Read from stdin or a specified file.\n\t\t\twriter := cmd.OutOrStdout()\n\t\t\tif file != \"\" {\n\t\t\t\tf, err := os.Create(file)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"could not open file: %w\", err)\n\t\t\t\t}\n\t\t\t\tdefer contract.IgnoreClose(f)\n\t\t\t\twriter = f","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/stack/stack_export.go#L69-L105","documentation":"`pulumi stack export --version N` asks the backend to fetch a specific historical deployment. Only backends implementing backend.SpecificDeploymentExporter (Pulumi Cloud) can do this. When a --version is given and the stack's backend does not implement that interface, the command returns this error naming the backend (e.g. 'local'). Without --version the export works on any backend, since it exports the latest deployment from local state.","triggerScenarios":"Running `pulumi stack export --version <n>` against the local file backend (`pulumi login --local`) or any backend that lacks SpecificDeploymentExporter.","commonSituations":"Trying to recover an old deployment from a locally logged-in stack; assuming --version works everywhere because it works on Pulumi Cloud; migrated projects whose old state lived on the local backend.","solutions":["Drop --version and run `pulumi stack export` to export the current (latest) deployment instead.","Log in to Pulumi Cloud (`pulumi login`) and run the versioned export against the cloud-hosted stack.","If the old state is local, look in the backend file storage (e.g. ~/.pulumi/stacks) for historical checkpoints rather than using --version."],"exampleFix":"// before\npulumi login --local && pulumi stack export --version 3 -s dev\n// after\npulumi stack export -s dev          # latest, works on any backend\n# or: pulumi login && pulumi stack export --version 3 -s my-org/my-project/dev","handlingStrategy":"fallback","validationCode":"# only pass --version when on the Pulumi Cloud backend\nif pulumi backend | grep -qi local; then unset VERSION_FLAG; fi","typeGuard":"// Go: check the backend capability before requesting a versioned export\nbe := s.Backend()\nspecificExpBE, ok := be.(backend.SpecificDeploymentExporter)\nif !ok {\n    return fmt.Errorf(\"backend %s cannot export previous deployments\", be.Name())\n}","tryCatchPattern":null,"preventionTips":["Only use `--version` against Pulumi Cloud stacks.","Fall back to plain `pulumi stack export` for local backends.","Archive old local checkpoints manually if history is needed offline."],"tags":["cli","backend","stack-export"],"backgroundTag":"backend-not-supported","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}