AdminCLI is a command-line tool for managing database configurations, performing backups and restores, and executing reindex operations on a database. It supports multiple commands, each serving a specific administrative function.
Use this to automate your CI/CD pipeline, or even in your own development workflow.
AdminCLI is part of the WebAdmin.sln
solution and is built from the AdminCLI.csproj
project file. To build it, navigate to the root directory of the solution and run:
dotnet build WebAdmin.sln
To build only the AdminCLI project:
dotnet build AdminCLI/AdminCLI.csproj
You can also build it from Visual Studio in Release
Writes a database configuration.
AdminCLI.exe dbconfig-write -u <USERNAME> -p <PASSWORD> --server <SERVER> --port <PORT> --type <DB_TYPE> --schema <SCHEMA> [OPTIONS]
Options:
-u, --username
(Required) Database instance username.-p, --password
(Required) Database instance password.--server
(Required) Database server hostname or IP.--port
(Optional) Server port (default 1433).--type
(Required) Database type.--schema
(Required) Database schema name.--encrypt-connection
(Optional) Encrypts the database connection.--domain-user
(Optional) Specifies if the user is a domain user.--is-log
(Optional) Indicates if it is a log database configuration.--path
(Optional) Path to save the configuration file. AdminCLI.exe dbconfig-write -u admin -p secret --server localhost --port 1433 --type sqlserver --schema mydb
Reads the existing database configuration.
AdminCLI.exe dbconfig-read -y <YEAR> -s <SCHEMA>
Options:
-y, --year
(Optional) Database year.-s, --schema
(Optional) Database schema name.Creates a database backup.
AdminCLI.exe backup -u <USERNAME> -p <PASSWORD> --year <YEAR> [--location <BACKUP_PATH>]
Options:
-u, --username
(Required) Database instance username.-p, --password
(Required) Database instance password.--year
(Required) Database year.--location
(Optional) Backup save location. AdminCLI.exe backup -u admin -p secret --year 2024 --location C:\backups
Restores a database from a backup.
AdminCLI.exe restore -u <USERNAME> -p <PASSWORD> --year <YEAR> --file <FILENAME> [--location <BACKUP_PATH>]
Options:
-u, --username
(Required) Database instance username.-p, --password
(Required) Database instance password.--year
(Required) Database year.--file
(Required) Name of the backup file.--location
(Optional) Backup file location. AdminCLI.exe restore -u admin -p secret --year 2024 --file backup_2024.sql --location C:\backups
Removes a backup file.
AdminCLI.exe delete-backup --path <BACKUP_PATH>
Options:
--path
(Required) Path to the backup file.Performs a database reindex operation.
AdminCLI.exe reindex -u <USERNAME> -p <PASSWORD> [OPTIONS]
Options:
-u, --username
(Required) Database instance username.-p, --password
(Required) Database instance password.-f, --full
(Optional) Perform a full reindex.--category
(Optional) Reindex by category.--single-script
(Optional) Reindex a single script.--multi-script
(Optional) Specify multiple scripts to reindex.Lists available reindex scripts.
AdminCLI.exe list-reindex-scripts [--category <CATEGORY>]
Options:
--category
(Optional) Filter scripts by category.Creates a redirect configuration file.
AdminCLI.exe create-redirect --config-path <CONFIG_PATH> [--redirect-path <REDIRECT_PATH>]
Options:
--config-path
(Required) Path to the Configuracoes.xml
folder.--redirect-path
(Optional) Path where the redirect file will be created.AdminCLI.exe create-redirect --config-path "C:\yourApp\WebAdmin" --redirect-path "C:\yourApp\App"
This will generate a Configuracoes.redirect.xml
file in C:\yourApp\App
that redirects to the "C:\yourApp\WebAdmin" .
In case of errors, AdminCLI will display an error message indicating the issue. Ensure that all required options are provided and correctly formatted.
AdminCLI is a versatile tool for database administration, providing essential commands for configuration, backup, restore, and reindex operations. For additional help, run:
AdminCLI.exe --help