Articles in this section
Category / Section

How to update the tenant database information in bulk in On Premise deployments

Published:
This article explains how to update the database information for multiple tenants using command line tool. To update the connection string for the sites, we need to get the active site's database details and update the new database details. This can be done using the below commands,
  • getsitedbdetails which retrieves the site details.
  • updatesitesdbdetails which updates the database with new server details.

Get the sites database information

The 'getsitedbdetails' command retrieves the site's database details as a “site_db_details.csv” file in the <deployment_location>\app_data\site_details path. This will help you to verify the existing database information used for the sites.

In the same folder, the template file to update the site's database details also generated in the name update_site_db_details.csv.

The site_db_details.csv file contains the site details of all the active tenants with the following columns:
  1. Tenant ID
  2. Site URL
  3. Server connection string
  4. IMDB connection string
site_details_excel.jpg

The update_site_db_details.csv is a template file in which the database details to be updated should be provided. It contains the following columns.

    1. Tenant ID: This is required if you are going to update the database information for the site individually,
      or the database name of the site is changed.
    2. Site URL: This is required if you are going to update the database information for the site individually,
      or the database name of the site is changed.
    3. Server type: This is required field and set the value as mssql, mysql, or postgresql.
    4. Current migration is possible only for the same SQL server and we cannot migrate between the different SQL server type like mysql to mssql or others.

    5. Old server name: is a required field and old server name should be provided. The old server name can be get from site_db_details.csv file.
    6. Server name: is a required field and new server name in which the database is migrated should be provided.
    7. Port: is required only for PostgreSQL and MySQL and leave this empty for MSSQL.
    8. Username: is required and give the new Database server username. Make sure this user has the required permission sets which is defined here.
    9. Password: is required and give the new Database server password.
    10. Database name: is required only if you need to update the database name for the sites individualy. If database name is provided in the field, we are updating the individual site. If database name is not changed then you can leave it empty or “*” can be provided.
    11. IsSameImdbServer: If you need to update the same database server information with existing IMDB name for datastore, set this as true. If you want to use different Database or SQL Server, then set value as false and after updating the tenant site connection string with updatesitesdbdetails command, move into the respective tenant site's datastore settings page and need to update it manually.
    12. Maintenance Database: is optional and only required for PostgreSQL. 
    13. Additional Parameters: is optional.
    14. IsWindowsAuthentication: is required only for MSSQL. Provide the value as true if windows authentication is used or false.

excel_update.png


Command to update the database to new server

This 'updatesitesdbdetails' command will update all the sites that matches old server name to a new server. Using the command, we can update the bulk sites as described below,


Providing the database details individually for sites:

If you are going to update the different database name and database server for individual site, fill all the columns mentioned in update_site_db_details.csv template file.


Update DB server name and credentials for all sites:

If you are going the to update the database server name and credentials for all the sites, you can give the single row with old and new server details and fill '*' for the database name.


After running the updatesitesdbdetails command, the result file will be generated in the below location, you can get the site updated result from that folder.

<deployment_location>\app_data\site_details\db_update_results

updated_excel.jpg

Please refer below sections to update the database information for the multiple sites based on your Bold BI hosting environments. This includes guidance for the following environments:
  • Windows
  • Linux
  • Docker
  • Kubernetes

Windows

Step 1: Open the command prompt and change the directory to the admin utility location.

Run the command "cd C:\BoldServices\utilities\adminutils"initial_command.jpg  Step 2: Run the command "Syncfusion.Server.Commands.Utility.exe getsitedbdetails" to get the sites details.
getdb_command.jpg Step 3: “site_db_details.csv” and “update_site_db_details.csv” files will be generated in C:\BoldServices\app_data\site_details path.


Step 4: Before executing the update command,  ensure that the "update_site_db_details.csv" file is correctly filled with the required columns.


Step 5: Run the command "Syncfusion.Server.Commands.Utility.exe updatesitesdbdetails"
update_tenant.jpg
Step 6: Sites will be updated and "updated_site_details_timestamp.csv” will be generated with the success or failure message in the location C:\BoldServices\app_data\sites_details\db_update_results\updated_site_details_timestamp.csv 

Step 7: After updating the sites, restart the application by following this link.

Linux

Step 1: Open the command prompt and change the directory to the admin utility location.

Run the command "cd /var/www/bold-services/application/utilities/adminutils/"
Linux-cd command.png
Step 2: Run the command "../../../dotnet/dotnet Syncfusion.Server.Commands.Utility.dll getsitedbdetails" to get the site details. 
Linux-get site details.png

Step 3: “site_db_details.csv” and “update_site_db_details.csv” files will be generated in /var/www/bold-services/application/app_data/site_details path.

Step 4: Navigate to the directory by running the command "cd /var/www/bold-services/application/app_data/site_details" and view or edit the file using nano command. 


Step 5: Before executing the update command,  ensure that the "update_site_db_details.csv" file is correctly filled with the required columns.

Change the directory to the admin utility location by running the command "cd /var/www/bold-services/application/utilities/adminutils/"

Step 6: Run the command "../../../dotnet/dotnet Syncfusion.Server.Commands.Utility.dll updatesitesdbdetails"
linux-update site command.png
Step 7: Sites will be updated and "updated_site_details_timestamp.csv” will be generated with the success or failure message in the location /var/www/bold-services/application/app_data/sites_details/db_update_results/updated_site_details_timestamp.csv

Step 8: Navigate to the directory by running the command "cd /var/www/bold-services/application/app_data/site_details/db_update_results" and view the updated site details using nano command.

Step 9: After updating the sites, restart the application by following this link.

Docker

Step 1: Open the command prompt and Bash the container, then change the directory to the admin utility location.
Run the commands"docker exec -it <Container ID or Container name> bash"
                                    "cd /application/utilities/adminutils/"
docker-cd-admin-utility.png
Step 2: Run the command "dotnet Syncfusion.Server.Commands.Utility.dll getsitedbdetails" to get the site details. 
docker-get-site-details-command.png

Step 3: “site_db_details.csv” and “update_site_db_details.csv” files will be generated in /application/app_data/site_details path.


Step 4: Navigate to the directory by running the command "cd /application/app_data/site_details" and view or edit the file using nano command. 


Step 5: Before executing the update command, ensure that the "update_site_db_details.csv" file is correctly filled with the required columns.

Change the directory to the admin utility location by running the command "cd /application/utilities/adminutils/"

Step 6: Run the command "dotnet Syncfusion.Server.Commands.Utility.dll updatesitesdbdetails"
docker-update-command.png
Step 7: Sites will be updated and "updated_site_details_timestamp.csv” will be generated with the success or failure message in the location /application/app_data/sites_details/db_update_results/updated_site_details_timestamp.csv

Step 8: Navigate to the directory by running the command "cd /application/app_data/site_details/db_update_results" and view the updated site details using nano command.

Step 9: After updating the sites, restart the container using the command "docker restart <container ID or container name>"


Kubernetes

Step 1: Open the command prompt and Bash the id_web_deployment pod, then change the directory to the admin utility location. 

Run the commands: "kubectl exec -it <id-web-deployment-pod> -n namespace -- bash"
                                    "cd /application/utilities/adminutils/"
k8s_cd_admin_utility.png
Step 2: Run the command "dotnet Syncfusion.Server.Commands.Utility.dll getsitedbdetails" to get the sites details.
k8s_get_db.png
Step 3: “site_db_details.csv” and “update_site_db_details.csv” files will be generated in /application/app_data/site_details path.

Step 4: Before executing the update command,  ensure that the "update_site_db_details.csv" file is correctly filled with the required columns.


Step 5: Run the command "dotnet Syncfusion.Server.Commands.Utility.dll updatesitesdbdetails"

k8s_update_commad.png
Step 6: Sites will be updated and "updated_site_details_timestamp.csv” will be generated with the success or failure message in the location /application/app_data/sites_details/db_update_results/updated_site_details_timestamp.csv

Step 7: After updating the sites, restart the application using the command "kubectl rollout restart deploy -n <namespace>"
Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
GV
Written by Gayathri Venkatesan
Updated
Comments (0)
Please  to leave a comment
Access denied
Access denied