简体   繁体   中英

Copy Azure Sql Database to another server

I have a SQL database hosted on Azure by using SQL Server 2014. Now, I want to make a complete copy which will run again on Azure but this time by using SQL Server 2016. I tried to script the database an create it again by executing the query on the 2016's one, but there is a problem. On the old database I have some security implemented (3-4 security certificates and the same number of encrypted columns). When I script the database, somehow these things are not included in the query, so I have to do them manually (not that this is a problem, but imagine a db where the security is not so simple). Broadly speaking, my question is how to make a full copy of the database and implement it on another (already created) azure db.

There are several ways to copy a database:

  1. Using the Copy Database Wizard

You can use the Copy Database Wizard to copy or move databases between servers or to upgrade a SQL Server database to a later version. For more information, see Use the Copy Database Wizard.

  1. Restoring a database backup

To copy an entire database, you can use the BACKUP and RESTORE Transact-SQL statements. Typically, restoring a full backup of a database is used to copy the database from one computer to another for a variety of reasons. For information on using backup and restore to copy a database, see Copy Databases with Backup and Restore .

  1. Using the Generate Scripts Wizard to publish databases

You can use the Generate Scripts Wizard to transfer a database from a local computer to a Web hosting provider. For more information, see Generate and Publish Scripts Wizard .

Taking a backup of the database and restoring it sounds like the best bet here (as Steve Newton was mentioning). I'm understanding from your question that you'd like to have a new copy of the same database on SQL Server 2016. As long as the relevant certificates and symmetric keys used to encrypt these columns are stored in the database, the backup will include them and restore them to your target instance. If the certs and keys are on physical master, you'll need to back them up separately and restore them on the new instance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM