Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Copying Database between different Elastic pools #3

Open
Hannimal opened this issue Feb 7, 2018 · 0 comments
Open

Error Copying Database between different Elastic pools #3

Hannimal opened this issue Feb 7, 2018 · 0 comments

Comments

@Hannimal
Copy link

Hannimal commented Feb 7, 2018

I'm Trying to copy a Database between to elastic pools, the origin is a "Premium: 125 eDTU" and the destination is a "PremiumRS: 125 eDTU". I keep getting an error: "Long running operation failed with status 'Failed'. Additional Info:'The database edition 'Premium' cannot be different than the elastic pool service tier which is 'PremiumRS'". The error is pretty clear, but i can´t seem to be able to choose the destination WidthoutElasticPool() so that i can after update to the existing Elastic pool. This is the code i'm using:

`var originSqlServer = await azure.SqlServers
.GetByResourceGroupAsync(model.Origin.ResourceGroup, model.Origin.SqlServer, ct);
var destinationSqlServer = await azure.SqlServers
.GetByResourceGroupAsync(model.Destination.ResourceGroup, model.Destination.SqlServer, ct);

var templatedb = originSqlServer.Databases.Get(model.Origin.Database);

var database = await destinationSqlServer.Databases
.Define(model.Destination.Database)
.WithExistingElasticPool(model.Destination.ElasticPool)
.WithSourceDatabase(templatedb)
.WithMode(CreateMode.Copy)
.CreateAsync(ct);

database = await database
.Update()
.WithExistingElasticPool(model.Destination.ElasticPool).ApplyAsync(ct);`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant