How to deploy one project to multiple servers...

I am using the database professional to create a generic DB that I have a copy of on two different servers with the exact same database code (procedures, functions, tables, etc.) and I was wondering how I can use one project to make all my changes and then deploy those changes to each of the two servers using the deploy functionality rather then do a schema comparison for each of the different servers and then running a seperate script on each server.


Answer this question

How to deploy one project to multiple servers...

  • osama.jasser

    Sapna,

    If you click on the Build menu, you should see at the end. It is a Visual Studio option.

    - Manoj


  • JavaBoy

    Thank you much that is exactly what I wanted, I really appreciate the help.

  • .NET Developer

    Mark -

    In our initial release, our focus in on the "deploy to isolated development environment" scenario. In our discussions with DBAs, many preferred to deploy to production manually. So the short answer is: we do not have a good answer for deploying to tens or hundreds of production servers in our initial release. As we look forward, this is something we will need to consider when we provide additional support around deploying to production.

    thanks,



  • mitasid

    We have been doing some work in this area to better enable team build and scenarios like this one. On the current bits, if you want to deploy the build script to multiple servers you need to:

    * Remove the :setvar databasename ="blah" from the beginning of build script

    * Run the SqlDeploy task like the following:

    msbuild <project file name> /t:SqlDeploy /p:BuildScriptName=<Name of script> /p:TargetDatabaseName=<...> /p:TargetConnectionString=<...>

    You could also use sqlcmd to execute the script (again commenting out the :setvar) and specifying the databasename using the -v flag.



  • Andrey Makarov

    I don't have this option either and this didn't work for me.
  • Aaron Leiby

    Wei jia jun -

    I would suggest creating two build configurations, one for each target server. Then you can select each build configuration, deploy that configuration, and it will use that set of project settings, including the target server and database name.

    If you are not familiar with configurations, here is a quick how-to:

    1) Open your database project in Visual Studio 2005 Team Edition for Database Professionals.

    2) Open the Build menu and click Configuration Manager.

    3) In the Active solution configuration drop-down, click <New>.

    The New Solution Configuration dialog box appears.

    4) In Name, type the name for your first server configuration.

    5) If you had project properties already configured in the Default configuration, in the Copy settings from drop-down list, click Default.

    6) Click OK.

    7) In the Active solution configuration drop-down, click <New>.

    The New Solution Configuration dialog box appears.

    8) In Name, type the name for your second server configuration.

    9) If you had project properties already configured in the Default configuration, in the Copy settings from drop-down list, click Default.

    10) Click OK.

    11) In the Configuration Manager dialog box, click Close.

    12) Right-click your database project in Solution Explorer and click Properties.

    13) Click the Build tab.

    14) In Configuration, click the name for your first server configuration.

    15) Modify the target connection and database name to match your first server configuration.

    16) In Configuration, click the name for your second server configuration.

    17) Modify the target connection and database name to match you second server configuration.

    18) On the File menu, click Save Selected Items to save your configuration settings.

    Now you can select a configuration on the standard toolbar and build/deploy that configuration. This should make it easy to build and deploy both.

    Let us know if you have additional questions.

    thanks,



  • albidochon

    CTP5 refresh

    I dont see it either Could it be TFS permissions

    Chuck



  • alienated

    Is there a way to package the comparison engine in an executable Our database schema is part of a COTS product we supply and support. We do not have direct access to our customers databases. Additionally, not every change to the db is implemented at every location, so we do not know, when we build a script, in which state the production db is. Ideally, we would like to send them an executable, with the source controlled scripts packaged into it, that allowed the customer to perform a limited (no options not to update) version of the compare and update we perform locally using VS. We have a custom tool, but it takes significant extra time to manually update the code once we have tested the changes to the database. (Additionally, we are limited to using SQL Server 2000, because that is the platform our customer uses and they have no immediate plans to upgrade.)
  • Alek Yakovlev

    This is fine for a few servers. What approach would you use if there were tens or hundreds involved This is not academic. The last site I contracted at had exactly this problem. Luckily I don't have that problem now :-)


  • jcoburn

    I have ctp 5 insatalled ..but i don't see the Configuration Manager in the build option
  • sqlduck

    Ok we figured it out. ....

    1.You can right click on the Solution the option is there.

    Or

    2. Also if you reset Import export settings to Standard dev it reappears.

    tools->Import Export Settings

    Mine was set to BI studio instead of General Developer.

    This should work.



  • thukralz

    The method for deploying through the command line that I mentioned above will be fully supported in CTP6 (due out in a few weeks).

    For CTP5, you should be able to deploy via the MSBuild task, but the task is not as flexible. If you post the errors you are seeing with the CTP5 MSBuild task we could probably get it to work.



  • How to deploy one project to multiple servers...