iprintmig (1)

Name

iprintmig - Migration utility for Novell iPrint

Syntax

This section contains iPrint commands and utilities used on the Linux platform.

iprintmig -s <server> -u <user> <options> -n<printer1>...<printerN>

iprintmig -s <options>

Description

iprintmig is a management tool used to migrate printers to OES Linux.

Options

-h, --help

Print this summary.

-v, -vv, -vvv, -vvvv, -verbose

Specify the level of detail to display about the execution of operations with -v displaying minimum information and -vvvv displaying maximum information.

-V, --version

Print version information.

-s <server>, --src <server>

Specify the source server hostname or address to migrate from.

-d <server>, --dst <server>

Specify the target server hostname or address to migrate to.

-D <PSM DN>, --dst-dn <PSM DN>

Specify the destination print manager DN to migrate to.

-u <user>, --src-user <user>

Specify the FDN format admin for the source server, such as cn=admin, 0=example.

-U <user>, --dst-user <user>

Specify the FDN format admin for the target server, such as cn=admin, 0=example.

-p <pass> , --src-pass <pass>

Password of the source server admin user.

-P<fd>, --src-pass-fd <fd>

File descriptor number to read the source admin password.

-t<password>, --dst-pass <password>

Password of the user on the target server.

-T<fd>, --dst-pass-fd <fd>

File descriptor number to read the destination admin password.

-i<IDS_server>, --ids <IDS_server>

Target IDS server hostname or address. Defaults to dst.

-I<IDS_DN>, --ids-dn <IDS_DN>

Distinguished name of the target IDS.

-e<server>, --edir <server>

Server hostname or address of the eDirectory server for the target server to use.

-n<printer>, --printer-name <printer>

Name of the printer to migrate. Can be specified multiple times.

-f <file>, -printers-file <file>

File containing names of printers (1 per line) to migrate.

-F <fd>, -printers-fd <fd>

File descriptor number listing names of printers to migrate.

-a, --all

Migrate all printers from the source.

-c<DN>, --dst-container <DN>

DN of the container to create print objects in (conflicts with -S).

-S, --same-dn

Create objects on the target server with the same DN as the source server. Only valid when migrating to a new tree.

-H, --same-hostname

Create a manager on the target server with the same hostname as the source manager. Useful when migrating the entire print server.

-x<file>, --xml-outfile <file>

Save the XML migration processing file to <file>.

--srcversion

Indicates the version of the operating system on the source server.

--nodrivers

Do not migrate drivers. If drivers are not present in destination IDS, clients cannot install printers.

--overwrite-drivers

If the destination IDS has a driver with the same name as a corresponding driver on the source server, overwrite it.

--noacls

Do not migrate access control lists (ACLs).

--noprofiles

Do not migrate profiles. If profiles are not present on the target server, clients won't be able to install printers.

--overwrite-profiles

If the target server has a profile for a driver with the same name as a profile on the source server, overwrite it.

--nogo

Prepare but do not perform migration. This option creates an output XML file and migrates drivers (unless --nodrivers was specified) but does not perform migration.

--debug

Prints debug messages to a /var/opt/novell/log/migration/iprintmig.log file.

--update

This option synchronizes any changes in the source server data with the target server after the migration process is complete. This option must be used in conjunction with the -a option.

--resume

Lets you resume the migration process from where it was suspended.

--precheck

Validates the parameters passed for the migration process and returns the status without actually starting the migration.

--consolidation

Use this option to aggregate services on a single target server from multiple source servers.

--ssl

Use this option to enable secure authentication.

--port

Indicates the LDAP port.

--treeflattening

Use this option if you want the contexts of the source printers to be created under a different context on the target server. The context of the target printer is specified by using the -c<DN>, --dst-container <DN> option.

--idswap

Use this option to migrate the printers from the source server to the target server without changing the identity.

Using Passwords

For security reasons, it is safest to transmit passwords to the script via an environment variable or via the -P/-T options, because any user of the system can view the password if it is on the command line (-p/-t options).

Instead, have the calling program set its environment with the following two variables:

IPRINTMIG_SRC_PASSWORD=examplePassword1

IPRINTMIG_DST_PASSWORD=examplePassword2

Then you can execute the following command, which migrates all the printers from server1.example.com to the server where the script is being run.

iprintmig -s server1.example.com -u admin.example.us -U admin -a -x psminfo.xml -I cn=ids,o=example,c=us \-i ids.example.com -c ou=iPrint,o=example,c=us

Examples

The following example migrates few printers at a time while explicitly specifying the hostname of the new print manager:

iprintmig -s server1.example.com -d newserver.example.com -u admin.example.us -U admin -x psminfo.xml \ -I cn=ids,o=example,c=us -i ids.example.com -c ou=iPrint,o=example,c=us -n printer1 -n printer2 \-n printer3 -n printer4

If a calling program specifies a large number of printers, there are three ways to do it:

  • The -n (or --printer-name) option can be specified with a printer name one or more times, as in the example above. This can create a very long command line if many printers are being migrated, so this usage is discouraged.

  • A file containing printer names, one per line, can be specified by using the -f (or --printers-file) option. For a calling program to use this file, the program must first write the list of printers to a temporary file.

  • The calling program can avoid the use of a temporary file by using the -F (or --printers-fd) option, which allows the calling program to send the list of printer names over a pipe created, for example, with socketpair(). On using the -f (or --printers-file) option, printer names are read from the file descriptor, one per line.

    A simple example of this usage follows in C. Similar methods are available with the Mono Mono.Posix.Syscall members:

    char *printers[] = { "p1", "p2", "p3" };
      int fds[2], pid, rc;
      rc = socketpair(AF_UNIX, SOCK_STREAM, 0, fds);
      if (rc < 1)
      {
         perror("Error creating socket pair");
         exit(1);
      }
      pid = fork();
      switch (pid)
      {
         case -1: //Error
            perror("Fork failed");
            exit(1);
         case 0: //Parent
            close(fds[1]);
            for (int i; i < (sizeof(printers)/sizeof(char**)); ++i)
      {
         write(fds[0], printers[i], strlen(printers[i]));
         write(fds[0], "\n", 1);
      }
     close(fds[0]);
            break;
           default: //Child
           close(fds[0]);
           //Set an environment that contains the password env vars
          //Make sure that close on exec isn't set for fds[1]
         //exec the iprintmig script with "-F" and fds[1] converted from an int to a string as arguments
      }
    

Notes

Most of the information that this program requires can be obtained from the eDirectory objects that the user selects. For example, to migrate all printers from a NetWare server to the new Linux server, the user needs to select the old PSM object, which contains the address of the server it is running on. Then the user needs to select the destination PSM, which has attributes for its network address, which eDirectory server it is using, which IDS it is using (and the corresponding IDS object has its own address).

There are some details that cannot be selected or discovered but must be provided by the user, such as details about credentials and whether or not to migrate profiles or drivers.

The user can select a destination container to hold the objects created during migration, or the user can choose to keep the same path for objects (which only works for a move from one tree to another, because NetWare-style objects already exist in the source tree and might conflict with the new Linux versions of the objects).

Authors

Novell, Inc.

Copyright

Copyright ©2008, Novell, Inc. All rights reserved.

See Also

iprintman