| Previous | Next | Contents | Index |
The popstore provides a migration utility which can be used to migrate mail mailboxes for login accounts to either the PMDF MessageStore or the PMDF popstore:
mail.mai files
to the MessageStore, and migrates popstore accounts to the Message
Store.
The utility, described below, can be used to simultaneously migrate one or many accounts. It can either create new accounts as it runs (e.g., when migrating native mail boxes to the popstore or MessageStore), or use pre-created accounts (e.g., when moving popstore accounts to the MessageStore).
8.2.1 Migrating UNIX and NT Mailboxes
On UNIX and NT platforms, the migration utility is the pmdf
movein utility. Its usage is described below.
Migrate mail files between message stores.
pmdf movein [username [password]]
Command Switches Default -before=time-debug-nodebug-destination=store-type-dstdmn=user-domain-exception_file=file-spec-force_migrate-noforce_migrate-forward-forward-help-host=hostname-inbox=file-spec-input=file-spec-log-nolog-since=time-source=store-type-source=native-srcdmn=user-domain-use_existing-nouse_existing
You must be user root to run this utility.
username
Optional name of a single source message store user account to migrate. If not supplied, then the names of accounts to migrate are read from either an input file or standard input, stdin.password
Optional password to set for the new account in the destination message store. Only used when migrating to the popstore or MessageStore.
Thepmdf moveinutility migrates mailboxes from one message store to another. Presently, the supported message stores are BSD-style mail files (the "native" message store), the PMDF MessageStore, and the PMDF popstore. Thepmdf moveinutility performs all of the necessary locking so as to allow migrations to be carried out on an active system without loss of mail. Forwardings from the source message store to the destination message store are automatically established for each migrated user. Note, however, that use of the-noforwardingswitch can compromise this robustness. The basic input to the utility is the name of the source and destination message stores, the names of the source store user accounts to migrate, and, optionally, passwords to set for the user accounts created in the destination store. The source store username is assumed for the destination store. That is, the name of the account in the destination store must be the same as that in the source store. When a username is supplied on the command line, then just that one user account is migrated. To migrate multiple accounts, do not specify a username on the command line and instead use the-inputswitch. Each line of the input file specifies the username of a single source store account to migrate. In addition, a line can specify a password to associate with the new account in the destination store. The password, if supplied, must be on the same input line following the username with one or more white space characters separating the two. Comment lines can appear in the input file: a comment line is any line which begins with a # or ! character. Leading and trailing white space characters on lines are ignored. The following sample input should give the flavor of input files:
When no username or input file is specified, input lines are read from standard input, stdin. The format of those input lines is identical to that of lines read from an input file. Input is terminated by typing a CTRL/D (EOD). When migrating to the MessageStore or popstore, the destination account is automatically created. If a password is supplied, then the password is set in the new account. If no password is supplied, then the new account is marked with the PWD_ELSEWHERE flag. Normally, that causes authentication to then be performed against
# A comment line # # The next two entries supply passwords sue sues-secret-password john johns-secret-password # # The next entry lacks a password alice/etc/passwd. If moving from a BSD-style mail files, the owner field in the new account is set from the gcos field in the/etc/passwdfile. If there already is a pre-existing MessageStore or popstore account---such as when migrating from the popstore to the MessageStore---then the migration fails unless-use_existingis specified. Moreover, if the existing MessageStore or popstore account has the MIGRATED flag set, then the migration fails unless-force_migrateis specified. When the account is successfully migrated, the MIGRATED flag is set. When migrating to a BSD-style mail file, a login account must already exist for the user. The account will not automatically be created. Any supplied password is ignored. When migrating either to or from BSD-style mail files, the PMDF local delivery channel's methodology for locating a user's BSD-style mailbox file is used: the user's.forwardfile is first consulted, the PMDF profile database is checked, and as a last resort the path specified with the-inboxswitch is used. If that switch is not specified, then the platform-specific/var/maillocation is used as a last resort.
The
Note
After a successful migration, the account in the source message store is left intact with its mail inplace. In the case of a BSD-style mail file, the mail file is protected against further writing.pmdf moveinutility is extremely careful to back out of a failed migration, leaving the user account in the source message store in its original state. When multiple accounts are migrated, a failure to migrate an account does not terminate the utility. Instead, the utility backs out of the migration for the failed account and continues on to the next account. Failures are reported to standard error, stderr. The-exception_fileswitch can be used to log errors in an exception file. The format of the exception file is suitable for re-use as an input file.
By default, all messages stored in a user's inbox are migrated. The
-before=hh:mm:ss:dd-mmm-yyyy(UNIX only)-beforeswitch can be used to only migrate those messages stored on or before the specified time. For instance, to migrate all messages received between 08:30 and 13:00 on 1 April 2010, specify
The actual date and time time specification is parsed by the C run-time library function
-since=8:30:00:1-april-2010 -before=13:00:00:1-april-2010strptime. The formatting string used withstrptimeis
For further information on specifying date and time specifications, please consult your platform's
%H:%M:%S:%d-%b-%Ystrptimedocumentation.
-debugLimited debug output can be enabled with the
-nodebug(default)-debugswitch.This required switch specifies the name of the target message store. The accepted names are
-destination=store-typenative(BSD-style mail files),msgstore(PMDF MessageStore), andpopstore(PMDF popstore).The name of the user domain to use in the destination message store. If not specified, then the
-dstdmn=user-domaindefaultdomain is used. Only applicable in conjunction with destination message stores which support user domains.By default, failures are only written to standard error, stderr. Failures can also be reported to an exception file. The name of the exception file is given with the
-exception_file=file-spec-exception_fileswitch. The file will only be created should a failure occur; the file will have the permissions 0600. For each account whose migration fails, an entry will be made to the exception file. The entry takes the form of one or more lines of comments followed by a line containing the failed username and any optional password. The format of the exception file is such that it can be re-used as an input file.
-force_migrateThis switch can be used in conjunction with the
-noforce_migrate(default)-use_existingswitch. See the description of that switch for further details.
-forward(default)By default, a forwarding address for each migrated user account is established. This forwarding causes undelivered mail sent to the user's source message store address to be automatically forwarded to their account in the destination message store. When migrating from the native message store, a forwarding to the account in the destination store is placed in the PMDF alias database. In addition, a
-noforward.forwardfile with the same forwarding is created in the user's login directory. Any previously existing.forwardfile is renamed to.forward.save. If a file named.forward.savealready exists, the previously existing.forwardfile is instead renamed to.forward.save.nnnnnnwherennnnnnis a six-digit number between000000and999999. The new.forwardfile will either have the same ownership and permissions as the previous file or, if there was no previous file, it will be owned by the user and have the permissions 0600. When migrating to the native message store, any forwarding for the account in the PMDF alias database is removed, and any.forwardfile is displaced in accord with the rules cited in the prior paragraph. When migrating from the popstore, a forwarding to the account in the destination store is added to the popstore's forwarding database. When migrating to the popstore, any popstore forwarding for the popstore account is removed from the popstore's forwarding database, Specify-noforwardto prevent forwardings from being established. Note, however, that when-noforwardis used, undelivered mail directed to the user's old address in the source message store can be returned as undeliverable (native message store) or delivered to the old, unused account (popstore) until such time that the old account is deleted at which point the mail will be returned as undeliverable.Optional switch to specify the host name associated with the destination message store. If omitted, the host name used will be determined from PMDF configuration information: the official local host name when the destination store is the native message store; the host name on the popstore channel when the destination store is the popstore. This host name is used in conjunction with the
-host=hostname-forwardswitch to construct a forwarding address for each migrated account.This switch can be used when the native message store is used as either a source or destination message store or both. In those cases, it provides a default file specification to use when attempting to locate a user's BSD-style inbox file. The utility will always first look for a
-inbox=file-spec.forwardfile. If that does not produce an inbox file location, then the PMDF profile database is consulted. If that does not provide an inbox file location, then the location specified with the-inboxswitch is used. If that switch is not specified, then/var/mail(Solaris) or/var/spool/mail(Tru64 UNIX and Linux) is used. The file specification supplied with the-inboxswitch can include the following substitution strings:Thus, for example, on Solaris platforms the default path is
%+,%s,%uSubstitute in the name of the user account being migrated %d,%hSubstitute in the home directory of the user account being migrated \xSubstitute in the literal character x( e.g.,\%substitutes in%).-inbox=/var/mail/%s.Specify an input file containing names of user accounts to migrate. Can not be used in conjunction with the username command line parameter. See the description above for further information on input files.
-input=file-spec
-log(default)By default, the utility reports each successfully migrated account to standard error, stderr. To suppress this reporting, specify
-nolog-nolog. Note that errors are always reported.By default, all messages stored in a user's inbox are migrated. The
-since=hh:mm:ss:dd-mmm-yyyy(UNIX only)-sinceswitch can be used to only migrate those messages stored on or after the specified time. See the description of the-beforeswitch for further details.By default, the source message store is assumed to be the native message store. The permitted values are
-source=store-typenativeandpopstore.The name of the user domain to use in the source message store. If not specified, then the
-srcdmn=user-domaindefaultdomain is used. Only applicable in conjunction with source message stores which support user domains.
-use_existingThis switch is only honored when the destination message store is the popstore. It is ignored when migrating to the native message store. By default, a migration to the popstore will fail when there already is a pre-existing popstore account with the same name as the source store account being migrated. To override this behavior, specify
-nouse_existing(default)-use_existing. However, if the pre-existing account has the popstore MIGRATED flag set, the migration will fail unless-force_migrateis also specified. Note that when migrating to a pre-existing account, the password for the account is left unchanged and migrated messages are added to those already stored for the account.
| #1 |
|---|
# pmdf movein -destination=popstore sue SeCreT
movein: Destination message store host name not supplied; using pop.com
movein: User "sue" successfully migrated (/var/mail/sue)
|
This example shows migrating to the popstore the login user
suewith the passwordSeCreT.
| #2 |
|---|
# pmdf movein -source=popstore -destination=msgstore -use_existing sue
movein: Destination message store host name not supplied; using imap.com
movein: User "sue" successfully migrated
|
This example shows migrating the popstore user
sueto the MessageStore. The-use_existingswitch instructs the utility to use Sue's existing profile file for her MessageStore account. This way, her password and other usage information is preserved.
| #3 |
|---|
# cat user_list
sue SeCreT
tom
# pmdf movein -destination=popstore -input=user_list
movein: Destination message store host name not supplied; using pop.com
movein: User "sue" successfully migrated (/var/mail/sue)
movein: User "tom" successfully migrated (/var/mail/tom)
|
In the above example an input file is used to direct the
pmdf moveinutility. The file calls for migrating the login userssueandtom. A password is set forsuein her new popstore account.
| Previous | Next | Contents | Index |