Not a developer? Go to MovableType.com

Documentation

Adding, Changing or Deleting Users in Bulk

If you are managing a very large installation of Movable Type, chances are that you are also managing a very large number of users as well. In order to create, delete and modify many users all at once, Movable Type supports bulk management of users through a CSV file import.

The CSV file contains specific commands (e.g. create, delete, update), followed by a number of different required and optional fields. Each input row in a file represents a single user record. Each optional or required field value (empty or not) in an input row is separated by a comma. Procedures for creating files formatted to accomplish bulk user management tasks are outlined below.

Formatting a file for bulk user creation

  1. Create and save a new file on your hard drive in CSV (comma separated values) format using either Excel or a plain text editor.

  2. Starting with the command word “register”, type a single line for each new user you wish to create, followed by these required and optional fields, each separated by commas.

Field Example
Username jdoe
Display Name John Doe
Email Address jdoe@example.com
Language en-us
Password * abc123
Password Hint simple phrase
Weblog Name * John Doe’s Blog
Weblog Description * John’s personal blog
Site URL * http://www.example.com/blog/jdoe/
Site Root * /var/www/html/blog/jdoe
Time Zone * -0800

Note: Fields listed above and marked with an asterisk (*) are optional and may be left blank. However, commas should still demarcate that empty field in the string.

In CSV Format

The following is an example row in CSV format of data described in the table above:

"jdoe","John Doe","jdoe@example.com","en-us","abc123","simple phrase","John Doe's Blog","John's Personal Blog","http://www.example.com/blog/jdoe/","/var/www/html/blog/jdoe","-0800"

Warning: If you choose to populate the Password field, please note that only the first eight (8) characters of a Movable Type user’s password are significant. This restriction exists due to the way passwords are managed in the Movable Type. Any characters beyond the first eight that a user types into the password field on a Movable Type login page will be ignored when determining if the password provided is correct.

Formatting a file for bulk user deletion

  1. Create and save a new file on your hard drive in CSV (comma separated values) format using either Excel or a plain text editor.

  2. Type a single row for each existing user account you wish to remove from the system, starting with the command word delete, followed by a comma and the desired username. Written altogether, each input row representing a single record to be deleted would look like this: delete,jdoe

Formatting a file for bulk user editing

  1. Create and save a new file on your hard drive in CSV (comma separated values) format using either Excel or a plain text editor.

  2. Starting with the command word update, type a single row for each existing user account you wish to update, followed by these required and optional fields, each separated by commas.

    Field Example
    Username jdoe
    New Username*  
    Display Name Jonathan Doe
    Email Address jdoe@example.com
    Language en-us

Note: Fields listed above and marked with an asterisk (*) are optional and may be left blank. However, commas should still demarcate that empty field in the string.

Note: If you wish to handle multiple user management tasks using a single file, format each individual input row as described above. Each input row may represent a different type of task, indicated by the command word that precedes it.

In CSV Format

The following is an example row in CSV format of data described in the table above:

"jdoe","","jdoe@example.com","en-us"

Processing bulk user changes

  1. Switch to the System Overview area of Movable Type by clicking on the blog selection menu and choosing “System Overview.”

  2. Click Manage > Users from the System Overview’s main menu. This will open a listing of all users that exist in your system.

  3. Click the Bulk Author Import link located in the “Useful Links” section on the right of the screen.

  4. Click the Browse button to the right of the Upload CSV File field. This displays a file upload dialogue box.

  5. Locate and double-click the desired formatted CSV file to upload it.

  6. Select either a specific encoding method or Auto-detect by clicking the down arrow in the Encoding field. Auto-detect is selected by default and should determine the appropriate encoding method for you.

  7. Click the Upload button to process the file and complete the bulk user editing process. Once all users have been processed a confirmation page appears.

Back

2 Comments

Webmaestro

Webmaestro on November 16, 2010, 7:33 a.m. Reply

The instructions above are incomplete. There are some important things to note.

File Format

When creating the CSV file for bulk importing/adding users, Mac OS style formatting (Carriage Return / CR) is not recognized by MovableType’s Bulk User Import system (it produces an error). I switched to the Unix style of formatting for import (Line Feed / LF) and it worked. I haven’t tested whether the default Windows style (Carriage Return + Line Feed / CRLF) works.

Register User

When Registering a User, the EXAMPLE above is incomplete. You must pre-pend register, to each line.

In addition, the password and password hint are also required (it’d be better if, when omitting the password, a new one would be generated!).

It’d also be great if there was an option or flag, which would optionally send an email to the user about their account and/or changes to their account.

Here’re some samples:

register,"jdoe","John Doe","jdoe@example.com","en-us","abc123","simple phrase","John Doe's Blog","John's Personal Blog","http://www.example.com/blog/jdoe/","/var/www/html/blog/jdoe","-0800"
register,"jdoe","John Jacob Jingle-Heimer-Schmidt","jjingle-heimer-schmidt@example.com","en-us","abc123","password hint","","","","",""
Webmaestro

Webmaestro on November 16, 2010, 7:38 a.m. Reply

The EXAMPLE’s 2nd item should have a different user name:

register,"jdoe","John Doe","jdoe@example.com","en-us","abc123","simple phrase","John Doe's Blog","John's Personal Blog","http://www.example.com/blog/jdoe/","/var/www/html/blog/jdoe","-0800"
register,"jj","John Jacob Jingle-Heimer-Schmidt","jjingle-heimer-schmidt@example.com","en-us","abc123","password hint","","","","",""

Could someone fix my EXAMPLE’s 2nd item and delete this addendum? Or better yet, could someone update the docs so someone adding users in bulk has more clarity? ;-)