[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.
Ideas Centre
User avatar
f1mktsol
Registered User
Posts: 29
Joined: Wed Sep 22, 2010 6:12 am
Location: Southern California
Name: Fred

Re: [TOOL] Import Users

Post by f1mktsol »

Odd, isn't it. Perhaps smaller import batches? I suppose you are suggesting I stay with the replacement acp/includes file you forwarded, rather than go back to what I originally used? Thank you,
Fred
Fred
F1 Market Solutions
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote

Re: [TOOL] Import Users

Post by D¡cky »

The file I gave you to debug will import only one user and stop. You can comment the exit command so it doesn't stop or you can use the attached file.

Smaller batches may help, although it should be able to handle a large file.
You do not have the required permissions to view the files attached to this post.
Have you hugged someone today?
User avatar
f1mktsol
Registered User
Posts: 29
Joined: Wed Sep 22, 2010 6:12 am
Location: Southern California
Name: Fred

Re: [TOOL] Import Users

Post by f1mktsol »

Thank you, Dicky. I'll replace with this file. I'm sure you are right about the batch sizes, and if anything, this is likely being caused by a weak server on my end. In any event, your help has been invaluable, and I do owe you! Thanks so much, and best regards,
Fred
Fred
F1 Market Solutions
Smit-Dog
Registered User
Posts: 2
Joined: Wed Oct 27, 2010 6:54 pm

Re: [TOOL] Import Users - Convert Password Issue

Post by Smit-Dog »

I recently used the Import User Tool after not having used it for about 1 year. The last time I used it, it worked beautifully, no issues. Since using it last time, I upgraded the version of phpBB to v3.0.6. I went to use the Import User Tool yesterday, and it appeared to work just fine. However, the newly imported users get this message when trying to login for the first time:

It was not possible to convert your password when updating this bulletin board’s software. Please request a new password. If you continue to have problems please contact the Board Administrator

I set everyone's initial password to their ZIP code (did this in the csv file). During the import, I think I left the Password Format to "hashed". Anyway, looking at the raw data in the MySQL database, the users I imported 1 year ago, their PW field is some cryptic value. For the users I just imported yesterday, the raw value of the PW field is the ZIP code (in plain view, no encryption). Obviously the results for the import I did yesterday differ from the results of the import I did 1 year ago. I don't know if this is due to the version of phpBB changing in the interim, or if I didn't set the Password Format Option correctly for the import I did yesterday.

Was I supposed to import users using the "Plain Text" password format option? Either way, is there anyway to quickly fix this problem? I'd rather not have every one of these new users contact me to reset their password so that they can login for the first time. FWIW, I have the capability to make record changes via SQL statements if that helps (already tried setting user_pass_convert to 0 instead of 1 to no avail (users got a different type of error message when trying to log in).

Should I manually delete these recently imported users, and re-import using the "Plain Text" password format option?

PHP Version: 5.2.12
phpBB Version: 3.0.6

THANKS!
Smit-Dog
Registered User
Posts: 2
Joined: Wed Oct 27, 2010 6:54 pm

Re: [TOOL] Import Users

Post by Smit-Dog »

I just tested my theory as to why users were getting the error message when trying to log in.... I deleted the imported users, and re-imported them using the Plain Text password format option, and it worked!
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote

Re: [TOOL] Import Users

Post by D¡cky »

Smit-Dog,

You should have used the plain text option. This will apply an MD5 hash to the password.

Using phpMyAdmin, you can edit each user, or multiple users, select the function MD5 for the user_password field and Submit. It may be possible to write a SQL query to do this if you have a lot of users.

The other option is to delete the users and reimport. The users will need to be deleted using the Administration Control Panel and not delete through the database as there are other tables linked to the users table.
Have you hugged someone today?
zfleming
Registered User
Posts: 19
Joined: Tue Sep 29, 2009 11:28 am

Re: [TOOL] Import Users

Post by zfleming »

Hi,

Is it possible to import users with the same (generic) email address. I have about 1000 users to import but they only have a username and password (no email address). The members will all know their username and password so I don't need to send out notification emails.

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

Re: [TOOL] Import Users

Post by D¡cky »

zfleming wrote:s it possible to import users with the same (generic) email address.
I don't see why not as long as you set phpBB to allow email address reuse under user registration settings.
Have you hugged someone today?
Giles314
Registered User
Posts: 51
Joined: Thu Nov 11, 2010 12:12 am

Import Users V1.1

Post by Giles314 »

This tool helped me a lot but I faced some bugs coming either from my imported data and/or from lack of robustness of the import procedure. In addition it did not import all I wanted to import. So I debugged the problems, fixed bug, improved error messages to find errors in my data, added the additional functions that I was missing. That was a very interesting tutorial to phpBB MOD development.

Now I have finished to import my data I repackaged this updated MOD in a package I tagged V1.1 and that contains the following changes:

New Functions:
- Add capability to import the user rank
- Allow to specify a TAB as the CSV delimiter
- Allow to specify the Registration date format
- Add a second preview mode
- Simplify input of Birthday format and allow more formats
- Add the display of the count of imported user names
- Add AIM optional field in list of imported fields

Fixes:
- Avoid a fatal error when a user name contains a quote (') which is legal
- Suppress an extra </fieldset> (no visible effect since browsers ignore such errors)

Robustness and Clarifications:
- Verify and signal error if delimiter is not defined
- Verify and signal error (even in both preview modes) if user name is missing in user data
- Verify and warn (even in both preview modes) if email is missing in user data
- Verify and warn (even in both preview modes) if birth date or reg date doesn't match format
- Clarify the user name conflict message
- Suppress * after preview field labels
- Add * after mandatory input field labels
- Zip rebuilt without invalid empty directory avoiding incompatibility with WinZip

More on main new functions:

User Rank
The corresponding field in the imported CSV file must contains the rank name as defined in phpBB. It is probably better to import special ranks than ranks managed by phpBB because else they will be probably overwritten at some point. Though no check is made at importation time so any defined rank will be recognized.

Using TAB as delimiter
TAB is often used as a delimiter in CSV files but it was not possible to specify this character. Now if the delimiter is \t, it is interpreted as the TAB character.
Note: The PHP CSV parsing function used to read the input file is quite weak and does not ignore the delimiters that are between enclose characters (unlike most CSV parsers). It has no escape character management either. Therefore using TAB

as delimiter is usually the only way to avoid a file corruption by delimiters contained in the text. Open Office can convert any CSV file to a TAB delimiter CSV.

Registration date format
The format can be specified with the following place holders: %Y: 4-digit year, %m: 2-digit month, %d: day(1-31), %H: hour(0-23), %M: minute, %S: second'. If nothing is provided for the format, the field is decoded as the integer number of seconds since UNIX Epoch (compatibility with the format of reg date accepted in V1.0)

Second preview mode
The first preview mode still displays the content of the first row of the imported CSV file. This allows to verify if the fields are correctly mapped and the formats are matching.
The new second mode reads all the rows of the input file and decodes all the fields, listing all the errors or warnings detected on the data. An exception: the user name conflicts are not checked. After all verifications are completed, the last record decoded data are displayed. It should be used after a successful initial check with first preview mode to avoid multiplying mapping or format specification errors.


In attachment you will find the V1.1 MOD package and the V1.1 French language pack. I hope this can be useful and that I did not introduce any regression...

Edited to signal that a Version V1.2 in now available here with additional capability to import user' websites.
You do not have the required permissions to view the files attached to this post.
Last edited by Giles314 on Tue Jan 04, 2011 8:14 pm, edited 1 time in total.
gareth_2009
Registered User
Posts: 32
Joined: Fri Dec 25, 2009 1:35 pm

Re: [TOOL] Import Users

Post by gareth_2009 »

hi i seam to be having problems with your updated release. when i try to install i get:

One or more install actions failed. Please review the actions below, make any adjustments and retry. You may continue with the installation even though some of the actions failed. This is not recommended and may cause your board to not function correctly.

New Files
Source target Status
root/adm/style/acp_import_users.html adm/style/acp_import_users.html Success
root/includes/acp/info/acp_import_users.php includes/acp/info/acp_import_users.php Success
root/includes/acp/acp_import_users.php includes/acp/acp_import_users.php Success
root/languages/en/email/user_import.txt language/en/email/user_import.txt Error
root/languages/en/mods/acp_import_users.php language/en/mods/acp_import_users.php Error
root/languages/en/mods/info_acp_import_users.php language/en/mods/info_acp_import_users.php Error

any ideas?
Giles314
Registered User
Posts: 51
Joined: Thu Nov 11, 2010 12:12 am

Re: [TOOL] Import Users

Post by Giles314 »

I tried again an install of the import_user v1.1 mod from a fresh phpBB3 install and I have not been able to reproduce your problem.
In fact I did it twice, once with phpBB 3.0.7 PL1 and once with the brand new phpBB 3.0.8 with a complete file and database cleanup between the 2 tests.

I am using MySQL 5.1.51 as database engine and Apache/2.2.4 (Win32) PHP/5.2.3 for the server.

I have a very limited knowledge on MOD installation. This is my very first MOD and I just did superficial updates (and no change to the installation part). So I am sorry I won't be able to help you.

I can just suggest you first check if the 6 mod files have been well uploaded at their right place (the messages seem to indicate that 3 of them are missing):

Code: Select all

adm/style/acp_import_users.html
acp/info/acp_import_users.php
acp/acp_import_users.php
language/en/mail/user_import.txt
language/en/mods/acp_import_users.php
language/en/mods/info_acp_import_users.php
Then check if you have closely followed the instructions in install.xml.
destment
Registered User
Posts: 15
Joined: Fri Aug 13, 2010 10:59 am

Re: [TOOL] Import Users

Post by destment »

thank you for the mod. very easy to install, but i have a small problem ...my .csv is in the root folder, but i got this message: The requested file could not be found.
so where should i put my .csv?
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote

Re: [TOOL] Import Users

Post by D¡cky »

destment wrote:thank you for the mod. very easy to install, but i have a small problem ...my .csv is in the root folder, but i got this message: The requested file could not be found.
so where should i put my .csv?
In the store directory
Have you hugged someone today?
destment
Registered User
Posts: 15
Joined: Fri Aug 13, 2010 10:59 am

Re: [TOOL] Import Users

Post by destment »

thank you, it works ...but the upload stops if you have usernames with a special symbol in the username like: Quik'n'Sik, Rob's and co.
Giles314
Registered User
Posts: 51
Joined: Thu Nov 11, 2010 12:12 am

Re: [TOOL] Import Users

Post by Giles314 »

destment wrote:thank you, it works ...but the upload stops if you have usernames with a special symbol in the username like: Quik'n'Sik, Rob's and co.
This should be fixed in my V1.1 update.

Return to “[3.0.x] Convertors”