Export and import bots using solutions

Important

Power Virtual Agents capabilities and features are now part of Microsoft Copilot Studio following significant investments in generative AI and enhanced integrations across Microsoft Copilot.

Some articles and screenshots may refer to Power Virtual Agents while we update documentation and training content.

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

This can be useful if you use different environments for different purposes, or you employ ring-deployment methodologies. For example, you might have a specific environment where you internally test and validate bots, another environment where you test bots for only a subset of users, and a final production environment where you share bots with customers and end users.

Note

You can't export topic-level or node-level comments when you export a bot.

Prerequisites

Important

This topic contains Microsoft Copilot Studio preview documentation and is subject to change.

Preview features aren't meant for production use and may have restricted functionality. These features are available before an official release so that you can get early access and provide feedback.

If you're building a production-ready bot, see Microsoft Copilot Studio Overview.

Move your bots across environments by exporting and importing them using solutions. Exporting and importing your bots can be useful if you use different environments for different purposes or if you employ ring-deployment methodologies. For example, you might have one environment where you internally test and validate bots, another where you test bots with a subset of users, and a production environment where you share your bots with customers.

Things to know

  • You can't export topic-level or node-level comments when you export a bot.

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

    Warning

    Don't remove unmanaged bot components, such as bot topics, directly from the Power Apps portal unless you've removed the bot from the solution.

    You should only make changes to topics from Microsoft Copilot Studio. Removing or changing a bot's components from Power Apps 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.

  • If your bot has a large number of components (for example, more than 250 topics or more than 100 entities), export it using the classic Power Apps portal instead.

Note

You'll need the minimum System Customizer security roles to export and import bots using solutions. Learn more about configuring user security to resources in an environment.

Create a solution to manage export and import

You use solutions to export bots from one environment and import them into another. The solution acts as a "carrier" for the bots. You can export and import multiple bots in one solution.

  1. In Microsoft Copilot Studio, open the bot you want to export.

Note

If you are using a Classic bot, in the navigation menu select Chatbots to open the Chatbots page and view all the bots you have access to in this environment.

  1. In the navigation menu, under Settings, select Bot details, and then select Export.

    Screenshot of the Bot details settings page in Microsoft Copilot Studio, with the Export button highlighted.

Note

If you ar using a Classic bot, select the bot you want to export, then select Export chatbot.

Screenshot of the export button on teh general setting page.

  1. Select Go to Power Apps Solutions.

    Screenshot of the bot export prompt.

  2. In Power Apps, on the Solutions tab, select New solution.

    Screenshot of the Power Apps Solutions page, with the New solution button highlighted.

  3. Enter the following information for the new solution:

    Field Description
    Display name The name that's shown in the list of solutions. You can change it later.
    Name The unique name of the solution, generated from Display name. You can edit it before you save the solution, but after you save the solution, you can't change it.
    Publisher Select the default publisher or create a new one. We recommend that you create a publisher that you can use consistently across the environments where you'll use the solution. Learn more about solution publishers.
    Version Enter a number for the version of your solution. The version number is included in the file name when you export the solution.
  4. Select Create.

Add your bot to the solution

  1. The solution you created should be open. If it isn't, select it in the list of solutions.

  2. Select Add existing, and then select Chatbot.

  3. In the Add existing chatbots list, select the bot or bots you want to export, and then select Add.

Note

The following applies to Classic bots.

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

    Screenshot showing the Remove from this solution button.

Note

Removing a bot from a solution doesn't remove its components from a solution. Removal of the components should be done separately.

Warning

Don't remove any unmanaged chatbot subcomponents (such as bot topics) directly from the Power Apps portal, unless you have removed the bot itself from the solution.

You should only make changes to topics from within the Microsoft Copilot Studio portal.

Removing or changing the chatbot subcomponents from within Power Apps will cause the export and import to fail.

Export the solution with your bot

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

Important

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

  1. In the Power Apps Solutions page, select the solution that contains your bot, and then select Export solution.

    Screenshot of the Export solution button in Power Apps.

  2. In the Before you export pane, select Next.

  3. Enter or select the following options:

    Option Description
    Version number Microsoft Copilot Studio automatically increments your solution version. You can accept the default or enter your own.
    Export as Select the package type, either Managed or Unmanaged. Learn more about managed and unmanaged solutions.
  4. Select Export.

The export can take several minutes to complete. Watch the status message at the top of the Solutions page. When the export is finished, your browser downloads a .zip file. The file name is in the format SolutionName_Version_ManagementType.zip; for example, MyBotPublisher_1.0.0.0.1_Unmanaged.zip.

Import the solution with your bot

  1. In Power Apps, select the environment where you want to import your bot.

    Screenshot of selecting a Power Apps environment.

  2. In the Solutions page, make sure that no solutions are selected, and select Import solution.

    Screenshot of the Power Apps Solutions page, with the Import solutions button highlighted.

  3. In the Import a solution pane, select Browse, select the .zip file that contains the solution with your bot, and then select Next.

  4. Select Import.

  5. Wait a few moments while the import completes. View the results, and then select Close.

    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 didn't contain some required components.

  6. If your bot has user authentication enabled, you'll need to configure it again.

  7. In the Objects pane select Chatbot. Then select the bot's name to open the bot in the Microsoft Copilot Studio portal.

    Screenshot of a list of bots and environments in Microsoft Copilot Studio.

    You can also open Microsoft Copilot Studio directly and then open your bot in the environment you imported it to.

Important

  • You must publish your imported bot before it can be shared.
  • It may take up to 24 hours for your bot's icon to appear everywhere.

Add components to a chatbot in a custom solution

If you add components, such as topics or flows, to your bot in Microsoft Copilot Studio, you'll also need to add them to the bot in your unmanaged solution.

  1. Open your solution in the Power Apps portal.

  2. Select Chatbots, and then select your bot in the list.

  3. Select Commands (), select Advanced, and then select +Add required objects.

    Screenshot highlighting the Add required components option under the Commands menu in Power Apps.

Upgrade or update a solution with a chatbot

Learn how to upgrade or update a solution.

Remove an unmanaged layer from a managed chatbot

Managed and unmanaged solutions exist at different levels in a Microsoft Dataverse environment. To learn more, go to Solution layers.

When you edit a managed component, such as a topic or a flow, it gets an unmanaged "Active" layer. To show the latest updates after you deploy the solution, you'll need to remove that layer.

Use the See solution layers option to see all solutions that a component is a part of. You can also see one "Active" solution on top of all other solutions if you've changed something directly.

  1. Open your solution in the Power Apps portal.

  2. Select Chatbots, and then select your bot in the list.

  3. Select Commands (), select Advanced, and then select See solution layers.

    Screenshot highlighting the See solution layers option under the Commands menu in Power Apps.

  4. In the Solution Layers page, select the unmanaged layer, and then select Remove unmanaged layer.