Hi everyone,
I started using a DMS in 2009. I migrated to OpenKM in 2017. I had been running OpenKM on a VM with 4G of memory for the last 6 years. My VMWare ESXi server is getting old and I need to replace it.
I decided to go small footprint via a 2-bay NAS. I picked the QNAP TS-262 since it had an Intel processor and same amount of memory I always gave OpenKM. This was my first NAS. However, it is Linux based and I was confident enough with my Linux skills to make it work somehow.
It turned out to be a smooth process. So much so, I thought I would post my notes for others if needed. The following is what I did.
For a new or factory reset unit, I accessed the NAS via a web browser and started the "Smart Start Installation".
Once logged in, opening "Storage and Snapshots", the welcome wizard gives choices of "storage pool and thick/thin volume" or "static volume". A "static volume" is easier on memory, so I canceled the default wizard and clicked "New Volume" and picked "Traditional Configuration" and followed the wizard for RAID 1.
From "Control Panel"->"Privelege"->"Users", using "Advanced Settings"->"Home Folder", I enabled home folders for the new volume.
Via "Control Panel"->"Network and File Services"->"Telnet / SSH", I enabled SSH by checking "Allow SSH Connection"
I opened "App Center" and after the wizard I then used the search in upper right to find "mariadb".
I installed "MariaDB 5" and when ready, opened it and configured via wizard. I made note of the root password.
I searched for and installed "Container Station". When ready, I open it and configure via wizard.
Using my favorite SSH client, I connected to the QNAP using the ID I created during the "Smart Start Installation". I switched to admin/root account via:
I needed a home for the admin account, using command:
Created the OpemKM database via:
I open "Container Station" and clicked "openkm-ce-1" to open it. I could see the console messages.
If no issues, I accessed OpenKM via:
http://IPorDNSofNAS:1080
Once working, I opened settings for the "openkm-ce-1" container and enabled "Auto Start".
I was done!
Backups can be performed by these commands (modifying path and password as needed):
I wish to thank the OpenKM team for all their work and dedication over the years.
Amer1
I started using a DMS in 2009. I migrated to OpenKM in 2017. I had been running OpenKM on a VM with 4G of memory for the last 6 years. My VMWare ESXi server is getting old and I need to replace it.
I decided to go small footprint via a 2-bay NAS. I picked the QNAP TS-262 since it had an Intel processor and same amount of memory I always gave OpenKM. This was my first NAS. However, it is Linux based and I was confident enough with my Linux skills to make it work somehow.
It turned out to be a smooth process. So much so, I thought I would post my notes for others if needed. The following is what I did.
For a new or factory reset unit, I accessed the NAS via a web browser and started the "Smart Start Installation".
Once logged in, opening "Storage and Snapshots", the welcome wizard gives choices of "storage pool and thick/thin volume" or "static volume". A "static volume" is easier on memory, so I canceled the default wizard and clicked "New Volume" and picked "Traditional Configuration" and followed the wizard for RAID 1.
From "Control Panel"->"Privelege"->"Users", using "Advanced Settings"->"Home Folder", I enabled home folders for the new volume.
Via "Control Panel"->"Network and File Services"->"Telnet / SSH", I enabled SSH by checking "Allow SSH Connection"
I opened "App Center" and after the wizard I then used the search in upper right to find "mariadb".
I installed "MariaDB 5" and when ready, opened it and configured via wizard. I made note of the root password.
I searched for and installed "Container Station". When ready, I open it and configure via wizard.
Using my favorite SSH client, I connected to the QNAP using the ID I created during the "Smart Start Installation". I switched to admin/root account via:
Code: Select all
I selected "Q" and respond "Y" for command prompt.sudo -i
I needed a home for the admin account, using command:
Code: Select all
I configureed "MariaDB 5" using "vi". Hitting "i" for insert then to save and quit, hitting the esc key and typing ":wq":mkdir $HOME
Code: Select all
Found and edited the "default-storage-engine" to be:vi /etc/config/my.cnf
Code: Select all
Found the "[client]" section and added the line:default-storage-engine = innodb
Code: Select all
Found the "[mysqld]" section and added the lines:default-character-set = utf8
Code: Select all
Saved the file and quit. Restarted MariaDB via:character-set-server = utf8
collation-server = utf8_general_ci
Code: Select all
Entered the MariaDB console via:/etc/init.d/mariadb5.sh stop; /etc/init.d/mariadb5.sh start
Code: Select all
Checked the DB engine via:DEF_VOL=$(/sbin/getcfg SHARE_DEF defVolMP -f /etc/config/def_share.info)
$DEF_VOL/.qpkg/MariaDB5/bin/mysql -h localhost -u root -p
Code: Select all
InnoDB should be default with all features as "YES".show engines;
Created the OpemKM database via:
Code: Select all
Created the openkm account. Edited the password in the following command. Note the network location because containers run in a different subnet. CREATE DATABASE okmdb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
Code: Select all
Granted the account full access to the DB and exited via:CREATE USER openkm@'10.0.%' IDENTIFIED BY 'MyPassword';
Code: Select all
Pulled down the latest OpenKM image via: GRANT ALL ON okmdb.* TO openkm@'10.0.%' WITH GRANT OPTION;
exit;
Code: Select all
Created a container that forwards the NAS port 1080 to the container's port 8080.$DEF_VOL/.qpkg/container-station/bin/docker pull openkm/openkm-ce:latest
Code: Select all
Got the local OpenKM config files and made a backup copy.$DEF_VOL/.qpkg/container-station/bin/docker create --name openkm-ce-1 -p 1080:8080 openkm/openkm-ce
Code: Select all
Edited the config file and commented (via #) out H2 and un-commented MySQL5. Make sure the "hibernate.hbm2ddl" line says "create".cd ~
$DEF_VOL/.qpkg/container-station/bin/docker cp openkm-ce-1:/opt/tomcat/OpenKM.cfg OpenKM.cfg
$DEF_VOL/.qpkg/container-station/bin/docker cp openkm-ce-1:/opt/tomcat/conf/server.xml server.xml
mkdir originals
cp * originals
ls -l originals
Code: Select all
Edited the server file and commented (via <!-- and ..>) out the H2 driver and un-commented the MySQL driver. Replace localhost with the name or ip address of the NAS and edit the password for openkm.vi OpenKM.cfg
Code: Select all
Copy the config files back to the container via:vi server.xml
Code: Select all
Start the container:$DEF_VOL/.qpkg/container-station/bin/docker cp OpenKM.cfg openkm-ce-1:/opt/tomcat/OpenKM.cfg
$DEF_VOL/.qpkg/container-station/bin/docker cp server.xml openkm-ce-1:/opt/tomcat/conf/server.xml
Code: Select all
Kept the SSH session open should I needed to make any corrections. I returned to the web page.$DEF_VOL/.qpkg/container-station/bin/docker start openkm-ce-1
I open "Container Station" and clicked "openkm-ce-1" to open it. I could see the console messages.
If no issues, I accessed OpenKM via:
http://IPorDNSofNAS:1080
Once working, I opened settings for the "openkm-ce-1" container and enabled "Auto Start".
I was done!
Backups can be performed by these commands (modifying path and password as needed):
Code: Select all
If anyone has any ideas for improvements or additions, please comment. DEF_VOL=$(/sbin/getcfg SHARE_DEF defVolMP -f /etc/config/def_share.info)
OPENKMDEST=$DEF_VOL/homes/shared/openkm
$DEF_VOL/.qpkg/container-station/bin/docker stop openkm-ce-1
rm -r $OPENKMDEST/repository
$DEF_VOL/.qpkg/container-station/bin/docker cp openkm-ce-1:/opt/tomcat/repository $OPENKMDEST
$DEF_VOL/.qpkg/MariaDB5/bin/mysqldump -h localhost -u root --password='MyPassword' okmdb > $OPENKMDEST/okmdb.sql
$DEF_VOL/.qpkg/container-station/bin/docker start openkm-ce-1
I wish to thank the OpenKM team for all their work and dedication over the years.
Amer1