Blog Post

Azure SQL Blog
2 MIN READ

Database copy and move for Azure SQL Managed Instance

sasapopo's avatar
sasapopo
Icon for Microsoft rankMicrosoft
Nov 16, 2022

[Edit 11/21/2023 - Database copy and move are GA! Learn more here: aka.ms/sqlmi-dbcopymove]

 

With database copy and database move for Azure SQL Managed Instance you can perform online copy and move operations across managed instances, within Azure subscription.

[Edit 5th April 2023: video tutorial for db copy and move with TDE protector -> https://www.youtube.com/watch?v=TtRtW8OROPo]

[Edit 17th June 2023]: blog on automating db copy for a group of databases -> https://aka.ms/sqlmi-dbcopyazps]

 

If you have databases spread across multiple managed instances that are underutilized, with database move you can consolidate your databases to fewer number of instances, in an online fashion with minimal downtime. You can use this functionality to move database from highly utilized instance to another one with more resources and solve a “noisy neighbor” situation. Copy and move are also useful to move databases across your test, stage, and prod environments. For example, you can prepare a database in your staging environment, and once it’s ready, move it to a production managed instance.

 

Database copy and move work as a two-phase operation. When you start a copy or move, a source database is first seeded to a destination. Once seeding is done, within the next 24 hours, all changes from the source are replicated to destination. Within this period, you can explicitly complete the operation.

Workflow for using database move

 

This gives you precise control over the moment when the database is effectively moved. Typically, once you complete the operation, you would also change the connection string, and repoint your application from source to destination. Move operation guarantees there’s no data loss during the move!

 

An interesting question I’ve answered several times during this feature development and private preview was how database copy is different from point-in-time-restore (PITR). Point-in-time-restore gives you a copy of a database from a point in time in the past, while database copy gives you a copy of the database at the moment when the operation is completed.

 

For detailed instructions on how database copy and database move are used, see our documentation!

 

Here's also a video with short feature description and demo! 

 

We wish you happy database moves!

 

P.S. To learn more about many other managed instance announcements happening now, see this blog post.

Updated Nov 20, 2023
Version 6.0
  • Graeme_Slogrove's avatar
    Graeme_Slogrove
    Copper Contributor

    Our dev/test and production instances are in different subscriptions for security reasons.

     

    Having the ability to copy between subscriptions would be beneficial in this case.

  • Graeme_Slogrove, thanks a lot for the feedback! We've heard about this and similar scenarios. I'd love to see cross subscription db copy, too, so stay tuned! 🙂

  • Will this be available to copy/move DBs across subscriptions?

  • Hello pstonch, this is very popular ask, and we would love to enable database copy and move to work across subscriptions, but it is not yet in our short-term roadmap. As soon as we have this in private or public preview, we'll blog about it, so stay tuned 🙂

    Can you maybe tell me more about the use cases you have in mind?

  • YOUSEF HANOUN's avatar
    YOUSEF HANOUN
    Copper Contributor

    is there any option to schedule an event to trigger database copy from one instance to another instance in same subscription. like having built-in connector or REST API through logic app 

  • YOUSEF HANOUN, there is a way to use database copy and move with REST API, and Azure PowerShell and CLI are coming soon.
    We still lack documentation for REST API. I will publish this documentation soon, in the upcoming weeks (if this is for any reason urgent, ping me via email please). 

    With REST or other clients you can automate operations with any available tool.