Home > SQL Server Tips > Database Administrator > How to restore SQL Server database to transition server during upgrade
SQL Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DATABASE ADMINISTRATOR

How to restore SQL Server database to transition server during upgrade


Matthew Schroeder
06.18.2008
Rating: --- (out of 5)


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


This is part two in a series of articles describing the case history of a database upgrade from SQL Server 2000 Active/Active cluster running on Window 2000 Server to a Windows Server 2003/SQL Server 2005 Active/Active cluster. Consultant Matthew Schroeder will walk you through the technical and decision-making process of real-world IT and database management teams. The article is based on two online upgrades: a commercial website and an eBay ordering system. For confidentiality reasons, certain details of the actual project have been changed.

In part one of this series, you learned about the team involved in this case study and about the pros and cons of available upgrade options. Now that we've chosen our upgrade strategy, the next task is to actually transition to a temporary server to run the application while we upgrade the local SQL Server cluster. We'll do this in four stages.

Stage 1: Our application flows to the local Active/Active SQL Server 2000 cluster.

Application flows to SQL Server 2000 cluster.
Figure1: Application flows to SQL Server 2000 cluster.

Stage 2: We need to build a second (transition) server and then move the SQL Server 2000 database to it. We can accomplish this step through replication, log shipping or by restoring a database to the transitional server and finally restoring the "tail-end" transaction log to the transitional server while the application is offline. The option we chose was to "restore the database to the transitional server." That way, our application would only need to be offline during the time required to back up the tail-end of the transaction log, copy it to the transitional server and the time it takes to restore the transaction log to the transitional server (Figure 2). We limit downtime because, while the application is running on the transitional server, the local Active/Active cluster is rebuilt with Windows Server 2003/SQL Server 2005.

Restoring a database to the transitional server.
Figure 2: Restoring a database to the transitional server.

Stage 3: We'll move from the transitional server back to the local Active/Active cluster rebuilt to Windows Server 2003/SQL Server 2005. This stage is a lot like Stage 1, only we're moving the database back to the local server and we can now access SQL Server 2005 technologies. We can choose from backup/restore, log
More on SQL Server upgrades and availability:
  • Active/Active clusters in SQL Server
  • Top 10 new features in SQL Server 2005
  • Pointers for SQL Server parallel upgrades
  • shipping, replication -- and now that we're on SQL Server 2005 -- database mirroring.

    If we used log shipping and replication to move back to the local cluster, there would be a chance for the local boxes to be tampered with during transition – even if we were careful with security. We don't want to risk the database on the transitional server getting out of sync with the local database we're prepping. Backup/restore is also an option, but that requires minimal downtime while the "tail-end" transaction log backs up, copies and restores. Since we now have SQL Server 2005 available, we can use database mirroring to transition to the local cluster without any downtime. Because the mirror is always in recovery mode, we're not concerned with the local database becoming out of sync with the database on the transitional server.

    Database mirroring is in recovery mode.
    Figure 3: Database mirroring is in recovery mode.

    Stage 4: We switch the database mirroring so that the local Active/Active cluster is the primary server and the transitional server is the secondary. At this point the application (assuming we're running VS 2005+ MDAC) will automatically point at the new primary server.

    Application traffic points to your new SQL Server.
    Figure 4: Application traffic points to your new SQL Server.

    Note: If you are not using the latest copy of MDAC, you will have to modify the connection strings to point to the new primary server. The applications should run fine at that point.

    Using the transitional server for your upgrade to SQL Server 2005 and Windows Server 2003 is a fairly detailed process and is your best option if you simply cannot afford the luxury of being down for several hours. The sequence of steps is absolutely critical and full of small "features" that can trip you up.

    In part three of this series, I'll take you through the general concept of minimizing downtime and the considerations you need to take into account.


    Upgrading Active/Active cluster to Windows Server 2003/SQL Server 2005

     Part 1: Team composition and upgrade option pros and cons
     Part 2: Restoring a SQL Server database to a transition server
     Part 3: SQL Server high availability when upgrading to SQL Server 2005
     Part 4: Upgrade live applications to SQL Server 2005 for high availability
     Part 5: Monitor database mirroring and replication after upgrade

    ABOUT THE AUTHOR:   
    Matthew Schroeder is a senior software engineer working on SQL Server database systems, ranging in size from 2 GB to 3+ TB, with between 2k and 40+k trans/sec. Matt currently works for the gaming vendor, IGT, providing services to gaming companies. He also works as an independent consultant, specializing in SQL Server, Oracle and .NET for industries such as gaming, automotive, e-commerce, entertainment, banking and non-profit. Matt specializes in OLTP/OLAP DBMS systems as well as highly scalable processing systems written in .NET. He is a Microsoft certified MCITP, Database Developer, has a master's degree in Ccomputer Sscience and more than 12 years of experience in SQL Server/Oracle. He can be reached at cyberstrike@aggressivecoding.com.


    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.




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


    RELATED CONTENT
    SQL Server upgrade and migration
    SQL Server consolidation: Why it's an optimization technique
    Should you upgrade to SQL Server 2005 or SQL Server 2008?
    Monitor database mirroring and replication after a SQL Server upgrade
    Upgrade live applications to SQL Server 2005 for high availability
    SQL Server high availability when upgrading to SQL Server 2005
    Top 10 SQL Server Integration Services (SSIS) and DTS tips
    Upgrade Active/Active cluster to SQL Server 2005 and Windows 2003
    FAQ: SQL Server databases how-to
    Upgrading to SQL Server 2008 advantages and hardware requirements
    Create an upgrade plan for your move to SQL Server 2005

    SQL Server availability
    Licensing a standby server for SQL Server replication
    Get SQL Server log shipping functionality without Enterprise Edition
    Monitor database mirroring and replication after a SQL Server upgrade
    Upgrade live applications to SQL Server 2005 for high availability
    SQL Server high availability when upgrading to SQL Server 2005
    Tutorial: Migrating to SANs from local SQL Server disk storage
    SQL Server memory configurations for procedure cache and buffer cache
    Upgrade Active/Active cluster to SQL Server 2005 and Windows 2003
    SQL Server backups using SAN database snapshots
    Tips for moving from SQL Server local disk storage to SANs
    SQL Server availability Research

    SQL Server installation
    SQL Server consolidation: Why it's an optimization technique
    SSIS error message due to installation problem on SQL Server 2005
    Get SQL Server log shipping functionality without Enterprise Edition
    How to create a SQL Server linked server to DB2
    Tuning SQL Server performance via disk arrays and disk partitioning
    Virtual database storage for SQL Server: Friend or foe?
    Tutorial: Migrating to SANs from local SQL Server disk storage
    Storage area network (SAN) basics every SQL Server DBA must know
    Tips for moving from SQL Server local disk storage to SANs
    SQL Server 2005 log shipping setup using the wizard
    SQL Server installation Research

    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

    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.

    HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




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