Views:
Disclaimer:
The installation of MySQL databases is not part of DocuWare support.
As MySQL is a third party application, we have no way of troubleshooting any issues, recommending any additional settings or checking if the installation is fully complete.
DocuWare is not responsible for any corrupted systems if the database is damaged during or after the installation.

Question:
How to upgrade an Internal Database V2 (MySQL 5.6) to an Internal Database V3 (MySQL 8)

Answer:
Updating from MySQL 5.6 to MySQL 8 takes three steps.
You can check your current installed MySQL version by executing
SHOW VARIABLES LIKE "%version%";

All needed files can be found using the following download:
Download-MySQL56TO8

Important notes:
Ensure to shut down all applications accessing the database before any backup/dump attempts.
Make sure to have a valid backup of your database.
Make sure to have a backup of your installation directory.

Do not upgrade DocuWare directly after upgrading MySQL.
Let the system run for some time to check if the complete functionality is still given.

Basic information about MySQL:
During the KBA, the installation directory as well as the data directory will be mentioned.

The installation directory contains all files needed to run the MySQL service, and is located in C:\Program Files (x86)\DocuWare\Internal Database V1\ or C:\Program Files (x86)\DocuWare\Internal Database V2\ depending on previous installations.
If you are unsure where to find your installation directory, please check the MySQL service within Windows Services, you will get the path to the MySQLD.exe file and with it the installation folder.
In this folder, you will find the my.ini and many sub folders, e.g. \bin.
\bin is containing most of the executables and is later on needed to run the upgraders.

The data directory is located in C:\ProgramData\DocuWare\Internal Database\.
Fittingly the folder is named data.
It contains the contents and structure of all database tables for the installed MySQL database.

For the initial part to the upgrade, you only have to work in the installation folder.
During the upgrade to MySQL 8, you need to add a folder on the same level as the data directory.

MySQL 5.6 to MySQL 5.6 final

Stop MySQL service
Extract mysql-5.6.51-winx64.zip

Do not delete, but replace the files within installation folder (Default C:\Program Files (x86)\DocuWare\Internal Database V2)
NOTE: The files included will provide a "Data" folder. Do not copy the Data folder, copying this folder will cause unexpected behaviors.
Start the MySQL Service, either via ServiceControl or Windows Services.

Start a command line with administrative rights and navigate to the installation directory and its subfolder \bin.
(default: C:\Program Files (x86)\DocuWare\Internal Database V2\bin)
Execute the following command.

mysql_upgrade --user=root --password=admin

Choose an administrative MySQL user (e.g. root).
This will upgrade your database tables to the 5.6 final

MySQL 5.6 final to MySQL 5.7

Stop MySQL service
Extract mysql-5.7.38-winx64.zip

Do not delete, but replace the files within installation folder (Default C:\Program Files (x86)\DocuWare\Internal Database V2)

Open the existing my.ini and search for "innodb_additional_mem_pool_size".
Remove the attribute, either by deleting the line or commenting by adding a # at the beginning of the line.

Start the MySQL Service, either via ServiceControl or Windows Services.

As before, use the administrative cmd to run the upgrade command.

mysql_upgrade --user=root --password=admin

This will upgrade your database tables to the 5.7

Mysql 5.7 to MySQL 8

NOTE: Before completing the outlined steps, best practice is to create a full database backup of all DocuWare Databases and place it in a different location outside the DocuWare server.

  1. Stop MySQL services in DocuWare by right-clicking DocuWare Service controls and selecting Stop services to perform a soft shutdown.

    NOTE: DO NOT SHUT DOWN ALL SERVICES! SHUTTING DOWN ALL SERVICES WILL CAUSE A KILL ON THE PROCESS AND WILL CAUSE HEAVY DATABASE CORRUPTION, REQUIRING A COMPLETE DATABASE RESTRUCTURE.
  2.  Extract the Internal Database V3.zip.
  3. Move the Internal Database V3 folder to the installation folder that has Internal Database V2 located in C:\Program Files (x86)\DocuWare Internal Database V2.
  4. Open the Internal Database V3 folder, create a new folder named "Uploads".
  5. Add the copied data folder from Internal Database V2 to Internal Database V3.
  6. In the main zip file, download the my.ini file to the Internal Database V3 folder.
    NOTE: It is recomended to use Notepad++ for editing the my.ini file. When editting the file, ensure the encoding format is set to UTF-8.
  7. Within the my.ini file, adjust the following paths:

    basedir=C:/Program Files (x86)/DocuWare/Internal Database V3
    datadir=C:/Program Files (x86)/DocuWare/Internal Database V3/data
    secure-file-priv=C:/Program Files (x86)/DocuWare/Internal Database V3/Uploads
  8. Now, delete V2 service by executing the following query in Command Prompt as an administrator.

           sc delete DWMySQL2

To create the service for V3 run the following  command.
 

“Adjust the paths as needed for your environment.”
sc create DWMySQL3 binPath= "\"C:\Program Files (x86)\DocuWare\Internal Database V3\bin\mysqld.exe\" --defaults-file=\"C:\Program Files (x86)\DocuWare\Internal Database V3\my.ini\"                     
DWMySQL3" DisplayName= "DocuWare Internal Database V3" start= "auto"

Once the command has been completed, run the following command to now start MySQL Service.

sc start DWMySQL3

Upon the start of MySQL 8, the tables will be updated automatically. If any error occurs during the upgrade, you can find the error in the InternalDatabasev3.err file located in C:Program Files (x86)\Internal Database v3\Data. After reading the specific error, one of two things can be done to resolve it.

One solution is to complete the following steps to force the upgrade.

  1. Open Command Prompt as an administrator.
  2. In the file explorer, follow the file path C:\Program Files (x86)\DocuWare\Internal Database V3\bin\

      3. Run the following command in Command Prompt

         
mysqld --upgrade=Force

NOTE: This process can take some time, but you must ensure that the process is completed successfully.

Another option to fix the error is as follows:

  1. Relocate the InternalDatabaseV3 data folder located in C:\Program Files (x86)\DocuWare\Internal Database V3\ to a differnt file path.
  2. Open Command Prompt as an administrator.
  3. Open the file path C:\Program Files (x86)\DocuWare\Internal Database V3\bin\
  4. Run the command mysqld --initialize -- console. This will recreate a new database with a new database system table and new user. Please note that the comand will give the root user and temporary password.
  5. Start the MySQL server, and upon opening the application, you will be prompted to change your password. If you are using the root as the user, please enter the same password used for the DocuWare database user. If you were using another database user, recreate the user with the same password as before.

    After completing these steps, you should be able to start the services and test your DocuWare system. If you encounter errors in the restoration process, contact your database manager for assistance. If you cannot start the services, and you need to revert the system to V2, note the V2 folder is available because it was not deleted. Name the V3 folder "Do not delete” and create a ticket for DocuWare Support to help you with resolving the issue. Please provide all the steps implemented up to the point you cannot continue. 

To revert back to V2 services:

1. Open Command Prompt as an administrator.

2. Run the following command 

sc delete DWMySQL3

To create the service for V2 run the following command:

“Adjust the paths as needed for your environment.”
sc create DWMySQL2 binPath= "\"C:\Program Files (x86)\DocuWare\Internal Database V2\bin\mysqld.exe\" --defaults-file=\"C:\Program Files (x86)\DocuWare\Internal Database V2\my.ini\" DWMySQL2" DisplayName= "DocuWare Internal Database V2" start= "auto"

To start the MySQL service by either using Service Control, Windows Services or executing the command:

sc start DWMySQL2

 

Comments (1)
  • It would be helpful if the reference in the 5.7 step to commenting out a line in the My.INI file were highlighted in Red.  I only noticed this after completing the upgrade.  I got past it because the EventLog captured the error.  Then after determining that it didn't belong, I chose to comment it out and succeeded with the upgrade.

    Also, this article appears to assume that it is a newer installation of DocuWare.  Version 6.12 and I believe early versions of 7.x put the data directory in the Program Files (x86)\DocuWare\Internal Database V2 folder.