Datasource Database Utility

The Datasource Database Utility is a simple command prompt tool that executes all the scripts necessary to create a new CM4D Datasource database or upgrade a v24 or v25 CM4D Datasource to the latest database schema.

This utility is located in the following directory: .\CM4D\Database Utilities\Datasource Database Utility

To ensure you have sufficient system privileges to run the database utilities, it is recommended to execute the tool using 'Run as administrator'.

Database Connection

The Datasource Database Utility 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.

Manual Datasource Connection

When Datasource Database Utility is run, you are prompted to type the full database connection string and hit Enter to continue with the database tasks.

Copy the example string here and paste it into the command window: Server=ServerName;Database=DatabaseName;user id=UserName;Password=pass;

Preset Datasource Connection

Before running the Datasource Database Utility, open the appsettings.json file in the .\CM4D\Database Utilities\Datasource Database Utility directory. Add or modify the database connection string as the "NEwT_Datasource" in the "ConnectionStrings" section:

Change this: 

{
  "ConnectionStrings": {
    // example - "NEwT_Datasource": "server=ATSLOCALPC;database=CM4D;user id=CM4D;password=cm4d!" 
  }
}

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 Datasource Database Utility and follow the prompts to complete the required database task.

Database Task Options

Once the database connection is established, you have the following options:

Type the text of the option you want to select and hit Enter.

Once the operation is complete, the command windows closes automatically.

If the task you selected did not work, you may have insufficient privileges. Check the authentication user credentials or try executing the Database Utility using 'Run as administrator'.

Can we improve this topic?