Follow the instructions below to export your SENSORS and DEVICES tables to csv files and put them into your “db” sub folder.
How to Export from MySQLHow to Export from SQL ServerHow to Export from Device ManageR v6.3.6 Embedded H2 Database
- Open MySQL Workbench.
- Open a New Query tab. Enter and execute this query:
- Open another New Query tab.
- Enter and execute this query: Select * from sensors
- In the output toolbar, select the Export recordset to an external file button.
- Call the file SENSORS.csv. (It MUST be named that.)
- Save it to the “db” sub-folder inside your custom Device ManageR source folder.
- Open a third New Query tab.
- Enter and execute this query: Select * from devices
- In the output toolbar, select the Export recordset to an external file button.
- Call the file DEVICES.csv. (It MUST be named that.)
- Save it to the “db” sub-folder inside your custom Device ManageR source folder.
- Open Microsoft SQL Server Management Studio.
- Open a New Query.
- Enter and execute this query: SELECT * FROM [DeviceDB].[dbo].[SENSORS]
- In the Results panel, right-click on any of the column headers and select Save Results As…
- Call the file SENSORS.csv. (It MUST be named that.)
- Save it to the “db” sub-folder inside your custom Device ManageR source folder.
- Open another New Query.
- Enter and execute this query: SELECT * FROM [DeviceDB].[dbo].[DEVICES]
- In the Results panel, right-click on any of the column headers and select Save Results As…
- Call the file DEVICES.csv. (It MUST be named that.)
- Save it to the “db” sub-folder inside your custom Device ManageR source folder.
Typically, you do not need to create a custom folder if you are importing from a Device ManageR v6.3.6 that writes to the embedded H2 database. You can point the Import Tool directly at your Device ManageR installation folder.
However, if your situation requires it, you can follow these steps to export the SENSORS and DEVICES tables from your embedded database into the “db” subfolder you created earlier.
Step 1: Download and install the H2 Database Engine Console.
- In your browser, go to https://www.h2database.com/html/main.html
- In the Download section, select Windows Installer.
- Run the installer. Keep the default options.
Step 2: Open the console and test its connection to Device ManageR.
- Open the H2 console by navigating in Windows to Start → H2 → H2 Console.
- The Login page of the console opens. Leave everything on that page at defaults except JDBC URL . . .
- In JDBC URL, enter “jdbc:h2:file:” followed by the full path to Device ManageR’s installation folder.
- Use forward slashes (“/”), not back slashes (“\”) between the folders.
- Here is an example:
- jdbc:h2:file:C:/Program Files (x86)/AVTECH Device ManageR/DeviceDB/DeviceDB
- Then select Test Connection.
- Confirm that you see the Test successful message at the bottom of the window.
Step 3: Connect to the database and export the files.
- Select Connect.
- Your embedded H2 database opens in your browser.
- In the SQL statement box (under the Run button):
- Enter these 2 commands:
- call CSVWRITE (‘path to the db sub-folder/SENSORS.csv’, ‘SELECT * FROM SENSORS’);
- call CSVWRITE (‘path to the db sub-folder/DEVICES.csv’, ‘SELECT * FROM DEVICES’);
- Here is an example. (Be sure to put forward-slashes “/” between the folders, not back slashes “\”.)
- call CSVWRITE (‘C:/Users/Laptop/Documents/Custom_DeviceManageR_Source_Folder/db/SENSORS.csv’, ‘SELECT * FROM SENSORS’ );
- call CSVWRITE (‘C:/Users/Laptop/Documents/Custom_DeviceManageR_Source_Folder/db/DEVICES.csv’, ‘SELECT * FROM DEVICES’ );
- Select Run. Notice the confirmation messages below the commands.
- Then check your “db” sub-folder–the CSV files should be there.