Export and import agents using solutions

You can export and import agents using solutions so you can move your agents across multiple environments.

First, you create a custom solution and add your agent to it. Then you export the solution with your agent, and import it into another environment. You can also upgrade or update a solution with an agent, and remove an unmanaged layer from a managed agent.

See the article View and manage solutions in Copilot Studio for more details on the solution explorer in Copilot Studio.

Note

You can't export topic-level or node-level comments when you export an agent.

Prerequisites

Things to know

  • You can't export topic-level or node-level comments when you export an agent.

  • Removing an agent from a solution doesn't remove its components from the solution. You should remove the components separately.

    Warning

    Don't remove unmanaged agents components, such as agent topics, directly from the solution unless you've also removed the agent from the solution.

    You should only make changes to topics as part of the standard authoring process in the Copilot Studio UI. Removing or changing an agent's components directly from the solution will cause the export and import to fail.

  • You can't export managed solutions. When you create a solution, it's unmanaged by default. If you change it to a managed solution, you won't be able to export it. You'll need to create a new solution.

  • It isn't possible to export a solution that contains an agent with periods (.) in the name of any of its topics.

Create a custom solution and add your agent

  1. Follow the steps in Create and manage solutions in Copilot Studio to create a new solution.

  2. The solution you created should open automatically. If it doesn't, select it in the list of solutions.

  3. Select Add existing, and then select Agent, then Agent again.

  4. In the Add existing copilots list, select the agent or agents you want to export, and then select Add.

Note

For a Classic chatbot:

If you're using skills, remove the skill's environment variable Current Value by selecting Remove from this solution.

Screenshot showing the Remove from this solution button.

Removing an agent from a solution doesn't remove its components from the solution. You must remove the components separately.

Add components to an agent in a custom solution

If you add components, such as topics or flows, to your agent in Copilot Studio, you must also add them to the agent in your unmanaged solution before you export.

  1. Open the solution that contains your agent.
  2. In the Objects pane, locate your agent under Agents.
  3. Select Commands (), select Advanced, and then select Add required objects.

You should also review the instructions and requirements in the Power Apps documentation to add an existing component to a solution.

Export the solution with your agent

You export and import agent by exporting and importing the solutions that contain them from one environment to another.

Follow the instructions and requirements in the Power Apps documentation to export solutions.

Important

If your agent has a large number of components (for example, more than 250 topics or more than 100 entities), see Export using the classic experience.

Import the solution with your agent

Follow the instructions and requirements in the Power Apps documentation to import solutions.

If the import isn't successful, select Download log file to download an XML file that contains details about what caused the import to fail. The most common reason an import fails is that the solution doesn't contain some required components.

  1. Configure user authentication again.

  2. In the Objects pane, select Agents. Then select the agent's name to open the agent.

Important

Export and import agents in Teams

In Microsoft Teams, you can export and import agents between individual teams using the Power Apps Teams app.

For example, if you export a working agents from a Teams team (team A), and then import it into team B, you don't have to build it from scratch for team B.

Follow the instructions in Export customizations from Dataverse for Teams.

When selecting the customizations to export, select the agent you want to export. You can use the filter on the side pane to only show agents for a specific team.

The agent is saved to the Downloads folder on your computer.

To import in Teams, follow the instructions in Import customizations into Dataverse for Teams.

Your agent appears in the Copilot Studio app in Teams, under the team you imported it into.