Database identifiers for Routines, Features and Samples in a CM4D Database must be unique within the Site database. When a CM4D database is copied (i.e., backup/restore) and added as a new Managed Datasource to a different Site database, problems may occur if there are GUID conflicts with other CM4D databases managed by that Site database. The GUID Replacer is a utility that reassigns Routine, Feature and Sample GUIDs in a CM4D Database. The GUIDs can replaced all at once or for only Routines/Features/Samples individually, and each option can be done in batches. This tool can be used on any CM4D database with errors related to GUID conflicts.
Running the GUID Replacer will not corrupt existing data in the database. However, the utility is only intended for use when necessary and by the appropriate personnel.
Original | New GUIDs |
This utility is located in the following directory: .\CM4D\Database Utilities\GUID Replacer
The GUID Replacer requires a CM4D Datasource connection to the SQL database. This string may be entered manually via the command window or connected automatically by storing the string in the appsettings.json file.
When GUID Replacer is run, type the full database connection string and hit Enter to continue with the database tasks.
To help with formatting, copy the example string here and paste it into the command window:
Server=ServerName;Database=DatabaseName;user id=UserName;Password=pass;
Before running the GUID Replacer, open the appsettings.json file in the .\CM4D\Database Utilities\GUID Replacer directory. Add or modify the database connection string as the "NEwT_Datasource" in the "ConnectionStrings" section:
Change this:
{
"ConnectionStrings": {
"NEwT_Datasource":
}
}
To this:
{
"ConnectionStrings": {
"NEwT_Datasource": "Server=(local)\\MSSQLSERVER01;Database=cm4ddb1;User Id=cm4dservice;Password=cm4d!"
}
}
If your database connection includes an instance name, add a second backslash character between the server and instance name to conform with SQL Server syntax requirements.
Run GUID Replacer and follow the prompts to complete the required database task.
Once the database connection is established, first select the scope of the replacement (all areas or individually) then the batch size (number of rows).
Type the text of the scope option you want to select and hit Enter.
Once you have set the scope, type the number of rows you want to replace and hit Enter.
Execute queries in SSMS to get an idea of the total number of Routines/Features/Samples your database contains.
Once the operation is complete, the command windows closes automatically.
Can we improve this topic?