# Migrate or duplicate a stack

## Migrating a stack

From the menu select **Stacks** then select the stack you want to migrate.

<figure><img src="/files/QAUmjGGfuYgbzLTLVbsG" alt=""><figcaption></figcaption></figure>

In the **Stack duplication / migration** section, select the destination environment for the stack, and optionally define a new name for the stack. Click **Migrate**.

<figure><img src="/files/6Uu1pHUEI1JjYqCqGJ2V" alt=""><figcaption></figcaption></figure>

When the confirmation message appears, click **Migrate**.

<figure><img src="/files/w4SMaxeOqxg46J1R9o0q" alt=""><figcaption></figcaption></figure>

## Duplicating a stack

From the menu select **Stacks** then select the stack you want to duplicate.

<figure><img src="/files/QAUmjGGfuYgbzLTLVbsG" alt=""><figcaption></figcaption></figure>

In the **Stack duplication / migration** section, give the new stack a descriptive name then select the environment that the stack is currently on.

<figure><img src="/files/jG7yIF4Z3qgAEiXfGX77" alt=""><figcaption></figcaption></figure>

When you're ready, click **Duplicate**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.portainer.io/2.33-lts/user/docker/stacks/migrate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
