Extension:ImportUsers

This extension is professionally maintained by the WikiTeq team.
WikiTeq provides official support for MediaWiki LTS releases only. It may work with other MediaWiki releases.
Category:Extensions by WikiTeq Category:Extensions without an imageCategory:The Unlicense licensed extensions
MediaWiki extensions manual
ImportUsers
Release status: stableCategory:Stable extensions
Implementation Special page Category:Special page extensions, User identity Category:User identity extensions, Database Category:Database extensions
Description Allows to import users in bulk from a CSV file
Author(s)
Maintainer(s) WikiTeq team
Latest version 2.2.1 (2023-01-14)
Compatibility policy For every MediaWiki release that is a Long Term Support release there is a corresponding branch in the extension.Category:Extensions with long-term support release branches compatibility policy
MediaWiki 1.38+Category:Extensions with manual MediaWiki version
Database changes No
License The Unlicense
Download Category:Extensions in Wikimedia version control
README
CHANGELOG
Quarterly downloads 3 (Ranked 107th)
Translate the ImportUsers extension if it is available at translatewiki.net
Issues Open tasks · Report a bug
Category:All extensions

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

Import File Format

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 groups (optional; if the user is a member of more than one group, put each group in its own column in the CSV file - do not embed them with commas in one column)

Be sure the CSV file has the correct line feeds. Files with Macintosh line feeds will process only the first line.

Example
user1,pass1,user1@example.org,John Doe
user2,pass2,user2@example.org,Jane Doe,editor
user3,pass3,user3@example.org,Jonnie Doe,editor,staff
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

This extension will never create duplicate user accounts. The "Replace existing users" check box determines collision handling behavior.

What is account collision?

If the login names (user names) of two accounts are equal, they are in collision (or are duplicates of each other).

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

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

Installation

  • Download and place the file(s) in a directory called ImportUsers in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'ImportUsers' );
    
  • Configure if necessary.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

User right

The user right "import_users" is by default assigned to the "bureaucrat" user group. In case you would like to assign the right to an additional user group, e.g., "sysop" add the following line to your "LocalSettings.php" file after the inclusion of the extension as described in the Installationsection above:

$wgGroupPermissions['sysop']['import_users'] = true;

Maintenance

After importing users, you might want to run MediaWiki's "initSiteStats.php" maintenance script to update your wiki's statistics on registered users.

See also

  • MediaWikiAuth – Extension which is designed for "on demand" import of old accounts into a new wiki
  • UserExport – Extension that allows to export users in bulk to a CSV file
Category:Log extensions Category:Import extensions
Category:All extensions Category:Database extensions Category:Extensions by WikiTeq Category:Extensions in Wikimedia version control Category:Extensions included in ProWiki Category:Extensions which add rights Category:Extensions with long-term support release branches compatibility policy Category:Extensions with manual MediaWiki version Category:Extensions without an image Category:Import extensions Category:Log extensions Category:Special page extensions Category:Stable extensions Category:The Unlicense licensed extensions Category:User identity extensions