Microsoft Application Lifecycle Management in a .Net + VS + TFS using Scrum's agility by Vincent THAVONEKHAM
Bienvenue à Blogs CodeS-SourceS Identification | Inscription | Aide

Blog Agile/ALM de Vincent THAVONEKHAM

Microsoft Application Lifecycle Management in a .Net + VS + TFS using Scrum's agility by Vincent THAVONEKHAM

Actualités

  • Microsoft Application Lifecycle Management in a .Net + VS + TFS using Scrum's agility by Vincent THAVONEKHAM
[Azure] Migrez votre base SQL Server 2008 sur SQL Azure
{Mon post d'origine "Migrating your SQL Server 2008 Database to SQL Azure": http://memoprojects.blogspot.com/2012/02/azure-migrating-your-sql-server-2008.html}

They are many ways you could do to migrate your SQL Server 2008 database (SSIS bulk copy, Data Sync, dedicated tools, …). Here is one of them, that was quite painless, and free of charge (at opposed of using commercial tools).
Because the Windows Azure world is moving really fast, this method might be already out of date as you are reading !

Pre-requisites:
How-to?
  1. Let us assume you have VS 2010 and SQL Server 2008 R2, and you have an existing DB that you are happy with,
  2. Install and use “SQL Azure Migration Wizard” tool to connect to your existing database. It will generate you as T-SQL Script will errors that would occur in SQL Azure (you could find all the infringement rules alongside this CodePlex project),
  3. Modify your T-SQL accordingly to fix highlighted errors and generate a new database. Let call it DB_SQL_AZURE_COMPLIANT,
  4. Migration DONE !! (either let the tool correct for you or do it your self). This tool could even push your database (without its data) directly into SQL Azure.
    The steps after are to enable you to work in a secure manner and ensure your project is still compatible with SQL Azure, and provide a link to show how to also push your data (using BACPAC),

  5. With VS 2010, create (or use an existing) a SQL Server Data-tier Application image
  6. Reverse Engineer you SQL database into Visual Studio Database DAC project using "Import Data-tier Application...", and connect to your new DB_SQL_AZURE_COMPLIANT database
    image
  7. You will have a VS 2010 DB project that is able to generate DACPAC v2.0 deployment file (basically, it is a ZIP file that contains schema of you database, without any data. As opposed to BACPAC that is a extension of DACPAC, where a BACPAC also contains you data as JSON format). More info on DACPAC format: http://msdn.microsoft.com/en-us/library/ff719373.aspx
  8. Now you have a DB project that is most likely be able to be deployed into SQL Azure (you can be certain only once you have migrated everything). You could verify that by running again the “SQL Azure Migration Wizard” tool and deploy into SQL Azure. You now should have no errors.
  9. To double check it is really compliant, we are going to use our VM,
  10. Mount your VM and configure your network card (so you could access it vis MSTSC)
  11. Make a Snap shot of your VM (in case you want to rollback)
  12. Copy/Paste you DAC project (created with VS2010) into the VM and open it with VS11, and confirm the you want your project to be migrated into a VS11 DB project,
  13. Because you’ve done a great job correcting the T-SQL Errors, and you have great Stored procedures, views, … and no errors, you could activate ALL rules CodeAnalysis (below) with confidence !!
    Also, ensure you have a Data-tier Application (.dacpac file) checkbox is selected, and that the “Target platform” is “SQL Azure”.
    image
  14. Install Silverlight 5 add on the VM. This is because the existing one on the VM is old and will not support new SQL Azure web portal
    (generally, unless you know what you do, do not install SL5 on your DEV machine if you are working on SL4, else you would spend hours uninstalling. Indeed, it will break your SL4 dev environment)
  15. Connect to your Windows Azure web portal, and go to “Database” (this is in Silverlight 4)
    image
  16. Click “Manage” this will open the Web portal to manage SQL Azure
    image
  17. The opens a new Web portal to manage SQL Azure (in Silverlight 5)
  18. Now you could play with your newly database migrated into SQL Azure (type in plain T-SQL and run it). This web portal contains MANY MANY MANY great functionalities that you should discover ONLY progressively (because it looks nice, but a bit messy !!)
  19. The final step is to populate your database with data (simply use a T-SQL script as a quick hack). Indeed, again DACPAC only deals with schema and for data, this is done using BACPAC: http://www.4tecture.ch/blog/sql-azure-import-export-service-is-now-in-production
    But this is another story, based on other Windows Azure platform components and further CodePlex projects ! 
By the way, with a large database, I never managed to make the Microsoft “SQL Azure Compatibility Assessment” tool working. http://www.microsoft.com/en-us/sqlazurelabs/labs/sqlassessment.aspx.It seams really promising, but it always tells me that my DACPAC is of an incorrect format, and that I should use a SQL Server Data Tools (CTP4) to generate it.
But how come ?? unless my version of SQL Server Data Tools installed in my VS11 is out of date ! In which case, I must again run after the latest tool and latest news concerning Windows Azure.
Ce post vous a plu ? Ajoutez le dans vos favoris pour ne pas perdre de temps à le retrouver le jour où vous en aurez besoin :
Posted: vendredi 17 février 2012 22:56 par thavo
Classé sous : ,

Commentaires

Pas de commentaires

Les commentaires anonymes sont désactivés

Les 10 derniers blogs postés

- Simuler facilement l’envoi de mail par Blog de Jérémy Jeanson le il y a 9 heures et 15 minutes

- ProcDump 6.0 : support du filtrage sur messages d'exceptions .NET, des filtres multiples et du ciblage par nom de service par CoqBlog le 05-20-2013, 14:50

- Votez pour le TOP 10 des influenceurs SharePoint francophones ! par Le blog de Patrick [MVP SharePoint] le 05-20-2013, 12:59

- [Conf’SharePoint] Dernier rappel ! :-) par Le blog de Patrick [MVP SharePoint] le 05-20-2013, 09:09

- [ #SharePoint 2013 ] les modèles de sites standards… par Le blog de Patrick [MVP SharePoint] le 05-20-2013, 09:03

- 10 erreurs de compréhension concernant SharePoint… par Le blog de Patrick [MVP SharePoint] le 05-20-2013, 08:27

- Conf’SharePoint : 10 bonnes raisons pour ne pas la rater par Le petit blog de Pierre / Pierre's little blog le 05-14-2013, 02:24

- [Event] Soirée de lancement Agile .NET France à Lyon par Blog Agile/ALM de Vincent THAVONEKHAM le 05-13-2013, 01:29

- .NET / Debug : inspection de la mémoire d'applications .NET (dump ou processus live) : première livraison d'une librairie .NET par Microsoft par CoqBlog le 05-11-2013, 22:21

- SharePoint : Incompatibilité avec Internet Explorer 10 (IE10) par Blog Technique de Romelard Fabrice le 05-08-2013, 16:29