How to update the tenant database information in bulk in On Premise deployments
- 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.
- Tenant ID
- Site URL
- Server connection string
- IMDB connection string
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.
- 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. - 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. - Server type: This is required field and set the value as mssql, mysql, or postgresql.
- 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.
- Server name: is a required field and new server name in which the database is migrated should be provided.
- Port: is required only for PostgreSQL and MySQL and leave this empty for MSSQL.
- Username: is required and give the new Database server username. Make sure this user has the required permission sets which is defined here.
- Password: is required and give the new Database server password.
- 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.
- 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.
- Maintenance Database: is optional and only required for PostgreSQL.
- Additional Parameters: is optional.
- IsWindowsAuthentication: is required only for MSSQL. Provide the value as true if windows authentication is used or false.
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.
- Tenant ID: This is required if you are going to update the database information for the site individually,
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
- Windows
- Linux
- Docker
- Kubernetes
Windows
Step 1: Open the command prompt and change the directory to the admin utility location.
Step 4: Before executing the update command, ensure that the "update_site_db_details.csv" file is correctly filled with the required columns.
Linux
Step 1: Open the command prompt and change the directory to the admin utility location.
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 5: Before executing the update command, ensure that the "update_site_db_details.csv" file is correctly filled with the required columns.
Docker
Step 3: “site_db_details.csv” and “update_site_db_details.csv” files will be generated in /application/app_data/site_details path.
Step 5: Before executing the update command, ensure that the "update_site_db_details.csv" file is correctly filled with the required columns.
Kubernetes
Step 1: Open the command prompt and Bash the id_web_deployment pod, then change the directory to the admin utility location.
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"