Skip to content

Commit b42f27a

Browse files
authored
thomasgauvin: add docs for rename kv namespace command in wrangler (#23693)
1 parent f6cb2f8 commit b42f27a

File tree

1 file changed

+41
-0
lines changed
  • src/content/partials/workers/wrangler-commands

1 file changed

+41
-0
lines changed

src/content/partials/workers/wrangler-commands/kv.mdx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,47 @@ Deleting namespace 15137f8edf6c09742227e99b08aaf273
144144
Deleted namespace 15137f8edf6c09742227e99b08aaf273
145145
```
146146
147+
<AnchorHeading title="`rename`" slug="kv-namespace-rename" depth={3} />
148+
149+
Rename a KV namespace.
150+
151+
```txt
152+
wrangler kv namespace rename {<NAME>|--namespace-id=<NAMESPACE_ID>} --new-name=<NEW_NAME> [OPTIONS]
153+
```
154+
155+
- `NAME` <Type text="string" /> <MetaInfo text="optional" />
156+
- The current name (title) of the namespace to rename.
157+
- `--namespace-id` <Type text="string" />
158+
- The ID of the namespace to rename.
159+
- `--new-name` <Type text="string" /> <MetaInfo text="required" />
160+
- The new name for the namespace.
161+
- `--env` <Type text="string" /> <MetaInfo text="optional" />
162+
- Perform on a specific environment.
163+
164+
<Render file="wrangler-commands/global-flags" product="workers" />
165+
166+
The following is an example of renaming a KV namespace called `MY_KV` to `MY_RENAMED_KV` using the current name.
167+
168+
```sh
169+
npx wrangler kv namespace rename "MY_KV" --new-name="MY_RENAMED_KV"
170+
```
171+
172+
```sh output
173+
Renaming KV namespace f7b02e7fc70443149ac906dd81ec1791 to "MY_RENAMED_KV".
174+
✨ Successfully renamed namespace to "MY_RENAMED_KV"
175+
```
176+
177+
The following is an example of renaming a KV namespace using the namespace ID.
178+
179+
```sh
180+
npx wrangler kv namespace rename --namespace-id=f7b02e7fc70443149ac906dd81ec1791 --new-name="MY_RENAMED_KV"
181+
```
182+
183+
```sh output
184+
Renaming KV namespace f7b02e7fc70443149ac906dd81ec1791 to "MY_RENAMED_KV".
185+
✨ Successfully renamed namespace to "MY_RENAMED_KV"
186+
```
187+
147188
## `kv key`
148189
149190
Manage key-value pairs within a Workers KV namespace.

0 commit comments

Comments
 (0)