3.0 Migration Guide
In this document, we will see the major steps to migrate from 2.8 to 3.0.
| Please check the change log for detailed list of fixes, changes and improvements introduced in 3.0. |
Database migration
Migration scripts are available there.
Cleaning up duplicate documents
In the former versions, the generated documents with Template were stored twice in the database and the file system.
Two scripts are provided to help identify and clean up the duplicates (which were unreachable by the application anyway). This allows you to reclaim the wasted disk space.
Step 1: Identify and delete duplicate records
The SQL script delete-duplicated-documents.sql identifies pseudo-duplicate documents.
To run the script:
psql -d your_database -f delete-duplicated-documents.sql
This script will:
-
List all duplicate documents found
-
Delete duplicate records from
meta_file,dms_file, andmeta_attachmenttables -
Export the list of duplicate file paths to
files_to_delete.txt
| This script permanently deletes the duplicated records from the database. Make sure to backup your database before running it. |
Step 2: Delete duplicate files from the filesystem
After running the SQL script, use the bash script delete-files.sh to remove the duplicate files from the filesystem.
Usage:
# Dry-run mode (preview what will be deleted)
./delete-files.sh \
--base-dir /path/to/upload/directory \
--file-list /files_to_delete.txt \
--dry-run
# Actual deletion
./delete-files.sh \
--base-dir /path/to/upload/directory \
--file-list /files_to_delete.txt
Parameters:
-
--base-dir(required): The base directory where uploaded files are stored -
--file-list(required): Path to the file containing the list of files to delete -
--dry-run(optional): Preview mode - shows what would be deleted without actually deleting files
The script will:
-
Read the file list
-
Delete each file from the filesystem
-
Display a summary of deleted files, files not found, and errors
-
Clean up the file list if all deletions were successful
Breaking Changes
| If you have not overridden the code of template module, you can ignore this section. |
Upgrade dependencies
Due to AOP upgrade to java 21, the following dependencies have been upgraded:
-
axelor-utilsto 4.0.0 -
axelor-messageto 4.0.0 -
axelor-studioto 4.0.0 -
axelor-guardianto 3.0 -
axelor-template-libraryto 3.0.0 -
okhttpto 5.3.0 -
mockito-coreto 5.20.0 -
lombokto 1.18.42 -
java-jwtto 4.5.0 -
javax.websocket-apiis replaced byjakarta.websocket-client-api2.2.0 -
AOP to 8.0.0
-
Java to 21
-
Tomcat to 10
-
Gradle to 8.14.3
Enums Relocations
The enums ApiEndpoint and ApiEndpoint have been moved from com.axelor.template.enums to com.axelor.templateapi.enums.
Data Transfer Objects Relocations
| DTO | Replaced by |
|---|---|
|
|
|
|
|
|
Constants Relocations
The following constants have been moved from TemplateExceptionMessage to TemplateApiClientExceptionMessage:
-
UNEXPECTED_DEFAULT_TRUST_MANAGERS -
FAILED_TO_CREATE_NEW_HTTP_CLIENT -
NO_UUID_RETRIEVED -
CANNOT_DELETE_TEMPLATE -
CANNOT_DELETE_DOCUMENT -
CANNOT_FETCH_STATUS
Constants Removal
The following constants have been removed from the class TemplateExceptionMessage
-
AUTH_FAILED -
RESPONSE_BODY_IS_NULL
Methods Relocation
| Method | From | To |
|---|---|---|
findOutputFormats |
TemplatePrintModelOutputService |
OutputFormatHelper |
generateTargetField |
ExpressionBuilderService |
ExpressionBuilder |
addTargetField |
ExpressionBuilderService |
ExpressionBuilder |
The services TemplatePrintModelOutputService and ExpressionBuilderService have been removed
Templates management
The methods managing models on TemplateApiService have been replaced by new methods in com.axelor.templateapi.helper.UploadHelper:
| Old method | New method |
|---|---|
|
|
|
|
|
|
|
|
Printing
The methods managing printing on TemplateApiService have been replaced by new methods in com.axelor.templateapi.helper.PrintingHelper:
| Old method | New method |
|---|---|
|
|
|
|
|
|
-
The method
PrintRequestService.fetchRequestStatus()has been replaced byPrintingHelper.getStatus(TenantApiUser, String)
Classes relocation
| Old class | New class |
|---|---|
|
|
|
|
|
|
ExpressionBuilder entity
-
The entity
ExpressionBuilderis removed -
The field
fieldis moved toTemplateSettingsLine -
The other fields defined within
ExpressionBuilderare no longer stored in the database. They are replaced by dummy fields.
Limit exceed removal
To improve the user experience, the notification process for exceeding printing limits has been removed.
Admins can still monitor printing usage and consumption directly from the dashboard.
As a result of this change, the following elements have been removed:
-
The method
TemplatePrintController.checkLimit -
The constant
TemplateExceptionMessage.LIMIT_EXCEEDED_ALERT -
The action
action-template-print-method-check-limit