|
|
|
BROWSE
All Titles WordPress Web Services SOA BPEL Web Graphics & Video Web Development RAW Portugues, Espanol, Italiano, French PHP/MySQL Oracle Open Source Networking & Telephony Moodle Microsoft & .NET Linux Servers jQuery Joomla! JBoss Java e-Learning e-Commerce Dynamics Drupal CRM Cookbook Content Management Beginner Guides Architecture and Analysis AJAX Future Titles Recently Published Titles BOOK ![]() Microsoft AJAX Library Essentials: Client-side ASP.NET AJAX 1.0 Explained See More See More |
Moving a Database from SQL Server 2005 to SQL Server 2008 in Three Steps
IntroductionThere are several options if one wishes to move a database from a SQL Server 2005 to SQL 2008 Server. First of all there is a 'Copy Database Wizard' in SQL 2008 Server which is meant for transferring a database from any version of SQL Server 2000 and above to 2008 version. This Wizard can operate in two ways. In the first option it can attach a database (even one on the network) and uses the SQL 2008 SQL Server agent. The Copying of the database is implemented by an Integration Services package to run as a SQL Server Agent job that is scheduled to run immediately or according to some configurable schedule. This will therefore depend on correctly configuring the SQL Server Agent. In order to use the attach / detach process, the remote server will be stopped and if the database / log files are on a shared drive they are correctly brought in by the wizard. In the other option the database will be copied using the SQL Server Management Program for which the source database need not be stopped. However this is slower than the previous method and would also require the SQL Server Agent since a package has to be run. An option which works without too much hassles is manually detaching and attaching the database/log files. In this step-by-step (really two steps) tutorial, this simple procedure is described. If you are just interested in taking a small database from 2005 to 2008 server the author strongly recommends this procedure. Interested readers may also want to read my other popular article Moving Data from SQL Server 2000 to SQL Server 2005 Step 1: Detaching the DatabaseHighlight the database you want to transfer in the Databases node in the SQL Server Management Studio as shown in the next figure. Right click this database as shown and click on Detach... Make sure the database is running (notice the green arrow for HodentekSQL Express which is a junior version of SQL 2005).
This brings up the Detach Database window as shown. Place a check mark for 'Drop' as shown and click on OK. This removes the 'Pubs' node from the Databases folder in the SQL Server Management Studio (You may need to attach it again). With this accomplished you can physically move the files or do what you want with them.
Step 2: Copy the DATA / LOG FilesCopy the pubs.mdf and pubs.ldf files to a location on the C: drive of the machine on which SQL 2008 Server is installed. Beginners Guide to SQL Server Integration Services Using Visual Studio 2005
Step 3: Attaching the DatabaseIn the SQL Server Management Studio, right click the databases node and choose Attach... pick list item as shown in the following figure.
This pops-up the Attach Databases window as shown in the next figure.
Click on the Add button. This brings up a Locate Database Files folder / file browser window. Locate the files you placed in Step 2. In this tutorial example, the files were placed in the location shown in the next figure.
Click open the folder which contains the DATA /LOG files and highlight the MDF file. Now click on the OK button. This brings in the file information into the Attach Databases window. Although you just chose the MDF file, the LDF file is automatically brought in as well.
Now click on the OK button in the Attach Databases window. Within a few seconds the pubs database appears in the databases folder of the SQL 2008 server. Expand the pubs node and verify the objects as shown in the next figure. Learning SQL Server 2008 Reporting Services
Some Transferred ObjectsSome of the objects copied over are shown in the next paragraphs. The figures show only portions of their contents. Tables![]() Stored Procedures![]() Users![]() SummaryThe simple procedure outlined in this tutorial is adequate if you need to transfer databases from MS SQL Server 2005 to MS SQL Server 2008. If you need to selectively transfer logins, or choose objects to transfer perhaps the Copy Database Wizard may be better suited. In order to use the wizard you have to understand the security features well and be able to create an appropriate SQL Server Agent proxy. This will be described in detail in a future article at this site. Oracle SQL Developer 2.1
About the AuthorDr. Jay Krishnaswamy is a graduate of the Indian Institute of Science, Bangalore writes on database and web development related topics to several computer programming related web sites. He is an active participant in several forums and discussion groups. Before working in the IT industry as a Microsoft Certified Trainer and a Siebel Certified consultant he taught at several institutes of technology and universities in India, Australia, Brazil and the USA. Links to his articles may be found at his web site or the blog. He lives in Plainsboro, NJ, USA and may be reached at jkrishnaswamy@comcast.netBooks from Packt
Wednesday, January 23, 2008 | Microsoft & .NET
SQL 2008 server is the latest in the line of Microsoft database servers and this article by Dr. Jayaram Krishnaswamy discusses the challenges one may face in installing the Developer version of this product which was released in November 2007. On a virgin machine the software probably installs without a hitch but with a history of installs, especially of the earlier versions it is anything but a joy ride. "It is almost always true for most of the software I have installed, not necessarily limited to Microsoft. However, most of Microsoft products need entry in the Window's registry and it is almost certain that one has to follow a certain protocol if one wishes to have a successful install. In fact the unsuccessful install flags out what went wrong while the initial steps do verify the requirements during installation. Despite this help and warnings one may face problems simply because it is not possible to foresee all possible combinations of hardware, software, user created error issues at launch time of the product. Again this article does not guarantee a successful install if one were to follow the steps delineated but gives you some guidance based on the author's experience." See More |
TOP TITLES ![]()
BOOK ![]() Visual SourceSafe 2005 Software Configuration Management in Practice See More BOOK ![]() PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and Ajax See More |
| ||||||||