Migrating Existing MySQL Tables to UTF-8
To avoid loss of data, perform the UTF-8 table migration by following these steps in order:
-
Close the LNDB Manager, QuickReports, DBImport, and DBExport.
-
Pause the scheduled collection process in LoggerNet to avoid any writing of data into the MySQL database. To do this, select the Status Monitor from the Main section of the LoggerNet toolbar, and check the Pause Schedule checkbox.
-
Perform a backup of the tables stored in the MySQL database to secure against data loss. This backup process is done using standard MySQL database administration techniques and is not executed from within LNDB.
-
Shut down the LoggerNet Toolbar. Upgrade LoggerNet to version 4.2 or later. The latest shipping version of LoggerNet is recommended for installation. The latest 4.x patches are available on the Campbell Scientific website.
-
Upgrade LNDB to version 1.2 or later. Check the Campbell Scientific website for the latest version.
-
Install a 32-bit, Unicode version of the MySQL ODBC driver (v5.2.6 or later). The driver installation software is obtained from a MySQL software provider and not from Campbell Scientific.
-
Start the LoggerNet Toolbar. Start the LNDB Manager from the Toolbar.
-
Start the LNDB Engine service (if needed) when prompted.
-
Connect to LoggerNet as prompted.
-
In the Select Database screen, make sure the ODBC data source used by LNDB is configured to use the newly installed 32-bit, Unicode-enabled driver. Use the ODBC Data Source Administrator button as needed, along with the Select Database screen itself.
-
Open the Convert MySQL tables dialog box from the Tools menu of the LNDB Manager. Using this screen, convert the LNDB database and metadata tables to use the UTF-8 character set/encoding (instead of Latin1, for example). Refer to Convert MySQL Tables for further details.
-
Modify the CRBasic program running in the affected dataloggers to use the desired Unicode (UTF-8) characters. The CRBasic Editor provided with LoggerNet 4.2 and later will allow the native processing of UTF-8 characters on-screen. Start the Unicode-enabled programs on the dataloggers.
-
Uncheck the Pause Schedule checkbox in the Status Monitor of LoggerNet to allow data to be collected and sent to LNDB. Use the Connect Screen and LNDB Manager to confirm that data is flowing from the dataloggers into LoggerNet, and from LoggerNet into LNDB. Confirm that Unicode characters are written properly into the data tables of LNDB.
Make sure you do not start a datalogger program that uses Unicode characters until LoggerNet and LNDB have been updated, the LNDB tables have been converted to UTF-8, and the proper MySQL Unicode driver has been installed, as described above. Most Unicode characters cannot be stored in the LNDB database until all of these actions have been executed properly. MySQL tables that use the Latin1 character set instead of UTF-8 cannot store Unicode characters. String data written into LNDB databases when any of the above conditions are not satisfied may result in unrecoverable or corrupt string storage.