# Auto migration on Update User via Management API

**URL:** <https://community.auth0.com/t/auto-migration-on-update-user-via-management-api/40445>\
**Category:** Get Help\
**Tags:** migrate-users, management-api, auth0\
**Created:** [April 3, 2020, 6:59am UTC](https://community.auth0.com/t/auto-migration-on-update-user-via-management-api/40445 "2020-04-03T06:59:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruce.mccowan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bruce.mccowan/32/20275_2.png) [@bruce.mccowan](https://community.auth0.com/u/bruce.mccowan)\
**Post date:** [April 3, 2020, 6:59am UTC](https://community.auth0.com/t/auto-migration-on-update-user-via-management-api/40445/1 "2020-04-03T06:59:37Z")

</div>

I’m trying to get auto-migration set up and working for my Auth0 Connection. I have the Login and GetUser scripts inserted, and have verified that on login users are migrated correctly - including some rules to handle RBAC assignments since you don’t provide that out of the box.

The trouble I am having is that my application has 2 sides - a public website and a back-end customer management tool. Using this back-end tool we can update a customer’s profile data (name, email, etc). When doing so I use the .Net Auth0 Management API to fire an UpdateUser request (/api/v2/users/{id}). Your docs seem to indicate that calls to update a user’s email address or username would trigger auto migration, but I can see these are deprecated and replaced by UpdateUser. However when I run that call I get a “User does not exist” error, and can see that there was no attempt to fire my GetUser script.

Is there anything I can do to force the Management API to trigger migration on user updates. My only other option is to try and handle this error so I still update to my existing DB and then wait to migrate users only when they log in or change password. I feel this approach would be dangerous.

Any help appreciated.

---

<div class="post-metadata">

**Author:** ![lucas.sonich](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lucas.sonich/32/17240_2.png) [@lucas.sonich](https://community.auth0.com/u/lucas.sonich)\
**Post date:** [April 3, 2020, 3:14pm UTC](https://community.auth0.com/t/auto-migration-on-update-user-via-management-api/40445/2 "2020-04-03T15:14:36Z")

</div>

Hello! Welcome to our community.

We would need more information to understand your case.

- What kind of connection do you have?
- What do you mean for “auto-migration”?

Thanks.

---

<div class="post-metadata">

**Author:** ![bruce.mccowan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/bruce.mccowan/32/20275_2.png) [@bruce.mccowan](https://community.auth0.com/u/bruce.mccowan)\
**Post date:** [April 4, 2020, 11:52pm UTC](https://community.auth0.com/t/auto-migration-on-update-user-via-management-api/40445/3 "2020-04-04T23:52:35Z")

</div>

Sorry, I’ve been so deep in this for the week I thought that would be implied by the question.

I’m using a Database connection with the option to use my own custom database. I have enabled the option to import users to Auth0 (Authomatic migration). As such i have configured the Login and GetUser scripts. I have verified that the Login script and migration works.

This document ([Configure Automatic Migration from Your Database](https://auth0.com/docs/users/guides/configure-automatic-migration)) suggests that GetUser should be fired when the Management API receives a request to update a User’s profile - this is not happening in my case.

Any help would be appreciated

---

<div class="post-metadata">

**Author:** ![svickers](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/svickers/32/12856_2.png) [@svickers](https://community.auth0.com/u/svickers)\
**Post date:** [October 15, 2020, 11:08pm UTC](https://community.auth0.com/t/auto-migration-on-update-user-via-management-api/40445/4 "2020-10-15T23:08:59Z")

</div>

Were you ever able to figure this out? We are running into the same problem.
