Renaming heirarchies from the bottom

Ian G Batten ian.batten at uk.fujitsu.com
Mon Nov 12 06:38:54 EST 2007


A common scenario when we are moving users between partitions is to  
want to move their archived mail first, because there's less risk of  
disrupting them, and then their top-level mailbox last.

So we want to do:

rename --partition new-partition user.name.box user.name.box

and then later

rename --partition new-partition user.name user.name

The second step gives the error message ``mailbox already exists'',  
but nonetheless performs the move.  I presume the error comes after  
user.name has been moved, when it then attempts to recurse down into  
the subdirs that have already been moved.

Is this safe to do?

ian

mailhost-new# cyradm --user=mailadm localhost
Password:
localhost> cm user.testcase
localhost> cm user.testcase.subdir
localhost> info user.testcase.subdir
{user.testcase.subdir}:
   condstore: false
   lastpop:
   lastupdate: 12-Nov-2007 11:32:19 +0000
   partition: partition9
   size: 0
localhost> info user.testcase
{user.testcase}:
   condstore: false
   lastpop:
   lastupdate: 12-Nov-2007 11:32:13 +0000
   partition: partition9
   size: 0
localhost> rename --partition partition8  user.testcase.subdir  
user.testcase.subdir
localhost>  info user.testcase.subdir
{user.testcase.subdir}:
   condstore: false
   lastpop:
   lastupdate: 12-Nov-2007 11:33:14 +0000
   partition: partition8
   size: 0
localhost> info user.testcase
{user.testcase}:
   condstore: false
   lastpop:
   lastupdate: 12-Nov-2007 11:32:13 +0000
   partition: partition9
   size: 0
localhost> rename --partition partition8 user.testcase user.testcase

renamemailbox: Mailbox already exists
localhost> info user.testcase
{user.testcase}:
   condstore: false
   lastpop:
   lastupdate: 12-Nov-2007 11:34:19 +0000
   partition: partition8
   size: 0
localhost>



More information about the Info-cyrus mailing list