# Grain.MigrateOnIdle

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.grain/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.grain/methods/)

[Source](https://github.com/dotnet/orleans/blob/b7a9e3e1c9c54b3cec3a467c5734bf7744541bcf/src/Orleans.Core.Abstractions/Core/Grain.cs#L131-L133)

```csharp
protected void MigrateOnIdle()
```

Starts an attempt to migrating this instance to another location. Migration captures the current [RequestContext](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.requestcontext/), making it available to the activation's placement director so that it can consider it when selecting a new location. Migration will occur asynchronously, when no requests are executing, and will not occur if the activation's placement director does not select an alternative location.
