How to move Azure SQL DB to Elastic Pool?

Kenny 1 Reputation point
2020-09-20T12:34:04.253+00:00

I have created a Elastic Pool to Azure SQL Server logical Server.

1) I have database in same Logical Server. How to move the DB under Elastic Pool?

2) I also have database in different Logical Server. How to move the DB under Elastic Pool? (Should I restore from back-up?)

3) Is it possible to move database in Elastic Pool to outside Elastic Pool in same Logical Server as Standard tier DB?

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Ronen Ariely 13,786 Reputation points Microsoft MVP
    2020-09-20T14:52:41.23+00:00

    Good day,

    1) I have database in same Logical Server. How to move the DB under Elastic Pool?

    You can do this in the Portal, Using PowerShell, or as I preferred using simple query

    ALTER DATABASE Your_DB_Name  
        MODIFY ( SERVICE_OBJECTIVE = ELASTIC_POOL ( name = Your_Pool_Name) ) ;   
    

    https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql?view=azuresqldb-current#b-moving-a-database-to-a-different-elastic-pool

    2) I also have database in different Logical Server. How to move the DB under Elastic Pool? (Should I restore from back-up?)

    Copy the database using simple query (execute it in the new server, and check the documentation for more information)...

    CREATE DATABASE Your_New_DB_Name  
      AS COPY OF Server_Name.Your_Original_DB_Name ( SERVICE_OBJECTIVE = 'Basic' );  
    

    https://learn.microsoft.com/en-us/sql/t-sql/statements/create-database-transact-sql?view=azuresqldb-current#creating-a-copy-of-a-database-on-another-server

    3) Is it possible to move database in Elastic Pool to outside Elastic Pool in same Logical Server as Standard tier DB?

    Yes, exactly like we add to a pool we can remove from the pool using the same ALTER command. Simply select a different type like BASIC for example

    ALTER DATABASE Your_New_DB_Name MODIFY (EDITION = 'Standard', MAXSIZE = 250 GB, SERVICE_OBJECTIVE = 'S0');  
    

    Same link as above in question 1

    No comments