Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Migration script, comments

Discussion topic

2020-04-07: This site is going to be decommissioned and shut down on 2020-07-01. Please copy and archive any data you wish to keep before that date.

Hide all messages in topic

All messages in topic

Migration script, comments

Author pmarek
Full name P.Marek
Date 2009-03-27 01:09:08 PDT
Message Hello Gunnar!

Sorry that it took so long to look at the migration script.
Here are some comments; starting with thoughts about specific parts:

- fsvsGetMonitoredFiles, fsvsFindWAAFiles, fsvsGetWCConfPath:
  Don't a assume "/" as WC base; they have to be determined by looking
  at the various /etc/fsvs/*/_base symlinks.
- Currently FSVS is called every time in fsvsGetWAA() and
  fsvsGetWCConfPath(); that information could be cached.
- Similar for the getMD5Parts() call - this is done multiple times, too.
- If we say that this conversion happens with the *new* version of FSVS
  installed, with
  - the CONF area (especially the "Ign" files) already converted and
  - the WC-base specific WAA-entries (like "dir") moved,
  you could remove getPath() in fsvsGetMonitoredFiles() by calling FSVS with
  "-o verbose=none,path -f all -o change_check=none" - which would remove a
  bit of CPU overhead for the conversion.
- If I read the code correctly, in fsvsFindWAAFiles() you try to move a
  'dir' and 'cflct' file for every entry in the WC; this is not necessary,
  as these are WC-base only data. BTW you could move the whole directory.
- There's nothing to convert the "Ign" file yet, is there?

That there's a test mode is really fine; that helps a fair bit checking the
various things.

How about just outputting a shell script fragment (with "mv" commands),
that the user can visually check before running? The impatient or trustful
could simply do "migrate.py | bash" and be done.

I'd suggest doing something like this:

For each WC base (directory in $FSVS_CONF resp. "/etc/fsvs/"):
- collect all needed data (WC path, MD5 parts, WAA path)
  - determine new WAA path by inserting the first N (default 4) characters
    of the WC-path MD5 at the correct place
  - calculate old WAA path by removing the single path part
- Move the (whole) WAA-directory for the WC base to the new destination
  (not the individual files therein)
- Convert the "Ign" file, to make it compatible with the new FSVS version
- Use "fsvs st -o verbose=none,path $WCBASE" to get the filelist
- For each entry:
  - calculate the MD5 and the old WAA path
  - If the old WAA directory exists:
    - make sure that the directory *below* the new WAA path exists
    - move the WAA directory to the new destination

What do you think about that?
Sorry if my thoughts go in a complete different direction than yours ...

Thank you very much for your help!



Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!
Messages per page: