3.7.2. Importing Users

The import process recreates the Satellite 5 users in each Satellite 5 organization from the users.csv file. User passwords cannot be copied from Satellite 5 to Satellite 6; instead, the process generates a new random password for each user that it imports. This information is saved in a CSV file, which as the administrator you can parse and send notifications to each user listed with their new password. You can use the hammer import command on the command line or use the hammer interactive shell.
The import process tracks which entities have already been processed. You can, for example, run the hammer import user command multiple times, using different input files (CSV files). The import command recognizes user IDs it has already imported, and skips them on subsequent processes.
Run the following command to import users into Satellite 6:
# hammer import user --csv-file /tmp/exports/users.csv \
--new-passwords /path/to/new/user/passwords.csv
The following is an example of an interactive session:

Example 3.3. Example of Interactive Import Session

hammer> import user --csv-file /tmp/exports/users.csv --new-passwords /root/new-user-passwords.csv

Creating new user: sat5_admin
Creating new user: auser1
Creating new user: auser2
To show the users were created, log in to the WebUI and navigate to AdministerUsers. Alternatively, use the command line as shown below.
# hammer user list

ID | LOGIN | NAME | EMAIL

5 | auser1 | A User1 | auser1@example.com
4 | auser2 | A User2 | auser2@example.com
1 | admin | Admin User | root@sat6.example.com

# hammer user list --search sat5_admin

ID | LOGIN | NAME | EMAIL

3 | sat5_admin | Hat Red | sat5admin@example.com

The following is an example password file for the imported users:
# head new-user-passwords.csv

mail,login,password

sat5admin@example.com,sat5_admin,sat5_admin_svenkmxf
auser1@example.com,auser1,auser1_pwfnagdk
auser2@example.com,auser2,auser2_rsgywazf

Note

By default, Satellite 6 creates an admin user as the initial administrator. It is common for Satellite 5 customers to also create a generic administrative user; consequently, if the import process detects a Satellite 5 admin user, it renames that user to sat5_admin.
Deleting Imported Users

You can use the --delete option to delete the entities from the Satellite 6 instance based on information in the specified CSV file. The following example demonstrates the use of this option to delete imported users.

Example 3.4. Deleting Imported Users

$ hammer import user --csv-file /tmp/exports/users.csv --delete --verbose
Deleting from /tmp/exports/users.csv
Deleting imported user [1->5].
Deleting imported user [8->6].
Deleting imported user [9->7].