Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Importer Failing
Avatar
John Drake
Member
Free Members
sp_UserOfflineSmall Offline
Aug 11, 2013 - 7:41 am

Error: Unable to query USERS using the db settings supplied

 

Source Forum Data: Invision

To perform the import we require access to the source Invision database. Please supply the following:
 

Any ideas?

I have double checked all my DB Details and made sure all the Table Prefixes are correct...

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 11, 2013 - 8:36 am

This is the test connection made to decide on whether an import can be attempted. One problem we have is that error reporting on the php functions is non-existent. We are simply informed on whether it worked or failed. Not the reason for failure. Which means it is either the db name, user, password, host or table_prefix. Big help! We just do not know.

Having said that - looking at the code we can improve it a little (and I have already opened a ticket to get this done immediately) and at least make it possible to ascertain whether it is the connection or the attempted query. So that would narrow it down to either the database connection settings or - in this case, the table prefix/name.

If you would care to have the fixes so you can edit the copy you have I can paste them here for you to try out.

The other problem is that many forum software providers - and in my limited experience Invision are one of the worst at this - will change their database schema quite often which, of course, if we do not know about it can result in one of our import scripts becoming obsolete. Now I have not h4eard of Invision making any sweeping changes for at least 18 months or so so we should be OK but we always need to keep that in mind.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 11, 2013 - 8:42 am

You know - I think we do NOT need to change any code now I have looked closer. So - the table prefix is the main contender. IS there one on your Invision tables?

and - let's check. Is there a table called 'members'? And is the key or a column in that table simply named 'id'?

andy-signature.png
YELLOW
SWORDFISH
Avatar
John Drake
Member
Free Members
sp_UserOfflineSmall Offline
Aug 11, 2013 - 8:44 am

Hi, thanks for the reply.

It's very strange, I am almost 99% sure the connection details are wrong because I recently used the exact details to make a remote connection.

I have just checked invision.php and I can see maybe the "id" is incorrect, because on my Invision DB we have "member_id". I have however tried changing this but still get the same error.

$map['tables']->users = true;
$map['users']->table = 'members';
$map['users']->select = '';
$map['users']->where = '';
$map['users']->ID = 'id';          <--- should be "member_id" ?
$map['users']->user_login = 'name';
$map['users']->user_pass = '';
$map['users']->user_nicename = 'members_display_name';
$map['users']->user_email = 'email';
$map['users']->user_url = '';
$map['users']->user_registered = '#timestamp:joined';
$map['users']->display_name = 'members_display_name';

Avatar
John Drake
Member
Free Members
sp_UserOfflineSmall Offline
Aug 11, 2013 - 8:46 am

Yes the table_prefix is set at:

http://puu.sh/3Zh3R.png

There is "members" and has "member_id"

http://puu.sh/3Zh54.png

 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 11, 2013 - 8:53 am

well - at the point of failyre this is the query it is trying to run:

SELECT COUNT(id) as num FROM db-name.table-prefix_members;

So - if there is no 'id' column then change that to:

SELECT COUNT(member_id) as num FROM db-name.table-prefix_members;

Swap in the db name and table prefix and see what happens if you run it from a tool like phpMyAdmin...

andy-signature.png
YELLOW
SWORDFISH
Avatar
John Drake
Member
Free Members
sp_UserOfflineSmall Offline
Aug 11, 2013 - 8:59 am

Okay,

So tried both queries;

First one returned an error - http://puu.sh/3Zhq3.png

Second one returned this - http://puu.sh/3ZhsR.png

 

So it looks like "id" would be incorrect?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 11, 2013 - 9:36 am

Agreed. But what that really means is that the scheme of your Invision database is clearly not the same as the one that was used to create the importer script.

So it would be worth checking all of the tables in the importer script just to make sure mappings are accurate. Pretty easy to do i think.

However - did you not already sau that changing id to member_id in the importer script did not change the success of the import attempt?

andy-signature.png
YELLOW
SWORDFISH
Avatar
John Drake
Member
Free Members
sp_UserOfflineSmall Offline
Aug 11, 2013 - 10:10 am

Hello,

Just tried again to change to "member_id" and it now successfully starts the import.

Thanks very much for your help, maybe you can roll this out for future...

Regards,

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 11, 2013 - 11:39 am

Curious. Is this a fairly recent Invision system?

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17366
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626