Restoring the Microsoft Dynamics SL databases for troubleshooting

This article describes restoring the Microsoft Dynamics SL databases for troubleshooting.

Applies to:   Microsoft Dynamics SL 2011
Original KB number:   847681

Introduction

Technical Support for Microsoft Dynamics SL may request that you test in a copy of your production database for troubleshooting purposes.

Note

The Microsoft Dynamics SL licensing policy enables you to set up a test installation of Microsoft Dynamics SL. The test installation resembles the production environment. This installation includes the program files and the databases. Setting up a test environment requires the same storage space requirements as the production environment. The number of users in the test installation plus the number of users in the live installation cannot exceed the total number of licensed users who are permitted in the license agreement.

More information

To restore the Microsoft Dynamics databases for troubleshooting, follow these steps:

  1. Verify that the current installation and customizations are functioning correctly.

  2. Make all users exit from Microsoft Dynamics SL.

  3. Back up the Microsoft Dynamics SL system and application databases.

    For more information about how to back up SQL databases, see How to create a backup of the SQL Server database in Microsoft SQL Server 2005 and in Microsoft SQL Server 2000.

  4. Restore the databases, depending on the version of Microsoft SQL Server that you're running.

Microsoft SQL Server 2005 and Microsoft SQL Server 2008

  1. Sign in to SQL Server Management Studio.

  2. In the Object Explorer pane, expand the instance of SQL Server that hosts the Microsoft Dynamics SL databases.

  3. Right-click Databases, and then select Restore Database.

  4. In the To database box, type the new name of the database. For example, if you're restoring the system database for testing, you can type a name such as TestSystem.

  5. In the Source for restore area, select From device, and then select Browse.

  6. Select Add.

  7. In the Locate Backup File dialog box, browse to the location of your backup (.bak) file.

  8. Select the correct backup file, and then select OK.

  9. Select OK in the Specify Backup dialog box.

  10. In the Select the backup sets to restore section, select to select the Restore check box for the appropriate backup set.

  11. In the Select a page pane, select Options.

  12. In the Restore As box, confirm the location of the database files, and then select OK.

  13. Repeat steps 3 through 8 for each Microsoft Dynamics SL database that you want to restore.

  14. In the domain table in the Microsoft Dynamics SL system database, update the application database name. To do it, follow these steps:

    1. Select New Query.
    2. In the Available Databases list, select the Microsoft Dynamics SL system database, and then run the following statements:
    UPDATE COMPANY SET DatabaseName = 'XXXXXX' where DatabaseName = 'YYYYYY'
    UPDATE DOMAIN SET DatabaseName = 'XXXXXX' where DatabaseName = 'YYYYYY'
    

    Note

    Replace XXXXXX with the new name of the application database, and replace YYYYYY with the old database name.

  15. Repeat step j for each application database that is associated with the Microsoft Dynamics SL system database.

  16. Update the database views. To do it, follow these steps:

    1. Select Start, select All Programs, select Microsoft Dynamics SL (Solomon), and then select Database Maintenance.
    2. Connect to the instance of SQL Server that is hosting the Microsoft Dynamics SL databases.
    3. In the System Database Name list, select the restored Microsoft Dynamics SL system database.
    4. Under Databases, select the restored Microsoft Dynamics SL application database.
    5. Select Update Views.
    6. At the bottom of the Database Maintenance (98.290.00) window, confirm that the progress bar has finished.
    7. If you're running Microsoft Dynamics SL 2011, select Synchronize All Ownership and Security in the Update Scenarios box.
    8. At the bottom of the Database Maintenance (98.290.00) window, confirm that the progress bar has finished.
    9. Select Close.
    10. Sign in to Microsoft Dynamics SL by using the appropriate SQL Server name and the appropriate Microsoft Dynamics SL system database name.
  17. If you use the Windows Authentication security model, drop and then re-create the triggers on the Microsoft Dynamics SL system database. For more information about how to do it, Various SQL Server error messages occur in multiple screens in Microsoft Dynamics SL.

Microsoft SQL Server 2000

  1. Select Start, select Microsoft SQL Server, and then select Microsoft SQL Enterprise Manager.

  2. Expand Microsoft SQL Server, expand SQL Server Group, and then expand the instance of SQL Server that is hosting the Microsoft Dynamics SL databases.

  3. Right-click Databases, select All Tasks, and then select Restore Database.

  4. In the Restore database as box, type the new name of the database. For example, if you're restoring the Microsoft Dynamics SL system database for testing, you can type a name such as TestSystem.

  5. Under Restore, select From Device.

  6. Select Select Devices, and then select Add.

  7. Under File Name, select Browse, and then locate the database backup files.

  8. In the Backup Device Location dialog box, select OK.

  9. In the Choose Restore Destination dialog box, select OK.

  10. In the Choose Restore Devices dialog box, select OK.

  11. Select the Options tab.

  12. In the Restore Database Files as section, confirm the location of the database files, and then select OK.

  13. Repeat steps c through l for each application database that is associated with the Microsoft Dynamics SL system database.

  14. In the domain table in the Microsoft Dynamics SL system database, update the application database name. To do it, follow these steps:

    1. Select Start, select Microsoft SQL Server, select Query Analyzer, and then connect to the server that hosts the Microsoft Dynamics SL databases.

    2. In the Available Databases list, select the Microsoft Dynamics SL system database, and then run the following statements:

      UPDATE COMPANY SET DatabaseName = 'XXXXXX' where DatabaseName = 'YYYYYY'
      UPDATE DOMAIN SET DatabaseName = 'XXXXXX' where DatabaseName = 'YYYYYY'
      

      Note

      Replace XXXXXX with the new name of the application database, and replace YYYYYY with the old database name.

  15. Update the database views. To do it, follow these steps:

    1. Select Start, select All Programs, select Microsoft Dynamics SL (Solomon), and then select Database Maintenance.
    2. Connect to the instance of SQL Server that is hosting the Microsoft Dynamics SL databases.
    3. In the System Database Name list, select the restored Microsoft Dynamics SL system database.
    4. Under Databases, select the restored Microsoft Dynamics SL application database.
    5. Select Update Views.
    6. At the bottom of the Database Maintenance (98.290.00) window, confirm that the progress bar has finished.
    7. Select Close.
    8. Sign in to Microsoft Dynamics SL by using the appropriate SQL Server name and the appropriate Microsoft Dynamics SL system database name.