Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changes latitude and longitude numeric fields for correct comparisons

...

Info
titlePre Gradle version

This page document the usage with Gradle, the pre-Gradle documentation is here: Revisions Requiring Data Migration - upgrade ofbiz


Info
titleRevisions or releases

This a sequential list of revision updates

...

that need additional activities in order to successfully upgrade the revision of your production installation.

If you are interested in a summary by release please read Data Migration by releases

If you are upgrading an existing system, be prepared to run the following commands in the ofbiz home directory:

  • svn up or git pull
  • ./gradlew clean

  • ./gradlew "ofbiz --load-data readers=seed"
  • ./gradlew ofbiz

...

If you are an end-user and a committer who has done something that does not allow you to follow this simple set of steps, please contribute something better, or at the very least complain so committers will better understand your needs.

Committers should make an entry in this list if your revision causes a need for any manual data migration or other update steps in production instances:

  1. A file change which need needs additional unload/reload/convert activities
  2. Any tables which can be deleted(dropped) because they are not used anymore.
  3. Any other required activity to keep your production site operational
Note

Old Data migration services has have been removed from the ofbiz-framework trunk  at r#1792182 and r#1792788

 


R587127:refactored party content

...

R691362 Fix an issue in artifactInfo reported on user ML

R1805961 "Manage life span of marketing related

R691380 Some changes related to GeoPoint have slipped in in r691362

R1805961 "Manage life span of marketing related

  1. Drop the SimpleTaxLookup from you production DB (subsidiary as it's probably already not used)
  2. upgrade to at least R691380 and restart the system.

...

This script should be run intially initially to move values from square_footage to facility_size and set the Uom
UPDATE Facility SET facility_size=square_footage;
UPDATE Facility SET facility_size_uom_id='AREA_ft2';
then the square_footage column might be removed
ALTER TABLE Facility DROP COLUMN square_footage;

...

If you have open production runs before the upgrade then production run costs will not be computed when the order is finalized; in fact, after the upgrade, the system will clone WorkEffortCostCalc from the routing definition to the production run and will only consider the cloned records when the production run is finalized.

...

Before doing this upgrade, make a backup of your framework/images/webapp/images directory because the existing subdirectories will be deleted because of a reorganization. After the upgrade, if you restore these dictories directories your system will work again and images can be found. Mor info at:

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-4194

...

This affects the upgrade of the productKeyword entity. If the content can be re-generated, just run the generate keywords program, if you want to keep the content then see the service: migrateProductKeyword in the file: applications/product/servicedef/services_upgrade.xml for more information

...

  1. export the GeoPoint entity with webtools export.
  2. drop the table
  3. restart the system.
  4. Import the exported file

R1709192 "SalaryStep entity was missing From and Thru dates"
Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-5758

This added the fromDate, createdByUserLogin and lastModifiedByUserLogin fields, fromDate is a PK field.

After upgrade run the 'migrateCustRequestRole' service to copy the current data to the new table (from OldSalaryStep to SalaryStep).

R1738588 "Improved CMS tree: more functionality and faster for large trees"
Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-4502

This added the fromDate, and thru Date fields to the WebSitePathAlias entity, fromDate is a PK field.

It was said in the JIRA that "To migrate existing path aliases the following SQL statements can be used:"

BEGIN;
UPDATE web_site_path_alias SET from_date=w.created_stamp FROM web_site_path_alias w WHERE w.path_alias=web_site_path_alias.path_alias;
ALTER TABLE web_site_path_alias
    DROP CONSTRAINT pk_web_site_path_alias,
    ADD CONSTRAINT pk_web_site_path_alias PRIMARY KEY (web_site_id, path_alias, from_date);
COMMIT;

I quickly tried this in EntitySQLProcessor it does not work. We need instead to provide a migrateWebSitePathAlias migrating service.

 

...


R1647271 Refactoring of Visit/Visitor/ServerHit* (and related) entities in order to be able to maintain them in a database separate from the main transactional database:

Added a new entity group ("org.ofbiz.stats") for the Visit/Visitor/ServerHit* (and related) entities; for now the group is not active so that the entities are still in the same database as before; however assigning them to a different database is now a matter of uncommenting the group file definition in framework/webapp/ofbiz-component.xml and provide the new datasource definition

 Removed foreign key relationship from/to this group of entities and the other entities of the OFBiz data model; the fields are still available but they are not enforced by a foreign key constraint

ALTER TABLE CONTENT_SEARCH_RESULT DROP FOREIGN KEY CNT_SCHRES_VST;
ALTER TABLE TRACKING_CODE_VISIT DROP FOREIGN KEY TKNG_CODVST_VST;
ALTER TABLE CART_ABANDONED_LINE DROP FOREIGN KEY CART_ABLN_VST;
ALTER TABLE SHOPPING_LIST DROP FOREIGN KEY SHLIST_VSTR;
ALTER TABLE PARTY_NEED DROP FOREIGN KEY PARTY_NEED_VSIT;
ALTER TABLE PARTY_DATA_SOURCE DROP FOREIGN KEY PARTY_DATSRC_VST;
ALTER TABLE INVENTORY_ITEM_TEMP_RES DROP FOREIGN KEY INV_ITEM_TR_VIS;
ALTER TABLE PRODUCT_SEARCH_RESULT DROP FOREIGN KEY PROD_SCHRES_VST;
ALTER TABLE OLD_PRODUCT_KEYWORD_RESULT DROP FOREIGN KEY PROD_KWDRES_VST;
ALTER TABLE WORK_EFFORT_SEARCH_RESULT DROP FOREIGN KEY WEFF_SCHRES_VST;
ALTER TABLE OLD_PRODUCT_KEYWORD_RESULT DROP FOREIGN KEY PROD_KWDRES_VST;
ALTER TABLE VISIT DROP FOREIGN KEY VISIT_CIP_STPRV;
ALTER TABLE VISIT DROP FOREIGN KEY VISIT_CIP_CNTRY;
ALTER TABLE VISIT DROP FOREIGN KEY VISIT_CONT_MECH;
ALTER TABLE VISIT DROP FOREIGN KEY VISIT_PARTY;
ALTER TABLE VISIT DROP FOREIGN KEY VISIT_ROLE_TYPE;
ALTER TABLE VISIT DROP FOREIGN KEY VISIT_PARTY_ROLE;
ALTER TABLE VISITOR DROP FOREIGN KEY VISITOR_PARTY;
ALTER TABLE SERVER_HIT DROP FOREIGN KEY SERVER_HIT_STATUS;
ALTER TABLE SERVER_HIT DROP FOREIGN KEY SERVER_HIT_USER;

R1709192 "SalaryStep entity was missing From and Thru dates"
Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-5758

This added the fromDate, createdByUserLogin and lastModifiedByUserLogin fields, fromDate is a PK field.

After upgrade run the 'migrateCustRequestRole' service to copy the current data to the new table (from OldSalaryStep to SalaryStep).

R1738588 "Improved CMS tree: more functionality and faster for large trees"
Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-4502

This added the fromDate, and thru Date fields to the WebSitePathAlias entity, fromDate is a PK field.

It was said in the JIRA that "To migrate existing path aliases the following SQL statements can be used:"

BEGIN;
UPDATE web_site_path_alias SET from_date=w.created_stamp FROM web_site_path_alias w WHERE w.path_alias=web_site_path_alias.path_alias;
ALTER TABLE web_site_path_alias
    DROP CONSTRAINT pk_web_site_path_alias,
    ADD CONSTRAINT pk_web_site_path_alias PRIMARY KEY (web_site_id, path_alias, from_date);
COMMIT;

I quickly tried this in EntitySQLProcessor it does not work. We need instead to provide a migrateWebSitePathAlias migrating service.


R1743656 "Wrong field type for fromDate and thruDate of CustomTimePeriod entity." 
Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-5740

 Changed CustomTimePeriod.fromDate and CustomTimePeriod.thruDate field type from date to date-time.

 
ALTER TABLE CUSTOM_TIME_PERIOD MODIFY COLUMN FROM_DATE datetime, MODIFY COLUMN THRU_DATE datetime;

R1746459 "Remove parentTypeId from InvoiceType data where InvoiceTypeId and parentTypeId are equal"
Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-7147

+R1747223 (minor only screens) "Fix different forms, screens and services affected due to removal of parentTypeId from "PURCHASE_INVOICE" and "SALES_INVOICE" InvoiceType data."

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-7201

You may need to run these SQL expressions:

update invoice_type set parent_type_id = 'INVOICE' where invoice_type_id = 'SALES_INVOICE';
update invoice_type set parent_type_id = 'INVOICE' where invoice_type_id = 'PURCHASE_INVOICE';
update invoice_type set parent_type_id = 'INVOICE' where invoice_type_id = 'TEMPLATE';

R1793300 "Update msyql sql-type for datetime field-type to support Fractional Seconds in Time Values "
Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-9337

Updated sql-type for date-time and time field in fieldtypemysql.xml file,

OFBiz typeold mySql data-typenew mysql data-type
date-timeDATETIMEDATETIME(3)
timeTIMETIME(3)

Please upgrade mysql to at least 5.6.4 or higher.

After upgrade run 'generateMySqlFileWithAlterTableForTimestamps' service, groupName is required field for this service,

It will generate SQL file with alter query statement for date-time and time field at location "${ofbiz.home}/runtime/tempfiles/<groupName>.sql"

You can execute a SQL statement from any of the mysql batch command.

R1804408 "Removed OEMPartyId (manufacturerPartyId) from Product entity as it was remnant of an old approach." 
Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-9368

 SQL query to remove manufacturerPartyId from the database to avoid error in the logs for field count mismatch.

ALTER TABLE PRODUCT DROP MANUFACTURER_PARTY_ID;


R1805961 Manage life span of marketing related entities
Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-9550

This added the fromDate, and thruDate fields to the MarketingCampaignPrice, MarketingCampaignPromo, MarketingCampaignRole entities, fromDate is a PK field.

After an OFBiz start, run the SQL

BEGIN;

UPDATE marketing_campaign_price SET from_date='2000-01-01 00:00:00';

ALTER TABLE marketing_campaign_price

    DROP CONSTRAINT pk_marketing_campaign_price,

    ADD CONSTRAINT pk_marketing_campaign_price PRIMARY KEY (marketing_campaign_id, product_price_rule_id, from_date);

COMMIT;


BEGIN;

UPDATE marketing_campaign_promo SET from_date='2000-01-01 00:00:00';

ALTER TABLE marketing_campaign_promo

    DROP CONSTRAINT pk_marketing_campaign_promo,

    ADD CONSTRAINT pk_marketing_campaign_promo PRIMARY KEY (marketing_campaign_id, product_promo_id, from_date);

COMMIT;


BEGIN;

UPDATE marketing_campaign_role SET from_date='2000-01-01 00:00:00';

ALTER TABLE marketing_campaign_role

    DROP CONSTRAINT pk_marketing_campaign_role,

    ADD CONSTRAINT pk_marketing_campaign_role PRIMARY KEY (marketing_campaign_id, party_id, role_type_id, from_date);

COMMIT;


R1809396:  Fixed ShipmentGatewayConfig and PaymentGatewayConfig entities as we fixed type entities to follow a naming convention.

Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-9696

UPDATE Shipment_Gateway_Config SET shipment_gateway_conf_type_id = 'SHIP_GATEWAY_DHL' WHERE shipment_gateway_conf_type_id = 'DHL';
UPDATE Shipment_Gateway_Config SET shipment_gateway_conf_type_id = 'SHIP_GATEWAY_FEDEX' WHERE shipment_gateway_conf_type_id = 'FEDEX';
UPDATE Shipment_Gateway_Config SET shipment_gateway_conf_type_id = 'SHIP_GATEWAY_UPS' WHERE shipment_gateway_conf_type_id = 'UPS';
UPDATE Shipment_Gateway_Config SET shipment_gateway_conf_type_id = 'SHIP_GATEWAY_USPS' WHERE shipment_gateway_conf_type_id = 'USPS';

UPDATE Payment_Gateway_Config SET payment_gateway_config_type_id = 'PAY_GATWY_SAGEPAY' WHERE payment_gateway_config_type_id = 'SAGEPAY';
UPDATE Payment_Gateway_Config SET payment_gateway_config_type_id = 'PAY_GATWY_AUTH_NET' WHERE payment_gateway_config_type_id = 'AUTHORIZE_NET';
UPDATE Payment_Gateway_Config SET payment_gateway_config_type_id = 'PAY_GATWY_CYBERSRC' WHERE payment_gateway_config_type_id = 'CYBERSOURCE';
UPDATE Payment_Gateway_Config SET payment_gateway_config_type_id = 'PAY_GATWY_EWAY' WHERE payment_gateway_config_type_id = 'EWAY';
UPDATE Payment_Gateway_Config SET payment_gateway_config_type_id = 'PAY_GATWY_PAYFLOWPRO' WHERE payment_gateway_config_type_id = 'PAYFLOWPRO';
UPDATE Payment_Gateway_Config SET payment_gateway_config_type_id = 'PAY_GATWY_PAYPAL' WHERE payment_gateway_config_type_id = 'PAYPAL';
UPDATE Payment_Gateway_Config SET payment_gateway_config_type_id = 'PAY_GATWY_CLRCOMRC' WHERE payment_gateway_config_type_id = 'CLEARCOMMERCE';
UPDATE Payment_Gateway_Config SET payment_gateway_config_type_id = 'PAY_GATWY_WORLDPAY' WHERE payment_gateway_config_type_id = 'WORLDPAY';
UPDATE Payment_Gateway_Config SET payment_gateway_config_type_id = 'PAY_GATWY_ORBITAL' WHERE payment_gateway_config_type_id = 'ORBITAL';
UPDATE Payment_Gateway_Config SET payment_gateway_config_type_id = 'PAY_GATWY_SECUREPAY' WHERE payment_gateway_config_type_id = 'SECUREPAY';
UPDATE Payment_Gateway_Config SET payment_gateway_config_type_id = 'PAY_GATWY_IDEAL' WHERE payment_gateway_config_type_id = 'IDEAL';

R1812383:

Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-9801

After an OFBiz start, run the SQL

Code Block
UPDATE security_group_permission SET from_date='2000-01-01 00:00:00';
ALTER TABLE security_group_permission
  DROP PRIMARY KEY
  ADD PRIMARY KEY (group_id, permission_id, from_date)


R1858479:
Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-10921

Person entity's maritalStatus field has been changed from indicator to Enumeration to manage various classification of legal marital status.
After upgrate migrateMaritalStatusFromIndicatorToEnum service(committed at R1864215) can be used to upgrade existing data of maritalStatus field to the new maritalStatusEnumId.


R1866558:
Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-11182

PicklistStatus replace PicklistStatusHistory (this has been rename OldPicklistStatusHistory) to be support natively by entityauto engine lije other EntityStatus.

After upgrate migrateOldPicklistStatusHistoryToPickListStatus service can be used to forward  historical data present in PicklistStatusHistory to PicklistStatus.


Commits e7b3169, f906994: Rename some connoted words like blacklist and whitelist
Jira
serverASF JIRA

...

serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-

...

 Changed CustomTimePeriod.fromDate and CustomTimePeriod.thruDate field type from date to date-time.

 
ALTER TABLE CUSTOM_TIME_PERIOD MODIFY COLUMN FROM_DATE datetime, MODIFY COLUMN THRU_DATE datetime;

 

...

12168

After upgrate the migrateOldOrderBlacklistAndOldOrderBlacklistType service can be used to forward  historical data from OrderBlacklist and OrderBlacklistType entities to new OrderDenylist and OrderDenylistType entities


Commit d288e12: Change GeoPoint latitude an longitude fields from type short-varchar to fixed-point for correct comparisons https://github.com/apache/ofbiz-framework/pull/220