Migrating categories from Entry to Asset
I would probably do this in two steps:

Create a twig file formatted as a CSV that outputs the category and asset id's, i.e.

AssetId, Category&lt;br&gt;
{% for entry in entries %}
{{ entry.asset.one().id }}, {% for category in categories %}{{ category.id }}{% if not loop.last %}-|-{% endif %}{% endfor %}&lt;br&gt;
{% endfor %}


Use feed me to re-import the categories onto the assets using the CSV.