Importing user data

Looking at the jiveroster and jiverostergroups tables in wildfire, it look like these two tables are using a shared key to map out which user goes in which group in someone’'s roster. if this is the case, how do I get my information to sync up if I move my group and user tables from the jabberd2 database to the wildfire database…

Jeff

Message was edited by: jeff_garner

Ok. Steps to moving user names from roster-items table into jiveroster table. I know this is SQL, but I think it has something to do with the table schema I am attempting to insert into.

backgroup: table inserting from roster-items2

table inserting to jiveroster

I run this command and receive back the error you see. It looks like there is a 32 character limit on the user ID field… Is that correct, if so how do I fix it?

wildfire=# INSERT INTO jiveroster (rosterid, username, jid, sub, ask, recv, nick) SELECT “object-sequence”, “collection-owner”, jid, 3, -1, -1, name FROM “roster-items2”;

ERROR: value too long for type character varying(32)

Hi Jeff,

is your jiveroster table empty?

YES? Then drop it and create a new one with a 64 char size for username. Depending on the database you are using you may also be able to alter the size to be 64 characters.

LG

updated: The “CREATE TABLE jiveRoster” if found in database/wildfire_db.sql and it has indeed 32 chr for column “username”.

so I can just drop the table and recreate without breaking Wildfire? If so, then Great! Yes, it is empty.

Can I go in and edit the script for WIldfire to create or is it better to recreate from the command line

Hi Jeff,

as far as I understand the java code it is handled as a normal String, but I’'m not 100% sure if somewhere the length is checked. It should be the JID.java class, #JID(String JID).

How many users do you see which are too long? You could also drop them if this is just one or two.

I’'d just copy the org. create table into a new script, insert a drop table before and run it.

LG

No idea how many names are too long, this table has 119K entries and really dont wanna go and look for the one or two that are too long. Will do the table drop tomorrow and create a new one.

Thanks,

Jeff

Ok, I dropped the TWO tables due to the Foreign Key between the roster and group table. I can see my contacts (all offline because this is a test box). I could not insert the groups data however because of the key value not being at 1, and I dont know what to do to get it in there. some way to renumber the data perhaps or to draw the keynumbers from the roster list?

Jeff