Restart Retain Service 
systemctl restart retain-tomcat
 
or
service retain-tomcat restart

Debug logging for RetainServer log 
sed -i 's/<logLevel>info/<logLevel>all/g' /opt/beginfinite/retain/RetainServer/WEB-INF/cfg/ASConfig.cfg;systemctl restart retain-tomcat
 

Note: Windows location for ASConfig.cfg
[Drive]:\Program Files\Beginfinite\Retain\RetainServer\WEB-INF\cfg

Turn off Debug logging: 
sed -i 's/<logLevel>all/<logLevel>info/g' /opt/beginfinite/retain/RetainServer/WEB-INF/cfg/ASConfig.cfg;systemctl restart retain-tomcat
 

Reduce Solr8 logging:
sed -i 's/="debug"/="severe"/g' /opt/beginfinite/retain/RetainServer/WEB-INF/solrweb8/WEB-INF/classes/log4j2.xml

Access Stubbing server: 
http://kkbretdb.lab.novell.com:48080/RetainStubServer/login.jsp 

RetainServer port = 48080

How to find Retain version on Linux: 
Look at the /opt/beginfinite/retain/tomcat/logs/RetainServer-[DATE] log
 
Search for STARTUP PROCESS BEGINS
 
Go up a handful of lines and look for example:
 
Apache Tomcat/8.5.32 Retain 4.9.1.0, build=555
 

To view the Solr Index health and status:
https://localhost:8081/hpi/index.html#/~collections/10fd66cc-9e27-4735-b0d0-69f00198ef21_403
The collection ID is unique to each Solr Index server. To find that ID:
---> sometimes be found in the RetainServer Log.
---> It can also be found in /var/opt/beginfinite/retain/backup/ABVDNOWBFZPYNBEMIREJQBSM.ASConfig.setup
-------> Look for <collectionName>
and
---> https://localhost:8081/hpi/index.html
-------> This should redirect to the longer URL, including the collection ID.

To query Solr8 Web Admin for specific subject keyword
change *:* to:
Subject Search: subject_std:test
Message Body Search: filedata_std:test
ID or Parent Node: id:XXXXXXXXX
HPI query to test if the problem is with SOLR or somewhere between RetainServer and SOLR
{!parent which="*:* -_nest_path_:*" v="{!join from=id to=filedata_id score=min v=\"filedata_std:\\\"KEYWORD\\\"\"}"}

=== Use Items to Mark in RetainWorker log ===
[ERROR]
LTE:
GTE:
Logging in as :
Fired: This trigger
Date Chosen ---> this shows the end of an archiving job.

Recreate Index 

1. Change indexingThreads=24, then Shut down Tomcat 
2. Make these changes in ASConfig
 

Delete this section from beginning tag to end tag, including the tags 

<activeIndexEngines> 
</activeIndexEngines>
 

Delete this line

<frontEndSearchEngine class="com.gwava.model.indexing.SolrCloudConfig" reference="../activeIndexEngines/com.gwava.model.indexing.SolrCloudConfig"/> 

Changes these 2 settings from true to false

<initDone>true</initDone> 
<initIndex>true</initIndex>

Changes this setting from false to true 

<initRestConnection>false</initRestConnection> 

3. Rename \index directory 
4. Create index directory
 

Set the index directory permissions to tomcat:www (if on Linux) 

5. start tomcat 
6. Trigger Re-Index

Load RetainServer Web UI

Welcome to Micro Focus Retain → Next → Next → Next → Next → Next → Admin password → Continue → Next → Continue → Log in

Server configuration → Index → Re-index All Messages 

7. Monitor Progress

---> Server Configuration -> Index -> “Index Cluster:”
---> Indexed: <some number>, unindexed: <some number>, failed: <some number>


Increase Indexing Speeds
/opt/beginfinite/retain/RetainServer/WEB-INF/classes/config/solrcloud.indexing.properties
The default indexing threads:
#indexingThreads=0
Changing this to indexingThreads=24 and restarting Tomcat can speed up Indexing if you have more than 4 CPUs.
The max number of CPUs Retain will use is 24. But, with #indexingThreads=0, the most CPUs used for Indexing is 4.
Note: don't confuse this setting with threads.indexing
Restart Retain Tomcat for the change to take effect.

Change this so you don't need to wait 15 minutes to start Indexing after a Retain Service restart:
/opt/beginfinite/retain/RetainServer/WEB-INF/classes/config/misc.properties
query.interval.unindexed.messages=15
Change the 15 to 1
query.interval.unindexed.messages=1
After all Indexing is done, change the value back to 15.

Speed up Retain Searches (or possibly resolve inability to Search)
C:\Program Files\Beginfinite\Retain\RetainServer\WEB-INF\classes\config\misc.properties
/opt/beginfinite/retain/RetainServer/WEB-INF/classes/config/misc.properties
Set all these zero:
search.suggestions.rows=30
search.suggestions.to.display=15
search.suggestion.corrections.to.display=5
enable.autosearch=1

Set both of these to 1:
disable.sticky.searches=0
disable.facets=0

Restart Retain

If Server has 64GB total memory, the following MySQL and Tomcat memory configuration is reasonable:
/etc/my.cnf
Orig: innodb_buffer_pool_size = 128M
New: innodb_buffer_pool_size = 8G
rcmysql stop
rcmysql start

/etc/opt/beginfinite/retain/tomcat/j2ee
Orig: CATALINA_OPTS="-Xms4g -Xmx16g -Xss1024k"
New: CATALINA_OPTS="-Xms6g -Xmx24g -Xss1042k"
service retain-tomcat restart

To move logging location within Windows using CMD:
Shutdown the Retain Service
Run CMD as Administrator Mode
Move all logs from the C:\Program Files\Beginfinite\Retain\Tomcat\logs location to the new location: F:\Logs
Ensure the Logs folder doesn't exist in the C:\Program Files\Beginfinite\Retain\Tomcat\logs path.
mklink /J "C:\Program Files\Beginfinite\Retain\Tomcat\logs" “F:\Logs
Start the Retain Service

To move logging location within Windows using PowerShell:
Shut down the Retain Service
Move all logs from the C:\Program Files\Beginfinite\Retain\Tomcat\logs location to the new location: F:\Logs
Run this command:
New-Item -ItemType Junction -Path "C:\Program Files\Beginfinite\Retain\Tomcat\logs" -Target "F:\Logs"
Start the Retain Service

Kill Retain Tomcat on Windows
sc queryex tomcat9
taskkill /f /pid [PID]

To move logging location within Linux:
Shutdown the Retain Service
Move all logs from the /opt/beginfinite/retain/tomcat/logs location to the new location:
Use symlinks for Linux
ln -s <current log path> <new log path>
Start the Retain Service

RetainServer / Indexer / RetainWorker log locations
C:\Program Files\Apache Software Foundation\Tomcat\logs
/opt/beginfinite/retain/tomcat/logs

Catalina log location:

/var/log/retain-tomcat/

How to Manually switch Solr7 to Solr8
Make copy of ASConfig.cfg
systemctl stop retain-tomcat
cp /opt/beginfinite/retain/RetainServer/WEB-INF/cfg/ASConfig.cfg /opt/beginfinite/retain/RetainServer/WEB-INF/cfg/ASConfig-20230123.cfg
vi /opt/beginfinite/retain/RetainServer/WEB-INF/cfg/ASConfig.cfg
Delete this Solr 7 portion
<com.gwava.model.indexing.SolrCloudConfig>
to
</com.gwava.model.indexing.SolrCloudConfig>
There will be a near identical section for Solr8.
Change isFrontEndIndex to true within the Solr8 section
systemctl start retain-tomcat

Precautionary steps when upgrading Retain version:
Shutdown mysql and retain
Rename the /opt/beginfinite/retain directory
   mv /opt/beginfinite/retain/ /opt/beginfinite/retain-20230126
If you want Java to be re-installed, then rename the j2ee file
   mv /etc/opt/beginfinite/retain/tomcat/j2ee /etc/opt/beginfinite/retain/tomcat/backup-j2ee-20230126
If you want Tomcat to be re-installed, then add a line to the RetainInstall.sh script
   INSTALL_TOMCAT="1"
Add this above this line:
   if [ "$INSTALL_TOMCAT" = "1" ]; then
   Note: this change will trigger a fresh install of Tomcat
Run the install script.
Stop Retain Tomcat
Copy the backed up ASConfig.cfg to the active location:
cp /opt/beginfinite/retain-20230126/RetainServer/WEB-INF/cfg/ASConfig.cfg /opt/beginfinite/retain/RetainServer/WEB-INF/cfg/
Start Retain Tomcat
Log into RetainServer WebUI with admin.

Correct Redirect URI when configuring Modern Auth within the Azure Active Directory:
https://<retainDNSorIP>/RetainServer/Server/openidConnect.jsp

Command to dump database in preparation to move/import to another server:
mysqldump --default-character-set=utf8mb4 --skip-opt --no-create-info --add-locks --disable-keys --complete-insert --extended-insert --single-transaction --quick --skip-set-charset --order-by-primary --routines=0 --triggers=0 --events=0 --host=localhost --user=root –password=<password>; retain >d:\temp\Filename.sql

To simplify the Advanced Search features (troubleshoot search issues):
systemctl stop retain-tomcat;cp /opt/beginfinite/retain/RetainServer/WEB-INF/classes/config/misc.properties /tmp;sed -i 's/search.suggestions.rows=30/search.suggestions.rows=0/g' /opt/beginfinite/retain/RetainServer/WEB-INF/classes/config/misc.properties;sed -i 's/search.suggestions.to.display=15/search.suggestions.to.display=0/g' /opt/beginfinite/retain/RetainServer/WEB-INF/classes/config/misc.properties;sed -i 's/search.suggestion.corrections.to.display=5/search.suggestion.corrections.to.display=0/g' /opt/beginfinite/retain/RetainServer/WEB-INF/classes/config/misc.properties;sed -i 's/enable.autosearch=1/enable.autosearch=0/g' /opt/beginfinite/retain/RetainServer/WEB-INF/classes/config/misc.properties;sed -i 's/disable.facets=0/disable.facets=1/g' /opt/beginfinite/retain/RetainServer/WEB-INF/classes/config/misc.properties;sed -i 's/disable.sticky.searches=0/disable.sticky.searches=1/g' /opt/beginfinite/retain/RetainServer/WEB-INF/classes/config/misc.properties;systemctl start retain-tomcat

/opt/beginifinte/retain/RetainWorker/WEB-INF/classes/config/attachment.properties
---> Default:
---> max.errors.total=10
---> If mailbox has more than 10 errors, then the job skips that mailbox and goes to the next. If this occurs, there is a good chance that mailbox will always be skipped.

---> Suggestion:
---> max.errors.total=-1
---> This will allow infinite number of errors. Even though date flag doesn't get advanced, the rest of the messages are archived.

---> Default:
---> Don't advanced the timestamp if there is an error.
---> job.advance.errors=0

---> Advance timestamp even if there is an error.
---> job.advance.errors=1

Useful Queries
List of all the mailboxes along with message count and the last item stored.
MSSQL

SELECT
MAX(f_lmailbox) AS 'Mailbox Name',
MAX(f_email) AS 'Email Address',
MAX(f_dn) AS 'User Name',
DATEADD(S, MAX(ts_store), '1970-01-01') AS 'Most Recently Archived Message',
COUNT(DISTINCT(tm.message_id)) AS 'Number of Messages Stored'
FROM t_message tm
INNER JOIN t_uuid_mapping tum ON tm.uuid_mapping_id = tum.uid_mapping_id
INNER JOIN t_abook ta ON ta.f_uid = tum.f_uuid
GROUP BY abook_id
ORDER BY COUNT(DISTINCT(tm.message_id)) ASC

Example query to find all message with the subject containing test and sender = bobj@kkbgw18.lab.novell.com
SELECT * FROM t_message WHERE f_subject LIKE '%test%' AND f_sender = 'bobj@kkbgw18.lab.novell.com';

Example query to find all message with the subject = RE: Question and sender = Cath.Mc@whatever.gov
SELECT * FROM t_message WHERE f_subject = 'RE: Question' AND f_sender = 'Cath.Mc@whatever.gov';

Find a message with the Parent Node (as found in the properties) of 20603766
SELECT * FROM t_message WHERE message_id = '20603766';

To view the f_indexed value for a particular message (identified by message_id):
SELECT * FROM t_message WHERE message_id = '34916157';

To change the f_indexed value from any value to 0 for a specific message:
UPDATE t_message SET f_indexed = 0 WHERE message_id = 34916157;

Show the number of items with an f_index value of 64:
SELECT COUNT(1) FROM t_message WHERE f_indexed = 64;

Change every item with an f_indexed value of 64 to a value of 0:
UPDATE t_message SET f_indexed = 0 WHERE f_indexed = 64;


Helpful MySQL Commands:
Login:
mysql -uroot -p
show database;
use retain;
SELECT f_indexed, COUNT(message_id) FROM t_message GROUP BY f_indexed;
Example output:
+-----------+-------------------+
| f_indexed | COUNT(message_id) |
+-----------+-------------------+
| 3 | 61876526 |
| 64 | 4044574 |
| 256 | 290 |
+-----------+-------------------+
3 rows in set (3 min 55.29 sec)

0 = Unindexed (yet to be indexed)
If there is a lot unindexed messages, then somebody may have clicked the button to re-index
2 = Indexed prior to Solr8
3 = Indexed (done indexing) Solr8 indexed items
Anything higher than 3 also is done being processed, but not indexed (likely due to Retain not understanding the format).
16 = General indexing error
64 = Not index-able (images, encrypted files, etc)
256 = An exception. We don't know what this is. Text extraction we could not perform for that file type.

To view if a query is actively running:
show processlist;

If you delete the Index9 data, and rebuild, you need to set the already indexed items (f_indexed=4) back to 0 so Retain knows to Index them again.
UPDATE t_message set f_indexed=0 WHERE f_indexed=4;

Steps to delete a module which has never archived data
Important: If the module has archived data (even unintentionally archived data), DO NOT DELETE IT.
Check if "options" exist on the module:
SELECT * FROM t_modopt where f_option_id = <MOD_ID>;

If stuff shows, then delete it using this command:
DELETE FROM t_modopt where f_option_id = <MOD_ID>;

Set the Address Book associations from the new (blank) module, to the original module.
UPDATE t_abook SET f_mid = <MOD_ID_OLD> WHERE f_mid = <MOD_ID_NEW>;

Delete the Module using this command:
DELETE FROM t_modules where f_id = <MOD_ID>;

Restart Tomcat Service

SLES 12 Support Matrix:
4.6 is supported on SLES 12 SP2
4.7 is supported on SLES 12 SP1 thru SP3
4.9 is supported on SLES 12 SP4
4.11 is supported on SLES 12 SP4

SLES 15 Support Matrix:
4.6 is NOT supported on SLES 15
4.7 is supported on SLES 15
4.9 is supported on SLES 15
4.11 is supported on SLES 15 SP3

Training repository: 
server = 151.155.220.200 
user = gwsupport
 
password = novell
 
directory = /data/tools-scripts/Old Training files/Matt's Retain Training Videos
 

Download Retain  
https://download.gwava.com/download.php?product= 
https://download.gwava.com/retain/Retain4920ga_469.zip  

ESXi server: 
bobjohnson1.lab.novell.com
 
151.155.221.126
 
root
 
novell@123
 

GW18 server: 
kkbgw18.lab.novell.com
 
151.155.222.204
 
admin and root
 
novell
  

Command to import certificate between RetainWorker and RetainServer https connection:
/opt/beginfinite/retain/java/jdk-11.0.13+8/bin/keytool -import -noprompt -trustcacerts -alias retainCert -file /etc/apache2/ssl.crt/kkbretdb.lab.novell.com-server.crt -keystore cacerts -storepass changeit

Retain and MariaDB
 
kkbretdb.lab.novell.com
 
151.155.222.205
 

QA Retain Server (Don't modify!)
 
https://retain2.qa.gwava.com/RetainServer/Manager/menu.jsp
 
admin Gwava!!
  

==== Retain Training Notes ========== 
Lucene 
 
OpenSource index technology. It helps create tools to push data into Lucene.
 

SOLR  
application that integrates with Lucene.
 
Standalone Java application.  Loads with it's own tomcat instance (part of the retain tomcat)
 

Retain Talks to SOLR over HTTP requests.   
SOLR can be on a different box than Retain.  
 

ZooKeeper another Apache project.
 
Manages the failover and other pieces of SOLR and Lucene. With Retain, we have a single node.  So, ZooKeeper doesn't do a lot.  Sometimes causes problems.
 

If Retain can't make connection to SOLR, Retain is not functional.
 

Index Optimization is much like a Disk Defrag.  It is helpful, but not that helpful.
 

Retain Training Info
https://traininggwava.microfocus.net/index.php/Retain_Indexing
====== Retain Specialties =======
 

Matt:

QA for Retain 
Search Indexer 
 
GroupWise 
 
Licensing 
 
Export to PST and PDF
 

Christoff 

Office365 
Exchange
 
SOLR
 
GroupWise
 

Perry 

Under Ernie 
Cloud Customers
 
Office365 and Exchange 
 

Dave R. 

Product Owner (like a Product Manager) 
Decides Priority
 
Used to be Architect
 
Security lead
 

Ernie 

Cloud Customers 
Good General knowledge
 
More comfortable with Linux
 

==== Add Retain defect to the Confluence page ===
Have the Octane link to your defect ready to paste into step 6 below
Go to: https://confluence.gwava.com/display/PROC/Supports+Highest+Priority+Bugs+for+Retain
Click Edit in the upper right corner
Add your defect's description to the list in the top section
Highlight the defect description and click on the link symbol in the ribbon/bar above
Click Web link and paste the Octane URL into the Address field
---> Click Insert (When I did this, the Insert did not become active until I scrolled to the beginning of the URL in the address field.)
---> Click Save in the lower right corner and you are done
Dave will review the list and update the entry to include a status similar to those you see in the other defects.