{"id":21695,"date":"2021-05-13T10:58:41","date_gmt":"2021-05-13T14:58:41","guid":{"rendered":"https:\/\/avtech.com\/articles\/?p=21695"},"modified":"2023-01-20T15:36:59","modified_gmt":"2023-01-20T20:36:59","slug":"how-to-configure-room-alert-manager-to-write-to-an-external-database","status":"publish","type":"post","link":"https:\/\/avtech.com\/articles\/21695\/how-to-configure-room-alert-manager-to-write-to-an-external-database\/","title":{"rendered":"How To Configure Room Alert Manager To Write To An External Database"},"content":{"rendered":"\n<p>By default, Room Alert Manager uses a built-in H2 database to store its configuration settings and historic sensor data; however, if you plan to retain a significant amount of sensor data, it is best to store it to an external database. Room Alert Manager currently support both SQL Server and MySQL. <em>Please note that when you switch to a new database, any sensor data stored in the original database does not get migrated over.<\/em><\/p>\n\n\n\n<p>Select the tabs below for instructions to configure Room Alert Manager to work with SQL Server or MySQL.<\/p>\n\n\n<div class=\"su-tabs su-tabs-style-default su-tabs-mobile-stack\" data-active=\"1\" data-scroll-offset=\"0\" data-anchor-in-url=\"no\"><div class=\"su-tabs-nav\"><span class=\"\" data-url=\"\" data-target=\"blank\" tabindex=\"0\" role=\"button\">SQL Server<\/span><span class=\"\" data-url=\"\" data-target=\"blank\" tabindex=\"0\" role=\"button\">MySQL<\/span><\/div><div class=\"su-tabs-panes\"><div class=\"su-tabs-pane su-u-clearfix su-u-trim\" data-title=\"SQL Server\">\n\n\n<div class=\"su-note\"  style=\"border-color:#bcc7cd;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#d6e1e7;border-color:#ffffff;color:#000612;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;\">\n\n\n\n<p>The current version of Room Alert Manager supports SQL Server 2017 and newer.<\/p>\n\n\n<\/div><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Configure your database in SQL Server.<\/h3>\n\n\n\n<ul><li>Configure a new database to store your Room Alert sensor data.<ul><li>You may use any naming convention you&#8217;d like. In our example, we called our database &#8220;roomalertmanager.&#8221;<\/li><\/ul><\/li><li>Create a schema for your new database. It <strong>must be named<\/strong> &#8220;room_alert_manager.&#8221;<\/li><li>Create a new login. In our example, we called ours &#8220;ITMgr.&#8221;<ul><li>For best results, we recommend configuring this user with <em>SQL Server Authentication<\/em> (as opposed to <em>Windows Authentication<\/em>.)<\/li><li>This user should be mapped ONLY to the new database that you created.<\/li><li>Assign this user the role of &#8220;db owner.&#8221;<\/li><\/ul><\/li><\/ul>\n\n\n\n<p>The screenshot below shows our example Login&#8217;s <em>User Mapping Properties<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/avtech.com\/articles\/wp-content\/uploads\/2022\/04\/SQL_Login_UserMapping.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/avtech.com\/articles\/wp-content\/uploads\/2022\/04\/SQL_Login_UserMapping.png\" alt=\"\" class=\"wp-image-23691\" width=\"696\" height=\"482\" srcset=\"https:\/\/avtech.com\/articles\/wp-content\/uploads\/2022\/04\/SQL_Login_UserMapping.png 928w, https:\/\/avtech.com\/articles\/wp-content\/uploads\/2022\/04\/SQL_Login_UserMapping-300x208.png 300w, https:\/\/avtech.com\/articles\/wp-content\/uploads\/2022\/04\/SQL_Login_UserMapping-768x532.png 768w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Configure your settings in Room Alert Manager.<\/h3>\n\n\n\n<p>Follow the steps below to configure Room Alert Manager to log sensor data to your SQL Server database.<\/p>\n\n\n\n<p>These instructions require you to start and stop the Room Alert Manager service. This FAQ shows you how: <a href=\"https:\/\/avtech.com\/articles\/20885\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Stop, Start And Restart The Room Alert Manager Service<\/a>.<\/p>\n\n\n\n<ol><li>Stop the Room Alert Manager service.<\/li><li>Navigate to Room Alert Manager\u2019s installation folder on its host system. <ul><li>By default, it&#8217;s at C:\\Program Files\\AVTECH Room Alert Manager.<\/li><\/ul><\/li><li>Locate the \u201cconfig\u201d folder and open it.<\/li><li>In the \u201cconfig\u201d folder, locate the \u201capplication.properties\u201d file.<\/li><li>Open that file in any text editor, such as Notepad or Notepad++.<\/li><li>Then edit the following lines:<br><img decoding=\"async\" loading=\"lazy\" width=\"721\" height=\"621\" class=\"wp-image-23156\" style=\"width: 450px;\" src=\"https:\/\/avtech.com\/articles\/wp-content\/uploads\/2021\/12\/RAM_AppProp_SQLServer.png\" alt=\"\" srcset=\"https:\/\/avtech.com\/articles\/wp-content\/uploads\/2021\/12\/RAM_AppProp_SQLServer.png 721w, https:\/\/avtech.com\/articles\/wp-content\/uploads\/2021\/12\/RAM_AppProp_SQLServer-300x258.png 300w\" sizes=\"(max-width: 721px) 100vw, 721px\" \/><ul><li><strong>db.devicedata.mode<\/strong><ul><li>Set this value = <em>sqlserver<\/em><\/li><li>When this value is set to <em>main<\/em>, Room Alert Manager logs sensor data to its embedded H2 database.<\/li><\/ul><\/li><\/ul><ul><li><strong>db.devicedata.hostname<\/strong><ul><li>If Room Alert Manager and your SQL Server are installed on the same computer, set this value = <em>localhost<\/em><\/li><li>Otherwise, enter your SQL Server\u2019s hostname or IP address.<\/li><\/ul><\/li><li><strong>db.devicedata.port<\/strong><ul><li>Set this value = your SQL Server database port.<\/li><li>The default SQL Server port is 1433, which is what we used in our example.<\/li><\/ul><\/li><li><strong>db.devicedata.schema<\/strong><ul><li>Set this value = <em>room_alert_manager<\/em><\/li><li>Your SQL Server&#8217;s schema name must be <em>room_alert_manager<\/em>.<\/li><\/ul><\/li><li><strong>db.devicedata.user<\/strong><ul><li>Set this value = the username you created for your SQL Server.<\/li><li>In our example, our username is <em>ITMgr<\/em>.<\/li><\/ul><\/li><li><strong>db.devicedata.password<\/strong><ul><li>Set this value = the password you gave to that username.<\/li><\/ul><\/li><\/ul><ul><li><strong>db.devicedata.databaseName<\/strong><ul><li>Set this value = the name you gave your SQL Server database.<\/li><li>In our example, our database name is <em>roomalertmanager<\/em>.<\/li><\/ul><\/li><\/ul><\/li><li>When you&#8217;re done making changes, save the \u201capplication.properties\u201d file.<\/li><li>You may now close Room Alert Manager\u2019s installation folder.<\/li><li>Then start the Room Alert Manager service.<\/li><li>Room Alert Manager will connect to your SQL Server database and begin logging sensor data to it.<\/li><\/ol>\n\n\n<\/div>\n<div class=\"su-tabs-pane su-u-clearfix su-u-trim\" data-title=\"MySQL\">\n\n\n<div class=\"su-note\"  style=\"border-color:#bcc7cd;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#d6e1e7;border-color:#ffffff;color:#000612;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;\">\n\n\n\n<p>The current version of Room Alert Manager supports MySQL v5.7 and newer.<\/p>\n\n\n<\/div><\/div>\n\n\n\n<p><strong>Follow the steps below to configure Room Alert Manager to log sensor data to your MySQL database.<\/strong><\/p>\n\n\n\n<p>These instructions require you to start and stop the Room Alert Manager service. This FAQ shows you how: <a href=\"https:\/\/avtech.com\/articles\/20885\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Stop, Start And Restart The Room Alert Manager Service<\/a>.<\/p>\n\n\n\n<ol><li>Stop the Room Alert Manager service.<\/li><li>Navigate to Room Alert Manager\u2019s installation folder on its host system. <ul><li>By default, it&#8217;s at C:\\Program Files\\AVTECH Room Alert Manager.<\/li><\/ul><\/li><li>Locate the \u201cconfig\u201d folder and open it.<\/li><li>In the \u201cconfig\u201d folder, locate the \u201capplication.properties\u201d file.<\/li><li>Open that file in any text editor, such as Notepad or Notepad++.<\/li><li>Then edit the following lines:<br><img decoding=\"async\" loading=\"lazy\" width=\"721\" height=\"621\" class=\"wp-image-23157\" style=\"width: 450px;\" src=\"https:\/\/avtech.com\/articles\/wp-content\/uploads\/2021\/12\/RAM_AppProp_MySQL.png\" alt=\"\" srcset=\"https:\/\/avtech.com\/articles\/wp-content\/uploads\/2021\/12\/RAM_AppProp_MySQL.png 721w, https:\/\/avtech.com\/articles\/wp-content\/uploads\/2021\/12\/RAM_AppProp_MySQL-300x258.png 300w\" sizes=\"(max-width: 721px) 100vw, 721px\" \/><ul><li><strong>db.devicedata.mode<\/strong><ul><li>Set this value = my<em>sql<\/em><\/li><li>When this value is set to <em>main<\/em>, Room Alert Manager logs sensor data to its embedded H2 database.<\/li><\/ul><\/li><\/ul><ul><li><strong>db.devicedata.hostname<\/strong><ul><li>If Room Alert Manager and MySQL are installed on the same computer, set this value = <em>localhost<\/em><\/li><li>Otherwise, enter the hostname or IP address for MySQL.<\/li><\/ul><\/li><li><strong>db.devicedata.port<\/strong><ul><li>Set this value = your MySQL database port.<\/li><li>The default MySQL port is 3306, which is what we used in our example.<\/li><\/ul><\/li><li><strong>db.devicedata.schema<\/strong><ul><li>Set this value = <em>the name of your MySQL schema<\/em>. <br>(\u201cSchema\u201d is MySQL\u2019s term for \u201cdatabase.\u201d)<\/li><\/ul><\/li><\/ul><ul><li><strong>db.devicedata.user<\/strong><ul><li>Set this value = the username you created for MySQL.<\/li><li>In our example, our username is <em>ITMgr<\/em>.<\/li><\/ul><\/li><li><strong>db.devicedata.password<\/strong><ul><li>Set this value = the password you gave to that username.<\/li><\/ul><\/li><\/ul><ul><li><strong>db.devicedata.databaseName<\/strong><ul><li>This must be the same as your <em><strong>db.devicedata.schema<\/strong><\/em><\/li><\/ul><\/li><\/ul><\/li><li>When you&#8217;re done making changes, save the \u201capplication.properties\u201d file.<\/li><li>You may now close Room Alert Manager\u2019s installation folder.<\/li><li>Then start the Room Alert Manager service.<\/li><li>Room Alert Manager will connect to your MySQL database and begin logging sensor data to it.<\/li><\/ol>\n\n\n<\/div><\/div><\/div>\n\n\n<div class=\"su-note\"  style=\"border-color:#bcc7cd;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;\"><div class=\"su-note-inner su-u-clearfix su-u-trim\" style=\"background-color:#d6e1e7;border-color:#ffffff;color:#000612;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;\">\n\n\n\n<p>To go back to using Room Alert Manager&#8217;s embedded H2 database, simply set <em>db.devicedata.mode=main<\/em> again.<\/p>\n\n\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>By default, Room Alert Manager uses a built-in H2 database to store its configuration settings and historic sensor data; however, if you plan to retain a significant amount of sensor data, it is best to store it to an external database. Room Alert Manager currently support both SQL Server and MySQL. Please note that when [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[287],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/avtech.com\/articles\/21695\/how-to-configure-room-alert-manager-to-write-to-an-external-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Configure Room Alert Manager To Write To An External Database - AVTECH\" \/>\n<meta property=\"og:description\" content=\"By default, Room Alert Manager uses a built-in H2 database to store its configuration settings and historic sensor data; however, if you plan to retain a significant amount of sensor data, it is best to store it to an external database. Room Alert Manager currently support both SQL Server and MySQL. Please note that when [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/avtech.com\/articles\/21695\/how-to-configure-room-alert-manager-to-write-to-an-external-database\/\" \/>\n<meta property=\"og:site_name\" content=\"AVTECH\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-13T14:58:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-20T20:36:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/avtech.com\/articles\/wp-content\/uploads\/2022\/04\/SQL_Login_UserMapping.png\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:creator\" content=\"@AVTECHSoftware\" \/>\n<meta name=\"twitter:site\" content=\"@AVTECHSoftware\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"Allie Wojtanowski\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"4 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/avtech.com\/articles\/#website\",\"url\":\"https:\/\/avtech.com\/articles\/\",\"name\":\"AVTECH\",\"description\":\"Frequently Asked Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/avtech.com\/articles\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/avtech.com\/articles\/21695\/how-to-configure-room-alert-manager-to-write-to-an-external-database\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/avtech.com\/articles\/wp-content\/uploads\/2022\/04\/SQL_Login_UserMapping.png\",\"width\":928,\"height\":643},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/avtech.com\/articles\/21695\/how-to-configure-room-alert-manager-to-write-to-an-external-database\/#webpage\",\"url\":\"https:\/\/avtech.com\/articles\/21695\/how-to-configure-room-alert-manager-to-write-to-an-external-database\/\",\"name\":\"How To Configure Room Alert Manager To Write To An External Database - AVTECH\",\"isPartOf\":{\"@id\":\"https:\/\/avtech.com\/articles\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/avtech.com\/articles\/21695\/how-to-configure-room-alert-manager-to-write-to-an-external-database\/#primaryimage\"},\"datePublished\":\"2021-05-13T14:58:41+00:00\",\"dateModified\":\"2023-01-20T20:36:59+00:00\",\"author\":{\"@id\":\"https:\/\/avtech.com\/articles\/#\/schema\/person\/2966f1925021087dba64df344049f189\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/avtech.com\/articles\/21695\/how-to-configure-room-alert-manager-to-write-to-an-external-database\/\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/avtech.com\/articles\/#\/schema\/person\/2966f1925021087dba64df344049f189\",\"name\":\"Allie Wojtanowski\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/avtech.com\/articles\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/470c9c7fbbd3e0a96d84169645634d04?s=96&d=mm&r=g\",\"caption\":\"Allie Wojtanowski\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/avtech.com\/articles\/wp-json\/wp\/v2\/posts\/21695"}],"collection":[{"href":"https:\/\/avtech.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/avtech.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/avtech.com\/articles\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/avtech.com\/articles\/wp-json\/wp\/v2\/comments?post=21695"}],"version-history":[{"count":12,"href":"https:\/\/avtech.com\/articles\/wp-json\/wp\/v2\/posts\/21695\/revisions"}],"predecessor-version":[{"id":27230,"href":"https:\/\/avtech.com\/articles\/wp-json\/wp\/v2\/posts\/21695\/revisions\/27230"}],"wp:attachment":[{"href":"https:\/\/avtech.com\/articles\/wp-json\/wp\/v2\/media?parent=21695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/avtech.com\/articles\/wp-json\/wp\/v2\/categories?post=21695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/avtech.com\/articles\/wp-json\/wp\/v2\/tags?post=21695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}