MS SQL Installation Guide
Prerequisites
SQL Server installed and running.
Access to SQL Server Management Studio (SSMS) or a similar database client.
Git installed.
Linux shell available (e.g., WSL on Windows).
Step-by-Step Instructions
1. Clone openIMIS Database Project
Clone the openIMIS Database repository from GitHub.
git clone <https://github.com/openimis/openimis-db_dkr.git>
2. Create a New Database
Open SQL Server Management Studio (SSMS) or your preferred SQL Server client and create a new database, for example, test_imis
.
3. Create a Database User
Create a new database user named IMISuser
with read, write, and adminddl access only to the test_imis
database.
Create User (SSMS)
In SSMS, navigate to your SQL Server instance.
Expand
Security
>Logins
.Right-click
Logins
and selectNew Login
.Enter
IMISuser
as the Login name.Select
SQL Server authentication
and set a password.Uncheck
Enforce password policy
if desired.In the
User Mapping
page, mapIMISuser
to thetest_imis
database.Assign
db_datareader
,db_datawriter
, anddb_ddladmin
roles toIMISuser
.Click
OK
to create the user.
4. Log in to the Database as IMISuser
Log in to the test_imis
database using the newly created IMISuser
.
sqlcmd -S <Your_Server_Name> -U IMISuser -P <Your_Password> -d test_imis
Replace <Your_Server_Name>
, <Your_Password>
, and test_imis
with your server name, password, and database name, respectively.
5. Navigate to the Cloned Folder
Navigate to the database_ms_sqlserver
folder within the cloned openIMIS Database Project.
cd openimis-db_dkr/database_ms_sqlserver
6. Execute the Script File in a Linux Shell
Open a Linux shell (e.g., WSL on Windows) and execute the script file concatenate_files.sh
located in the database_ms_sqlserver
folder.
This script will generate a SQL script file in the output
folder, e.g., fullDemoDatabase.sql
.
7. Run the Generated SQL Script
Run the generated SQL script (fullDemoDatabase.sql
) in SQL Server to set up the database schema and initial data.
Execute Script (SSMS)
Open SSMS and connect to your SQL Server instance.
Open the
fullDemoDatabase.sql
file generated in theoutput
folder.Ensure that the
test_imis
database is selected.Execute the script by pressing
F5
or clicking theExecute
button.
Summary
You have now successfully set up the openIMIS Database in SQL Server with the necessary user and permissions. The user IMISuser
has the appropriate rights to interact with the test_imis
database. Additionally, you have cloned the openIMIS database repository and executed the required SQL scripts.
Did you encounter a problem or do you have a suggestion?
Please contact our Service Desk
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/