I run a small enterprise and I doubt our needs are unusual. We would like to run trunk and stay (more or less) current. We're running postgresql as a backend. I'm hoping to automate (as much as possible) the update process. I'm hoping to implement a few things not provided in the standard demo setup.
1) I need to backup the database nightly, so that our daily work doesn't get lost (doh!). I can use pg_dump for that, but of course it backs up the entire database, including seed, admin-user-login, and site-specific data. I could also use the webtools dump, which I assume does the exact same thing but in XML, which is a good deal larger in file size. However, webtools won't write an XML file for an empty table, while pg_dump would write a structure definition for that table. Probably pg_dump would be a good deal faster. Size and speed issues aside, it seems that neither method differentiates in any way between seed and non-seed data. Am I correct here? 2) To effectively use the webtools backup, I would need to automate it from a cron job. Is there an easy way to call ofbiz services from the command line, or do I need to schedule a job within OFBiz to do this kind of thing? What are the pros and cons of a system cron job vs. a scheduled job in OFBiz? 3) I need a log of what version I was running when. For example, if I update weekly, and on Sunday night I roll forward to the latest trunk revision 970999, and it breaks something, I need to have a log that tells me that Friday (when it worked) I was running 970888, so I can roll back to that revision, until I get the kinks worked out with the upgrade. Otherwise I have to restore from a dated backup, which I can always do, but it seems that a simple "svn checkout 970888; ./ant build" might be cleaner. I'm assuming that after updating the code with "svn checkout" I can log the date/time to a file with the output of "svn info". 4) If a revision requires a database update or modification, I would like to know about it in advance, and make sure that manual modification is completed before the upgrade. I'm assuming what I need there should always be found in: https://cwiki.apache.org/confluence/display/OFBTECH/Revisions+Requiring +Data+Migration 5) I would like to update all seed data in place (postgresql) without overwriting the rest of the (non-seed) data. Will executing "./ant run-install-seed" overwrite the EXISTING seed data in a production database without affecting the non-seed data? Or it it only intended for use on an empty database, as all the examples I have found do? If the latter, how do you restore only the NON-seed data after a seed data initialization? Are there any other bear traps or best practices that I should be aware of? Or is this stuff documented somewhere that I have not found? There was a discussion of it (at least the seed vs. demo data issue) about a year ago on this list, but I didn't see these specific questions answered. Or am I overly optimistic about the possibility of updating a production system regularly as OFBiz trunk changes? Thanks in advance.
