[TOOL] Import Users

Converting from other board software? Good decision! Need help? Have a question about a convertor? Wish to offer a convertor package? Post here.
Suggested Hosts
Locked
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

[TOOL] Import Users

Post by D¡cky »

Description:
  • Import users from a csv (Comma Separated Values) file through the Administration Control Panel of your phpBB board
  • You have the option to send a welcome email to all imported users
  • Users are added to the Registered Users Group
  • A list will be displayed upon completion showing which users were imported and which users were not imported.
Requirements:
  • php >= 5.0.4
  • phpBB version >= 3.0.4
  • Username, email address and password are required entries. If a password is not available, there needs to be an empty field for it.
  • A header row is NOT allowed
  • The csv file needs to be uploaded to the store directory
Available translations: Options:
  • Most delimiters and separators are supported. You will specify them in the import script
  • Included are the most commonly used phpBB3 user fields. Additional fields can be added if desired
Screenshot: Image

Installation instructions:
  1. Extract the files from the zip file
  2. Upload the files in the root directory to your board root directory
  3. Browse to the Administration Control Panel and install the User Import Module.
    Complete instructions in the MODX format are in the install.xml file included in the package
  4. The csv file needs to be uploaded to the store directory
FAQ
Colliding usernames:
Usernames in the csv file will be checked against usernames in the database. If a name already exists in the database, the username will be skipped.

Passwords:
Password type selection depends on the password type in the csv file.
If plaintext is selected, the password will be hashed before importing.
If hashed is checked, the password will be imported as is.

If there is no password in the password field, one will be generated and hashed regardless of which option is selected.

E-mails:
E-mails will include the password only for generated passwords.

Additional modifications:
auth_db.php may need to be modified depending on the password hashing method selected.
  • auth_db.php does NOT need to be modified if plaintext is selected.
  • auth_db.php does NOT need to be modified if hashed is selected and the password hash is md5.
  • auth_db.php needs to be modified if hashed is selected and the password hash is not md5.
An enhanced version is available at Version 1.2.4

1-July-2010 ric323 Made this topic sticky.
Attachments
csv_import_users.zip
csv import users Version 1.0.0a
2009-04-02
(42.23 KiB) Downloaded 5783 times
Last edited by D¡cky on Fri Jun 24, 2011 2:37 pm, edited 5 times in total.
Have you hugged someone today?
ahn
Registered User
Posts: 3
Joined: Wed Mar 11, 2009 4:31 am

Re: [TOOL] Import Users

Post by ahn »

Installation instructions:

1. Extract the files from the zip file
2. Upload the files in the root directory to your board root directory
3. Browse to the Administration Control Panel and install the User Import Module.
Complete instructions in the MODX format are in the install.xml file included in the package.

Thank you for making this useful tool. But could you pls tell us more clearly? I could not install it.

In the zip file there are 2 folders: contrib, and root, and 3 files install.xml, license.txt and modx.prosilver.en.xsl

I try to upload all of them to my forum directory: etc/www/forum but I could not install. I did not see "import user" to add.

Then I also tried copy 3 folders "acp, includes, language" in the root folder in the zip file to etc/www/forum then I could add import user and enable it, but I could not work properly:

It said:
template->_tpl_load_file(): File ./style/acp_import_users.html does not exist or is empty
Pls tell more details. Sorry because I am very "new" to phpbb. Thanks
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [TOOL] Import Users

Post by D¡cky »

I have uploaded a new zip file. There was an incorrect path in the package.

root/acp/style/acp_users_import.html should have been root/adm/style/acp_users_import.html

You can download the new package, unzip and upload to your server or simply move the file acp_users_import.html in {forum_root}/acp/style to {forum_root}/adm/style
Have you hugged someone today?
McGirl
Registered User
Posts: 2
Joined: Fri Mar 20, 2009 4:54 pm

Re: [TOOL] Import Users

Post by McGirl »

Hi, thank you so much for this plugin, it is exactly what I needed!

I think I've finally got my CSV file straightened out, but I'm still getting an error on upload. This is the error I'm getting:
[phpBB Debug] PHP Notice: in file /includes/acp/acp_import_users.php on line 431: implode() [function.implode]: Invalid arguments passed

Warning: Cannot modify header information - headers already sent by (output started at /home/content/a/a/t/sitepreview/html/websitename/board/includes/functions.php:3184) in /home/content/a/a/t/sitepreview/html/websitename/board/adm/index.php on line 150

Warning: Cannot modify header information - headers already sent by (output started at /home/content/a/a/t/sitepreview/html/websitename/board/includes/functions.php:3184) in /home/content/a/a/t/sitepreview/html/websitename/board/adm/index.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/content/a/a/t/sitepreview/html/websitename/board/includes/functions.php:3184) in /home/content/a/a/t/sitepreview/html/websitename/board/adm/index.php on line 153

Warning: Cannot modify header information - headers already sent by (output started at /home/content/a/a/t/sitepreview/html/websitename/board/includes/functions.php:3184) in /home/content/a/a/t/sitepreview/html/websitename/board/adm/index.php on line 154
I edited down my CSV file to be extremely simple (one user) but it still throws the error. This is what's in my CSV file:
"admin","site@ccess","[email protected]"
I set it to 'hashed' and everything looks fine when I click "Preview" - I'm only getting this error on Submit. Any ideas? Thank you so much!!
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [TOOL] Import Users

Post by D¡cky »

The only way I can duplicate your error is by running the import twice so that all names are rejected. You need to be sure that at least one name can be imported.
Have you hugged someone today?
McGirl
Registered User
Posts: 2
Joined: Fri Mar 20, 2009 4:54 pm

Re: [TOOL] Import Users

Post by McGirl »

I figured it out - sorta. The csv I was trying to import contained 8400 records, and at some point would time out. I deleted what I'd already managed to upload, cut the file up into chunks of 1000, and re-uploaded.

I still got the above error after most uploads, but looking in the database found all the records, so I guess the error didn't mean what I thought it meant.

Anyway, mission accomplished, thanks again for the plugin!! :)
A p u
Registered User
Posts: 2
Joined: Wed Mar 25, 2009 7:53 am

Re: [TOOL] Import Users

Post by A p u »

Any thoughts? The install seems okay but I get the following error if I navigate to ACP -> Users and Groups -> Users: Import Users
Parse error: parse error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /path/to/phpbb3/includes/acp/acp_import_users.php on line 254
Looks like this is probably because this server still runs php 4.3.8 and the "static function" is something from php 5.x. If I change the two instances of "static function" to just "function" the "Import Users" UI will load but does not preview or process CSV files. (It can see them -- putting a non-existent file name in does return the proper error but a valid file just results in a blank "preview" or the same errors McGirl had on a submit.)

Also, from the install instructions:
5. Copy: languages/en/mods/acp_import_users.php
To: language/en/mods/import_users.php

6. Copy: languages/en/mods/info_acp_import_users.php
To: language/en/mods/info_import_users.php
Just FYI on the apparent file name errors in the install instructions.
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [TOOL] Import Users

Post by D¡cky »

A p u,

Since php4 is EOL since 2007-12-31, this was not written with php4 in mind. It includes quite a few php5 functions. Check with your host to see if they have the option for you to upgrade to php5.

Thanks for letting me know about the install instructions.
Have you hugged someone today?
A p u
Registered User
Posts: 2
Joined: Wed Mar 25, 2009 7:53 am

Re: [TOOL] Import Users

Post by A p u »

It's a CentOS 4 server so PHP4 will be supported by RedHat/CentOS until Feb 29, 2012. But, I can understand that programmers would move on. I don't do much PHP programming but have used version specific features in other languages.

I'll see what I can do to move this site to a CentOS 5 server which does support PHP5. In the meantime, you may want to list PHP 5.1 (5.2?) as a requirement to head off any other questions since phpBB v.3 itself only requires PHP 4.3.3.

http://www.phpbb.com/support/documentat ... ements.php

Thanks again for this module though.
User avatar
Dr. Trout Bum
Registered User
Posts: 9
Joined: Tue Nov 14, 2006 6:06 pm
Contact:

Re: [TOOL] Import Users

Post by Dr. Trout Bum »

This looks like exactly what I've been looking for...can't wait to try it.

Thanks!
User avatar
Sr X
Registered User
Posts: 202
Joined: Wed Feb 07, 2007 9:25 am

Re: [TOOL] Import Users

Post by Sr X »

I need this Tool :o ,

how should be that csv to import: username, email, password and id?

it is right?
"username 1","email 1","password 1","id 1",
"username 2","email 2","password 2","id 2",
"username 3","email 3","password 3","id 3",
"username 4","email 4","password 4","id 4",
"username 5","email 5","password 5","id 5",
"username 6","email 6","password 6","id 6",
"username n","email n","password n","id n",
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [TOOL] Import Users

Post by D¡cky »

user id's are not imported. The id's are are assigned the next highest id(autoincremented) when inserted into the database.

As stated in the importer, the fields in the csv file are numbered from 0. In your example, username is 0, email is 1 and password is 2.
Have you hugged someone today?
Walla?
Registered User
Posts: 8
Joined: Fri Apr 17, 2009 2:45 pm

Re: [TOOL] Import Users

Post by Walla? »

Hmm... there's a problem with the zip file or something, i can't seems to open it.
Can you upload it again please?
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [TOOL] Import Users

Post by D¡cky »

Hmm. Works fine for me. Try a different method for opening it.

You could:
1) Use a different browser
2) Right click on the link and choose "Save link as"
3) Choose "Open with" instead of "Save file" or choose "Save file" instead of "Open with"
Have you hugged someone today?
Walla?
Registered User
Posts: 8
Joined: Fri Apr 17, 2009 2:45 pm

Re: [TOOL] Import Users

Post by Walla? »

I can download the file.. the problem is when I try to open the archive.
I get this error:
"Cannot open the file: it does not appear to be a valid archive".

I tried to download it a couple of times and still got this error.
Also tried different programs like WinZip and WinRar..
Locked

Return to “[3.0.x] Convertors”