HTTP Commander DataBase configuration.
Staring from version 8 HTTP Commander supports both of SQLite and MS SQL databases.
For SQLite there is nothing to do and install, everything already included into distibution package and works out of the box. After initial installation HTTP Commander works with SQLite db by default.
In order to switch to MS SQL databse you have to ensure that everything is ready.
Requirements for MS SQL db support
-
HTTP Commander version 8 and later.
-
MS SQL server - Installation and configuration instructions avaiable here.
We assume that Web server, WebFarm and MS Sql server already installed and function correctly.
Steps to configure HTTP Commander to use MS SQL server data storage.
For a long time SQLite db has been used in the HTTP Commander to store following types of data:
-
User events (logs)
-
Favorites
-
Public links
-
Trash items
-
Subscribtions to events
And it was a bottle-neck for installing HTTP Commander in a Load Balancer: when several servers tries to write information into the same SQLite db, it often results to an error because of a blocked db file and as a result missed data.
For single server configurations there are no issue with the SQLLite DB, except the work speed on a large DB.
Here are steps to switch from SQLite to MS SQL db:
-
Using admin panel:
-
Login with administrator account, open Admin Panel --> DB Maintenance tab and click on the "Change connection" button.
-
In the opened windows switch DB type from "SQLite" to "MsSQL" .
-
Enter connection string to your MS SQL server. Example:
Data Source=SQLSERVER;Initial Catalog=hcdb;Persist Security Info=True;User ID=sa;Password=*****
-
When you switch between DB types there is an option to automatically import extinig data from the current Db to the new one.
If you would like to import data, set "Import data" checkbox in the form.
-
And the last option is to clear all data in the destination DB before importing. This option avaiable only when "Import data" checkbox is checked. And it will clear all data in the destionation DB if it already exists.
-
OR configure connection manully.
Navigate to the HTCOMNET folder and open HTTPCommanderSettings.config file in any text editor.
Search for the "DB" section and set the value of the DbmsType setting to MsSQL and
configure the value of the DbConnectionString setting as the connection string to your MS SQl DB. Example:
Data Source=SQLSERVER;Initial Catalog=hcdb;Persist Security Info=True;User ID=sa;Password=*****
You can switch between DB types at any time, as well as change connection string. If you decide to keep the same DB type, but want to use new DB name (location in case of SQLite) , steps will be the same including ability to import data into the new DB.
DbConnectionString - For SQLite DB type values of this setting may contain %DATAFOLDERPATH% placeholder. This paceholder is replaced with the value of the DataFolderPath setting. And by default the value of the DbConnectionString for SQLLite is %DATAFOLDERPATH%\data.db. It allows to store SQLLite data file in the same place as other app data.