This page is for ofbiz developers and users
Upgrading the OfBiz code
- In the old version go to webtools
- do a "XML Export Data All", save the files, make another copy to work with
- Go to "Check/Update Database"
- Remove all tables
- stop OfBiz
- Upgrade the OfBiz code
- ant build the source
- Install the seed data - (java -jar ofbiz.jar -install seed)
- start OfBiz
- Login with the default admin account/passwd
- go to webtools/"Check/Update Database"
- Remove all primary keys
- Remove all Foreign Keys
- "XML Data Import Dir" - point it to the working XML dump files you created at the beginning
- Keep running this on the same directory with "Delete Files Afterwards?" checked.
- You can do a ls on the dir to see the progress
- When it's done you can create the primary keys and foreign keys again.
- Keep running this on the same directory with "Delete Files Afterwards?" checked.
- Take a look around and see if all the data is there as you expect
We use
- postgresql but
- upgrade from 3.0 used a long ago was done doing all the import/export via XML.
Ofbiz version in use is tag 3.2.0
That means
- http://svn.ofbiz.org/svn/ofbiz/tags/3.2.0 is already used in the production system (not fully tested)
- http://svn.ofbiz.org/svn/ofbiz/trunk was used earlier as a misunderstanding of ofbiz releases (only 3.0 showed up as downloadable file, so we used svn: but ofbiz site only referred to the "trunk", not the tagged 3.2.0)
Inventory Problems Solved - fixed now.
I finally took the time to subscribe to their list. I made a [ report] and sent them the relevant exported XML records. Guess what: it was fixed within an hour ! No comments.
The rest is history
After serious problems we decided to drop all the inventory records.
Probably semantics changed somewhat.
Currently all the (newly entered) variances can be listed, but
- when we're concerned about the inventory items of a facility, sum is shown as "/" for all products
- when we're concerned about the inventory items of product, sum is shown as 0 for all facilities
To prevent incompatibilities while importing data I excluded these:
- InventoryEventPlannedType.xml
- InventoryItemDetail.xml
- PhysicalInventory.xml
- InventoryItem.xml
- InventoryItemVariance.xml
Previous attempt to import inventory - note that we don't care about loosing inventory data any more. We just want to use ofbiz and enter inventory from ground up. But other important data should not be lost (Visits and other secondary entities are also not important to migrate).
For future, I would still care what would be the proper way to upgrade with keeping Inventory data.
Examine if this entity XML OK, or a different format is needed for recent ofbiz:\nÿ1ÿ
we also have physical inventory records like:\nÿ2ÿ
Foreign key problems during import - solved
Circular dependencies - these are the cause the foreign key problems
- there are even circular dependencies because of the UserLogin entity field "creator of the entity id - party".
- circular deps inside ProductCategory (parent category reference to self)
- As [this] points out, the [drop foreign-key hack] is ugly. But I did the steps, and it works. Don't be afraid of dropping foreign keys (the data is kept, and it could be recreated later).
Primary key problems - under investigation.
Suspicion is that holes in the primary key sequences (that can happen when deleting entities; also I dropped some entities at an earlier import) confuse the pk-generation.
Here is a pk () issue when adding a simple phone number type contact to a party:\nÿ3ÿ
After reposting the form several times once it just worked - misterious. Sly and Marcell experienced the same. Maybe simultaneous access caused the problem (pk-generation returned the same for both visitors?). We only have one ofbiz. instance.
Earlier problems: learn from these
- using mysql : does not properly enforce constraints. Use postgresql
- Editing and ordering files manually to prevent foreign-key issues: dropping the foreign keys while importing is less laborsome :-) The directory import/export that did not exist in 3.0.0 version really makes all importing/data transfer work easier.
- working on distant machine: serious work (such as many new products categorized) should be done on the test system and imported from XML (trivial) or via the EntitySync feature (how exactly?)
- ...
See
- [upgrade in ofbiz wiki]
- WebShop/UnderDevelopment/OfBiz
- I ask in [ofbiz wiki] about the inventory issue. I also drop a mail to their dev list.