Extension:ImportUsers

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
ImportUsers

Release status: unmaintained

Implementation Special page, User identity, Database
Description Allows to import users in bulk from a CSV file
Author(s) Rouslan Zenetl, Yuriy Ilkiv
Latest version 1.4.1 (2014-06-20)
MediaWiki 1.19+
Database changes No
License Public domain
Download
Added rights

import_users

Translate the ImportUsers extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

The ImportUsers extension adds special page, "Special:ImportUsers", which can be used by bureaucrats (or other users who have the import_users permission) to import users from a CSV file to MediaWiki's user database.

Usage[edit | edit source]

Import File Format[edit | edit source]

The CSV file in UTF-8 without BOM encoding consists of four or five columns, delimited with commas:

  1. username
  2. password
  3. email
  4. real name
  5. user group (optional)
Example
user1,pass1,user1@example.org,John Doe,editor
user2,pass2,user2@example.org,Jane Doe,editor
user3,pass3,user3@example.org,Jonnie Doe,editor
user4,pass4,user4@example.org,Janie Doe,editor
.
userN,passN,userN@example.org,User Nnn,editor
Do not quote text with double-quotes since they are treated as part of the value, e.g. "user1","pass1","user1@example.org","John Doe","editor"

Duplicate/Collision handling[edit | edit source]

This extension will never create duplicate user accounts. Collision handling behavior is determined by the "Replace existing users" check box.

What is account collision?

Two accounts are in collision (or are duplicates of each other) if their login names (user names) are equal.

What can be done?
  • When "Replace existing users" check box is clear (unchecked), ImportUsers extension will ignore records in the input file which are duplicates of existing accounts.
  • When "Replace existing users" check box is checked, ImportUsers extension will update corresponding accounts with data from input file.

Note Note: MediaWiki tolerates duplicate email addresses. In other words, there may be multiple accounts connected to the same email address. This extension will not validate for duplicate email addresses.

Installation[edit | edit source]

  • Download and extract the file(s) in a directory called ImportUsers in your extensions/ folder. If you're a developer and this extension is in a Git repository, then instead you should clone the repository.
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/ImportUsers/ImportUsers.php";
  • Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.

Maintenance[edit | edit source]

After importing users you might want to run initSiteStats.php (MW ≥ 1.21.x) or initStats.php (MW ≤ 1.20.x) to update the statistics of your wiki on registered users.

See also[edit | edit source]

  • MediaWikiAuth is designed for "on demand" import of old accounts into a new wiki