How do I make a copy of a standard database (SQL)
Description
Cause
In SQL every database is assigned a unique GUID. If we restore a copy of an existing database it will load the same unique GUID even if you change the database name in SQL Server Management Studio (SSMS).
Resolution
Sage Estimating SQL 19.12 and greater

You use the Copy tool to create a new database by copying an existing standard or cost database.

Before you start

Make sure no other users are working with the databases you are going to copy. None of the fields on the Copy Database tab are available until you confirm that you have exclusive access to the databases.

To copy a database:

  1. On the ribbon in the Estimating Management Console, click the [Tools] button.
  2. In the navigation pane, click Copy.
  3. After verifying that no users are working with the database you are going to copy, select the Exclusive access confirmed check box on the Copy Database tab.

Estimating Management Console displays all your Sage Estimating standard databases in the table.

  1. In the table, select the database you want to copy.
  2. In the New standard database name, type the name you want to give to the new database.
  3. Click [Copy].

Sage Estimating SQL 18.11 and 18.12

You can now back up and restore a standard database or addressbook to adifferent name, provided you follow these steps:

  1. Use the Estimating Management Console Backup tool to back up the database.
  2. Using Windows Explorer, browse to the file location, and rename the backup file (with the BAK extension).
  3. Use the Estimating Management Console Restore tool to restore the renamed back up file.

Important! It is vital to rename the BAK file and to restore it using the Estimating Management Console. If you attempt to restore the database using SQL Server Management Studio, Estimating treats the renamed database as a duplicate, and does not display it in the database catalog.

Sage Estimating SQL 17.13 and older

Below are the steps for how to change the GUID for the database you would like to restore that already exists in your SQL instance.

  1. Find the .bak file backup of the items database. The default path is C:\Program Files\Microsoft SQL Server\[instance name]\MSSQL\Backup
  2. Use SSMS to restore the database making sure to assign a new name to the database at the time of restore (steps are in related resources below)
  3. In SSMS expand the database you just restored using the [+] sign.
  4. Expand out Programmability using the [+] sign.
  5. Expand out Stored Procedures using the [+] sign.
  6. Locate Security.GetAllPublicProperties
  7. Right click and select Properties
  8. In the Properties window select Extended Properties in the left pane
  9. Locate Sage.Estimating.SQL.DatabaseGUID in the list and copy the GUID string value from the Value column.
  10. Go back to Stored Procedures and find Security.SetDatabaseGUID
  11. Right click on Security.SetDatabaseGUID and select Execute Stored Procedure...
  12. Paste the copied value from step 9 above into the Value column and be sure to enclose it in quotation marks. Example: "7e2e8cf1-f14c-454b-bb71-f129e9f254c3" (If you do not use quotation marks you will get error:
    Msg 102, Level 15, State 1, Line 5
    Incorrect syntax near '[string]'.
  13. Change the last value in the pasted GUID so that it is unique to the restored copy. (example: "7e2e8cf1-f14c-454b-bb71-f129e9f254c4")
  14. Click OK on the stored procedure window

You should now see the database show in the Estimating Configuration Wizard with its own unique GUID string value ID. You should also now be able to see the original and the restored copy in the Estimating Management Console (EMC) as well as through the Estimating application. If you do not see the restored database in the EMC, select the Standard DB tab, click the magnifying glass tool in the Standard Database Catalog list. Check the box next to your database and click ok.



[BCB:164:Chat Estimating US:ECB]

Steps to duplicate
Related Solutions

Getting Started: Maintaining and Safeguarding Your Data (SQL)

How do I restore my Estimating databases using SQL Server Management Studio (SSMS)? (SQL)