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 included with CM4D Server installer and should only be run by users with a clear knowledge of CM4D and its databases.

This utility is located in the following directory: .\Applied Tech Systems\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 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.

Connection information may also be entered as command line arguments when running the application via Command Prompt. See the topic Database Utilities for more information on how to Run Utility via Command Prompt Line Arguments.

Connection via appsettings.json File Configuration

Before running the Datasource Database Utility, open the appsettings.json file in the .\Applied Tech Systems\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.

Connection via Manual Entry

When Datasource Database Utility is run, you are prompted to type the CM4D database connection information one line at a time. Once you have entered all of the required connection details, press 'Y' to continue.

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 window closes automatically.

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

Can we improve this topic?