# Migrate Python extension

**URL:** <https://community.dynatrace.com/t/migrate-python-extension/45700>\
**Category:** Extensions\
**Tags:** python, extensions\
**Created:** [May 21, 2024, 9:05am UTC](https://community.dynatrace.com/t/migrate-python-extension/45700 "2024-05-21T09:05:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nils\_Berninger](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@Nils\_Berninger](https://community.dynatrace.com/u/Nils_Berninger)\
**Post date:** [May 21, 2024, 9:05am UTC](https://community.dynatrace.com/t/migrate-python-extension/45700/1 "2024-05-21T09:05:03Z")

</div>

Hello all,

I want to migrate a custom 1.0 Python extension to the new 2.0 framework. The extension is fetching some custom metrics from a SAP HANA DB. In the python script, I am creating devices and groups via &nbsp;“self.topology\_builder”. The names for the devices and groups is coming from the UI defined via the properties and configUI section in the plugin.json file. As per migration guide ([https://developer.dynatrace.com/extensions-v2/dynatrace-extensions-vscode/guides/migrate/python-migrate/#code-conversion-reference](https://developer.dynatrace.com/extensions-v2/dynatrace-extensions-vscode/guides/migrate/python-migrate/#code-conversion-reference)) the topology\_builder method does not exist anymore in 2.0 and is replaced by extension.yaml.

Does anyone know how I can create devices and groups based on user input in UI for 2.0 extension? I assume there are some sort of placeholders I can use in the extension.yaml.

---

<div class="post-metadata">

**Author:** ![jegron](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jegron/32/12797_2.png) [@jegron](https://community.dynatrace.com/u/jegron)\
**Post date:** [May 21, 2024, 9:18am UTC](https://community.dynatrace.com/t/migrate-python-extension/45700/2 "2024-05-21T09:18:18Z")

</div>

Hi&nbsp;[@Nils\_Berninger](https://community.dynatrace.com/user/22570)&nbsp;!

In Extension 2.0, Device and Group don’t exist anymore. Now, you need to use topology rules to create custom entities:

- [Customize data with extensions — Dynatrace Docs](https://docs.dynatrace.com/docs/extend-dynatrace/extensions20/extension-customize#custom-topology)
- [Define custom topology — Dynatrace Docs](https://docs.dynatrace.com/docs/extend-dynatrace/extend-topology/custom-topology)

I recommend building it via the GUI, then exporting it via API and adding it to your YAML file.

You can also extend the Built-In Host Page with your HANA Metrics:

> **[Extend built-in unified analysis pages](https://docs.dynatrace.com/docs/ingest-from/extend-dynatrace/extend-ui/extend-unified-analysis-pages)**
>
> Extend the built-in unified analysis page with additional data ingested by your extension.
