Share via


Upgrading Database Projects from Previous Releases of Visual Studio

If you created a database project in an older release than Visual Studio 2010, you can upgrade that project; however, you must do so as soon as you open it. You must also perform additional tasks to upgrade any server objects in your project, and you must upgrade each data generation plan in your project separately. In addition, you must upgrade your database unit tests and any custom database unit test conditions.

Note

You should make sure that your database project is backed up before you open it in Visual Studio 2010 because you will be immediately prompted to upgrade the project. Visual Studio does not back up projects before or during the upgrade process.

Migrating .DBP Projects

You can follow a fairly simple procedure to migrate the database objects that you have defined in a .dbp project into a .dbproj database project or a Data-tier Application project. For more information, see Converting .DBP Projects into Database Projects or Data-tier Application Projects.

Upgrading Server Objects

Before you upgrade a database project that includes server objects, you should create a server project in which you will maintain those objects. As part of the upgrade, definitions for those objects are moved from your pre-deployment and post-deployment scripts into a separate script that is named Upgraded.AllServerObjects.sql. This script is not included when you build your database project.

Note

You can find Upgraded.AllServerObjects.sql in the Upgraded folder, but you might need to first open the Project menu and click Show All Files.

After the upgrade, you import the definitions from Upgraded.AllServerObjects.sql into your server project and build it. When you build the server project, the file UpgradedServerObjects.dbschema is created, and a reference to it is added to your database project. If your pre-deployment or post-deployment scripts contain statements that cannot be imported, they will not appear in UpgradedServerObjects.dbschema, and errors might appear in your database project. For more information, see Starting Team Development of Databases that Reference Shared Server Objects.

Upgrading Database Unit Tests and Test Conditions

If you created database unit tests with a previous release of Visual Studio 2010, you must upgrade them before they will build and run successfully. The names of referenced assemblies and namespaces have changed. For more information, see How to: Upgrade Database Unit Tests from Previous Releases of Visual Studio.

If your database unit tests use custom conditions, you must also upgrade them before those tests will run successfully. For more information, see How to: Upgrade a Custom Test Condition from a Previous Release.

Upgrading Data Generation Plans

If you upgrade a database project that includes one or more data generation plans, they are not upgraded until you try to open one of them. You are then prompted to upgrade the plan that you tried to open. In addition, you might encounter issues when you upgrade a data generation plan if it uses data generators that are not available in this release. For example, you might have created or used a custom data generator (such as one of those that is included as a power tool). When you upgrade such a plan, you can specify the behavior if an unrecognized data generator is found. For more information, see How to: Upgrade a Data Generation Plan from a Previous Release.

See Also

Concepts

Generating Test Data for Databases by Using Data Generators