[DEV] Export/Import Users

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
John P
Registered User
Posts: 1232
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

[DEV] Export/Import Users

Post by John P » Thu Mar 13, 2014 12:40 pm

Export Import users
This Extension is able to export or import users. Found user_id's will be updated with the data in the xml file.

Not found user_id's are inserted and become a registered user in your forum. The xml user file is automatically deleted after insert or save. Fields that are saved are username, user_password, user_email, user_from, user_website and user_occ. Be carefull with this extension as it will overwrite your account if it's in the xml file.

Requirements•phpBB 3.1-dev or higher
•PHP 5.3 or higher

Repository: https://github.com/ForumHulp/Export-Import-Users
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

User avatar
Louis7777
Registered User
Posts: 247
Joined: Sat Apr 21, 2012 9:22 pm

Re: [DEV] Export/Import Users

Post by Louis7777 » Tue Mar 18, 2014 8:18 pm

Thank you for your contribution! I think this is going to be a must-have extension :)

I haven't checked it out yet, but I will definetely use it when phpBB 3.1 stable is out. I'm currently using "[TOOL] Import Users" just in case you want to see it and get ideas from it. 8-)

I'd like to suggest something. :idea:

:geek: If I have two forums, one with hundreds of users and a fresh one which has only one admin account, it is easy to export all users from the first one and import them to the fresh one.
But what if the second forum has many users too and their user_id's exist in both systems? I assume that their accounts would be overwrited, right?

:arrow: It would be great if we could have the option to append user_id's instead of overwriting them. If the second forum has user_id's up to 200 then you could ignore the user_id's in the xml file and import them by assigning an ascending user_id from 201 and on. Perhaps there could be some switch named "overwrite user ID?".

User avatar
John P
Registered User
Posts: 1232
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

Re: [DEV] Export/Import Users

Post by John P » Tue Mar 18, 2014 8:59 pm

My thoughts were if user_id and user-email are found and fields are correct you have the option to overwrite the user.
If no match and fields are correct it will append the users. Appending means a new user_id.
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

User avatar
Louis7777
Registered User
Posts: 247
Joined: Sat Apr 21, 2012 9:22 pm

Re: [DEV] Export/Import Users

Post by Louis7777 » Wed Mar 19, 2014 12:20 am

If you can do that, yeah - it sounds fine to me :D

How about overwriting only when user_id and username or only when the username matches? Dunno - just a quick thought.


EDIT: user_website and user_occ are now custom profile fields. Maybe you should remove them.

ljschmitt
Registered User
Posts: 1
Joined: Tue Jan 27, 2015 3:46 pm

Re: [DEV] Export/Import Users

Post by ljschmitt » Tue Jan 27, 2015 3:49 pm

Can one change this? he can spend the text instead of id of the user-defined profile fields?

Holger
Registered User
Posts: 1599
Joined: Tue Mar 12, 2002 3:54 pm
Location: Hannover

Re: [DEV] Export/Import Users

Post by Holger » Wed Jan 28, 2015 4:02 pm

Nice one!

Can I use this to merge forums?
If I "buy"/take over another forum and want to integrate it into my existing forum?
Are you looking for a phpBB Expert? Find a phpBB Expert!
Are you a phpBB Expert? Post your resume!
http://www.phpbbexperts.com

korleone
Registered User
Posts: 1
Joined: Thu Feb 05, 2015 7:15 pm

Re: [DEV] Export/Import Users

Post by korleone » Thu Feb 05, 2015 7:18 pm

Hi, can you give an example of the XML structure?

thanks!

stefandebeer
Registered User
Posts: 7
Joined: Tue Feb 17, 2015 9:01 am

Re: [DEV] Export/Import Users

Post by stefandebeer » Tue Feb 17, 2015 9:57 am

Is this currently only a DEV version? Any idea when there will be a stable version available?

User avatar
Webwatcher_eu
Registered User
Posts: 102
Joined: Tue Nov 25, 2014 10:59 am
Contact:

Re: [DEV] Export/Import Users

Post by Webwatcher_eu » Fri Jan 29, 2016 9:02 am

I miss the status of the suers - so i can see if the user are ban or not
can this be added to the export xml file

also a smal bug in case of click on add file button without selecting one i get a error:
Illegal use of $_FILES. You must use the request class or request_var() to access input data. Found in xxx/xxx/xxxx/ext/forumhulp/exportimportusers/acp/exportimportusers_module.php on line 307. This error message was generated by deactivated_super_global.

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/request/deactivated_super_global.php
LINE: 67
CALL: trigger_error()

FILE: [ROOT]/phpbb/request/deactivated_super_global.php
LINE: 87
CALL: phpbb\request\deactivated_super_global->error()

FILE: [ROOT]/ext/forumhulp/exportimportusers/acp/exportimportusers_module.php
LINE: 307
CALL: phpbb\request\deactivated_super_global->offsetGet()

FILE: [ROOT]/includes/functions_module.php
LINE: 674
CALL: forumhulp\exportimportusers\acp\exportimportusers_module->main()

FILE: [ROOT]/adm/index.php
LINE: 81
CALL: p_master->load_active()
this is not realy a bug but it needs to be changed to a better way...

User avatar
John P
Registered User
Posts: 1232
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

Re: [DEV] Export/Import Users

Post by John P » Fri Jan 29, 2016 1:58 pm

There is no information about banstatus in user table, therefore you can not see it in this extension.
Did you use the last version
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

User avatar
Webwatcher_eu
Registered User
Posts: 102
Joined: Tue Nov 25, 2014 10:59 am
Contact:

Re: [DEV] Export/Import Users

Post by Webwatcher_eu » Fri Jan 29, 2016 2:57 pm

Hope so i use 3.1.0.RC4.

ok i understand no way.thx for checking this

User avatar
noth
Registered User
Posts: 2433
Joined: Fri Jan 07, 2005 7:10 pm
Location: North Surrey
Contact:

Re: [DEV] Export/Import Users

Post by noth » Sat Jan 30, 2016 12:56 pm

just a thought or 2 ;)

but what do you say to one of these users ....

once their account is imported into another website

should they complain "You didn't have my permission to transfer my account into another website"?

Another thing that occurs to me, is that once you import hundreds of accounts into a different website, bloating the database by goodness knows how many MB :x I predict just 1% of the imported users will even bother to LOG IN at the new website 8-)
UK planning forums got a planning application in the UK?

User avatar
John P
Registered User
Posts: 1232
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

Re: [DEV] Export/Import Users

Post by John P » Sat Jan 30, 2016 1:49 pm

@Webwatcher_eu
I'm not saying this is not possible but it's not the purpose of this script

@noth
If you use it to fill another website noth then you didn't understand the purpose of this script.
BTW every website- forum owner can do this having access to the db.
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

User avatar
Webwatcher_eu
Registered User
Posts: 102
Joined: Tue Nov 25, 2014 10:59 am
Contact:

Re: [DEV] Export/Import Users

Post by Webwatcher_eu » Sat Jan 30, 2016 2:08 pm

not a problem for me. i use ths ext only for export user to use a external newsletter software.
i need to take a look into admin side if there a option for displaying ban users so i can exclude them by hand

User avatar
TempestF
Registered User
Posts: 1
Joined: Fri Feb 26, 2016 6:27 am
Location: New York City
Name: John W

Re: [DEV] Export/Import Users

Post by TempestF » Fri Feb 26, 2016 6:43 am

I just came across this extension and am in the process of trying it out.

Is the xml structure for the update_users.xml the same as export_users.xml ?

As a test I exported the users from my development board that is running 3.1.2, renamed the export_users.xml to update_users.xml and removed the values of user_id, user_ip, and user_birthday. I changed the values of username, user_email and user_password. I save the file as update_users.xml. The update.xml looks like :

<?xml version="1.0" encoding="UTF-8"?>
<USERS>

<user>
<user_id></user_id>
<user_ip></user_ip>
<user_regdate>1456342565</user_regdate>
<username>Test.User</username>
<user_email>Test.User@email.com</user_email>
<user_birthday></user_birthday>
<user_password>testing123</user_password>
</user>

</USERS>



I copied this xml file to FORUM_PATH\store\update_users.xml

I go to the ACP/Users and Groups/Ex-IMport Users, and get the following Error :

General Error
SQL ERROR [ mysqli ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR (username_clean = "test.user" AND user_email = "Test.User@email.com")' at line 2 [1064]

SQL

SELECT user_id, username, user_password, user_email FROM phpbb_users WHERE user_id = OR (username_clean = "test.user" AND user_email = "Test.User@email.com")

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 855
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/mysqli.php
LINE: 194
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 329
CALL: phpbb\db\driver\mysqli->sql_query()

FILE: [ROOT]/ext/forumhulp/exportimportusers/acp/exportimportusers_module.php
LINE: 378
CALL: phpbb\db\driver\factory->sql_query()

FILE: [ROOT]/includes/functions_module.php
LINE: 674
CALL: forumhulp\exportimportusers\acp\exportimportusers_module->main()

FILE: [ROOT]/adm/index.php
LINE: 81
CALL: p_master->load_active()


How to fix ?

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: takufner and 11 guests