News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Convert users from specified ID

Started by bzzik, August 28, 2007, 10:39:11 AM

Previous topic - Next topic

bzzik

Hi guys!

I need to convert firebord to smf users (only users), but only from specified ID (i.e. from ID 5123)

What should i  change in this query?


/* ATTENTION: You don't need to run or use this file!  The convert.php script does everything for you! */

/******************************************************************************/
---~ name: "Simpleboard 1.0 and 1.1"
/******************************************************************************/
---~ version: "SMF 1.1"
---~ settings: "/configuration.php", "../../configuration.php", "../../../configuration.php"
---~ from_prefix: "`$mosConfig_db`.$mosConfig_dbprefix"
---~ table_test: "{$from_prefix}users"

/******************************************************************************/
--- Converting members...
/******************************************************************************/

TRUNCATE {$to_prefix}members;

---* {$to_prefix}members
SELECT
   /* // !!! We could use hxxp:m.name [nonactive] for the realName? */
   hxxp:m.id [nonactive] AS ID_MEMBER, SUBSTRING(m.username, 1, 80) AS memberName,
   SUBSTRING(m.username, 1, 255) AS realName,
   SUBSTRING(fb.signature, 1, 65534) AS signature, fb.posts,
   fb.karma AS karmaGood, SUBSTRING(m.password, 1, 64) AS passwd,
   SUBSTRING(m.email, 1, 255) AS emailAddress,
   SUBSTRING(cd.country, 1, 255) AS location,
   IF(m.activation = 1, 0, 1) AS is_activated,
   UNIX_TIMESTAMP(m.registerDate) AS dateRegistered,
   UNIX_TIMESTAMP(m.lastvisitDate) AS lastLogin,
   IF(cd.params LIKE '%email=0%', 1, 0) AS hideEmail,
   IF(m.usertype = 'superadministrator' OR m.usertype = 'administrator', 1, 0) AS ID_GROUP,
   '' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
   '' AS personalText, '' AS websiteTitle, '' AS websiteUrl, '' AS ICQ,
   '' AS AIM, '' AS YIM, '' AS MSN, '' AS timeFormat, '' AS avatar,
   '' AS usertitle, '' AS memberIP, '' AS secretQuestion, '' AS secretAnswer,
   '' AS validation_code, '' AS additionalGroups, '' AS smileySet,
   '' AS passwordSalt, '' AS memberIP2
FROM {$from_prefix}users AS m
   LEFT JOIN {$from_prefix}fb_users AS fb ON (fb.userid = hxxp:m.id [nonactive])
   LEFT JOIN {$from_prefix}contact_details AS cd ON (cd.user_id = hxxp:m.id [nonactive]);
---*

codenaught

#1
By from do you mean all IDs after the specified ID or all IDs will be entered in manually?

If you want to convert members with an ID of at least 5123

Take:

   LEFT JOIN {$from_prefix}contact_details AS cd ON (cd.user_id = m.id);

Try making it:


  LEFT JOIN {$from_prefix}contact_details AS cd ON (cd.user_id = m.id)
  WHERE m.id >= 5123;


Or if they are all custom added ones...


  LEFT JOIN {$from_prefix}contact_details AS cd ON (cd.user_id = m.id)
  WHERE m.id IN (5123, 8000, 8002);
Dev Consultant
Former SMF Doc Coordinator

Advertisement: