Performing a database move

A database move lets you use a full set of backup images to copy an existing database to a location under a different name. Database move operations can only be carried out when your selection includes a database image. This move can occur either when you directly select the database backup image, or when NetBackup finds a recovery set that contains a database backup image.

To perform a database move

  1. Browse for the backup images you want to restore.

  2. In the Restore Microsoft SQL Server Objects dialog box, expand the database instance.

  3. Select the database backup image that you want to restore.

  4. From the Scripting list, select Create a move template.

    When you create a move or partial database restore script, the capability to perform an immediate launch is disabled. You must edit the script to specify certain destination parameters.

  5. Select the restore options.

  6. Click Restore.

  7. Indicate a file name and click Save.

  8. In the Save Script As dialog box, click Yes to open the template in Notepad.

  9. Change the database name in the template to the name of the database to restore to.

    For example, replace:

    #  Replace the database name in the following line with the name of the database that 
    you 
    #  want to move to. Also remove the hash mark <#> which precedes the keyword 
    <DATABASE>.
    # 
    # DATABASE "DatabaseA"
    

    with:

    #  Replace the database name in the following line with the name of the database that 
    you 
    #  want to move to. Also remove the hash mark <#> which precedes the keyword 
    <DATABASE>.
    # 
    DATABASE "DatabaseB"
    
  10. Change the path for the database files that you want to restore.

    You must uncomment at least one file. For example, replace:

    #  Replace the file path <C:\Microsoft SQL Server\MSSQL.3\MSSQL\DATA\DBA_FG1_File1.ndf>
    #  with a new file path. Also remove the hash mark <#> which precedes the keyword <TO>.
    #  The target of the MOVE keyword must be "DBA_FG1_File1". 
    MOVE  "DBA_FG1_File1"
    #TO  "C:\Microsoft SQL Server\MSSQL.3\MSSQL\DATA\DBA_FG1_File1.ndf"
    

    with:

    #  Replace the file path <C:\Microsoft SQL Server\MSSQL.3\MSSQL\DATA\DBA_FG1_File1.ndf>
    #  with a new file path. Also remove the hash mark <#> which precedes the keyword <TO>.
    #  The target of the MOVE keyword must be "DBA_FG1_File1". 
    MOVE  "DBA_FG1_File1"
    TO  "C:\Microsoft SQL Server\MSSQL.3\MSSQL\DATA\DBB_FG1_File1.ndf"
    
  11. Change the database file path.

    For example, replace:

    #  Replace the file path <C:\Microsoft SQL Server\MSSQL.3\MSSQL\DATA\DatabaseA.mdf>
    #  with a new file path. Also remove the hash mark <#> which precedes the keyword <TO>.
    #  The target of the MOVE keyword must be "DatabaseA". 
    MOVE  "DatabaseA"
    #TO  "C:\Microsoft SQL Server\MSSQL.3\MSSQL\DATA\DatabaseA.mdf"
    

    with:

    #  Replace the file path <C:\Microsoft SQL Server\MSSQL.3\MSSQL\DATA\DatabaseA.mdf>
    #  with a new file path. Also remove the hash mark <#> which precedes the keyword <TO>.
    #  The target of the MOVE keyword must be "DatabaseA". 
    MOVE  "DatabaseA"
    TO  "C:\Microsoft SQL Server\MSSQL.3\MSSQL\DATA\DatabaseB.mdf"
    
  12. Make similar changes to the template for any differential backups or transaction log backups you want to move.

  13. When you finish modifying the template, save it.

  14. To run the restore, select File > Manage script files, select the script you created, and click Start.

  15. Click Yes to launch the restore.

    To view the progress of the restore, select File > View status.

More Information

Browsing for backup images

Restore Microsoft SQL Server Objects field descriptions