MigrateToOpsV03

Introduction

There is a new ldap schema as of ops_project version 0.3 and ops_admin version 0.4. A java application called ldap_migration has been set up to rewrite the contents of ldap in order to make them compatible with the new schema. You can get the migration package as a jar from the OPS Source Forge homepage at https://sourceforge.net/projects/ops/ This walktrough is a copy of the packages readme file.

Changes

From OPS Admin version 0.4 and up, project tasks are grouped under quote tasks, ie 'what the costumer was promised'. Quote tasks have a time estimate, their constituent actual tasks have two time estimates: total and todo. Because of these changes a new ldap schema is introduced for ops_admin0.4/ops_project_0.3. Changes: removed in new schema:

  • attributetype 'task'
  • attribute 'task' from project
  • objectclass 'opsProjectTask'

added in new schema:

  • attributetype 'quoteEstimate'
  • attributetype 'totalEstimate'
  • attributetype 'todoEstimate'
  • objectclass 'opsProjectQTask'
  • objectclass 'opsProjectITask'

To complete the migration you will have to restart your ldap server (twice) and run the jar, see below.

HOW-TO

Migrate your back-end in 7 easy steps.

Step 0: get the package

Download the migration package as a jar from the OPS Source Forge homepage at https://sourceforge.net/projects/ops/

Step 1: setup

In the src/main/java/context.xml file fill out the details for your ldap server (examples in parenthesis):
  • url (ldap://ldap.openprojectservices.org)
  • base dn (dc=openprojectservices,dc=org)
  • admin location in ldap (cn=admin,dc=openprojectservices,dc=org)
  • password (MyLdapPassword? )

By default the application will create a Quote Task called "Offerte" and save all the tasks as Implementation Tasks of that Quote Task. Check that your project has no tasks called "Offerte" or else everything will go wrong. If you want a different name, change the qTaskName in context.xml but make sure the name does not exist as a taskname already.

Step 2: repackage the jar

repackage the jar from the command line by typing: mvn package

Step 3: make ldap copy

Store a copy of your ldap for recovery purposes.
  • Stop ldap: /etc/init.d/slapd stop
  • Export your ldap tree: slapcat -l myldap.ldif

Step 4: restart ldap

restart ldap with the intermediate schema:
  • Copy intermediate-ldapschema.txt and ops_ldapschema0.3.txt to your ldap schema location (/etc/ldap/schema)
  • Edit /etc/ldap/slapd.conf to include the intermediate-ldapschema.txt instead of ops-projectserver-ldapschema-0.2.txt
  • Restart your ldap server: /etc/init.d/slapd start

The intermediate schema is compatible with both pre- and post- ops_admin0.4/ops_project_0.3 contents.

Step 5: run

Run the assembled jar form commandline (this is the larger of the two jars): java -jar target/ldap_migration-assembled.jar

Step 5a: check

If the program completed without errors your ldap contents are migrated. Read the logfile at logs/migration.log for more information.

Step 6: restart

If the program exited without errors restart with the new schema. Your ldap should be compatible now with the new schema. Restart your ldap server with the new ldap schema found at the project's root: ops_ldapschema0.3.txt

Messages, warnings and exceptions

Exceptions

In the following cases the program will exit with an error:
  • If more then one project has the same guid. If this happens either remove the project or change its guid, then run the program again.
  • If the project was removed from ldap between retrieval and storage. Run again.
  • Project's original tasks or attribute tasks were not deleted succesfully. Do not run again, manually check your ldap to see what went wrong. Or run the program again on a recovered copy of the original ldap.
  • If something went wrong with rewriting the existing tasks to the new tasks. This should not happen, revert to recovered copy.
  • If a project does not have a name or quid (this should never occur because name and guid are required attributes according to the ldap schema).

Other messages

Any of these messages only inform you of the programs progress and the state of your ldap, none of them require any action from you.
  • a error is shown if a attribute task could not be deleted. The application may still have been succesful otherwise but you have to remove the attribute task by hand before you restart the ldap with the new schema. * A warning shown if a project contained a duplicate task name
  • A message is shown if a project contained the legacy task attributes.
  • Various progress messages

NB because of the intermediate schema, it may seem it is possible to use this application to migrate when some project tasks are from ops_admin 0.4 or up and some are older. However, this would result in a loss of quotetasks and implementation tasks. Rewrite the app to suite your needs or send in a feature request instead.

-- IvanaCace - 29 Dec 2008

Topic revision: r1 - 29 Dec 2008 - 08:54:35 - IvanaCace

tip TWiki Tip of the Day
Inline search
To embed a search in a topic, use the % nop SEARCH{ parameters }% TWiki Variable. The search variable ... Read on Read more

 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback