Home > SQL Server Tips > Database Management and Administration > Upgrade to SQL Server 2005 and maintain older database
SQL Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DATABASE MANAGEMENT AND ADMINISTRATION

Upgrade to SQL Server 2005 and maintain older database


Michelle Gutzait, Contributor
11.28.2006
Rating: -3.00- (out of 5)


Expert advice on database development
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


You are about to upgrade your databases from SQL Server 2000 to SQL Server 2005. You have tested everything before the upgrade and the applications have proven stable. But, you would still like to be sure that you can fall back to your old environment if any problems arise after the upgrade -- without losing any data modification.

This article highlights methods to keep databases in the old (SQL Server 2000) databases up to date until the new environment is proven to be robust.

Methods of keeping old SQL Server environment up-to-date:

In SQL Server, there are number of methods for duplicating data modifications to another database:

  1. Log shipping
  2. Copy database task
  3. Replication (Transactional, Snapshot)
  4. SQL traces
  5. Programming (Triggers, DTS, BCP, etc.)
  6. Third-party tools

Let's discuss these methods:

Log shipping
Can we log ship between a SQL Server 2005 database (primary) to a SQL Server 2000 database (secondary)...?
I tried to dig up a positive answer to this question on the Internet and had no luck. Then I tried to be creative and find a solution by myself using the standard tools that are shipped with the product. No way, Jose…I was only able to log ship from SQL Server 2000 to SQL 2005 using the WITH NORECOVERY state in the secondary database, but not the other way around. So the answer is "No," using log shipping for that is not feasible.

Copy Database
Unfortunately, when starting the Copy Database Wizard, when the Source and Destination versions are different, you will get an error message and will not be able to proceed.

Replication
Transactional replication
Transactional replication is working between the two versions. There are two problems with this solution:

  1. There are SQL Server editions that cannot participate in the replication model as PRIMARY or DISTRIBUTOR, as described in this article on SQL Server 2005 Features Comparison
  2. Tables without a defined Unique Key cannot participate in this model.
Snapshot ...

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
SQL Server Migration Strategies and Planning
New SQL Server 2008 R2 CTP set for November
PASS Summit 2009 Preview
Are data warehouses made for the cloud?
Q&A: Moving forward with SQL Server in the cloud
SQL Server Mailbag: Migrating down to Standard Edition
Microsoft releases SQL Server 2008 R2 CTP
A first look at Microsoft SQL Server 2008 R2
Using Microsoft Hyper-V for SQL Server consolidation
Migrating to SQL Server 2008 and leveraging new features
The challenges of SQL Server consolidation

Microsoft SQL Server 2005
End of life comes for SQL Server 2005 SP2, 2008
SQL Server Reporting Services Fast Guide
SQL Server Service Broker Tutorial and Reference Guide
Tips for tuning SQL Server 2005 to improve reporting performance
SQL Server consolidation: Why it's an optimization technique
Parent-child dimensions in SQL Server 2005 with Analysis Services MDX
Enforcing data integrity in a SQL Server database
SSIS error message due to installation problem on SQL Server 2005
Should you upgrade to SQL Server 2005 or SQL Server 2008?
Basics for working with DATETIME and SMALLDATETIME in SQL Server 2005
Microsoft SQL Server 2005 Research

Database Management and Administration
Meet compliance requirements with improved database security practices
Hardening the network and OS for SQL Server security
Securing the server and database in SQL Server
How SQL Server 2008 components impact SharePoint implementations
Troubleshooting Distributed Transaction Coordinator errors in SQL Server
Achieving high availability and disaster recovery with SharePoint databases
Clearing the Windows page file and its effect on server performance
Deploying a SQL Server virtual appliance for Microsoft Hyper-V
How to create SQL Server virtual appliances for Hyper-V
Push vs. pull: Configuring SQL Server replication

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
application server  (SearchSQLServer.com)
Yukon  (SearchSQLServer.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


replication

This solution works but with few exceptions. For example, if there are User-Defined-Datatypes assigned to the table and have to be created before the table is created, this will fail because there is no CREATE TYPE command in SQL 2000.

SQL traces
The workload can be captured with the SQL Server Profiler or SQL Trace and exported to SQL script. The script can run against the secondary database.

Problems with this solution include the following:

  1. Commands are executed in a serial order. If a transaction was opened or closed in a separate execution than the commands it contains, the script will not relate them since "session" is not known by the Traces.
  2. >If there are syntax differences between the versions, the execution in the secondary database will fail.

Programming
If you have a small amount of migrated databases, you may think about programming database components to transfer data modifications.

Examples:

  • Using triggers – this may affect performance since triggers are part of the transaction.
  • Using DTS or BCP to transfer data – this method can be heavy depending on the data size.
  • Third-party tools
    You can use third-party tools, such as Log Readers to read the SQL commands from the transaction log, script and then execute them in the secondary database. Also, although I couldn't find such a tool myself, there might be a tool that can backup transaction logs in SQL Server 2005 and restore them in SQL Server 2000 without problems.

    Others
    You can also be creative…
    For example, in some cases you can log ship to a secondary SQL Server 2005 database, change its compatibility level to 80 and then backup and restore it to a third database.

    Conclusion
    For critical databases, it might be a good idea to keep the old version of an upgraded database with the latest data modifications in case there's need to fallback.

    But…There is no "best solution" for that matter. You must analyze your database characteristics and structure and decide the best solution for your needs. Personally, I prefer replication for fast and reliable solution.


    ABOUT THE AUTHOR:   

    Michelle Gutzait works as a senior databases consultant for ITERGY International Inc., an IT consulting firm specializing in the design, implementation, security and support of Microsoft products in the enterprise. Gutzait has been involved in IT for 20 years as a developer, business analyst and database consultant. For the last 10 years, she has worked exclusively with SQL Server. Her skills include database design, performance tuning, security, high availability, disaster recovery, very large databases, replication, T-SQL coding, DTS packages, administrative and infrastructure tools development, reporting services and more.
    Copyright 2006 TechTarget


    Rate this Tip
    To rate tips, you must be a member of SearchSQLServer.com.
    Register now to start rating these tips. Log in if you are already a member.




    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



    SQL Server Development - .NET, C#, T-SQL, Visual Basic
    HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




    All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts