packz

Customer
Right now, what importing users with impex does is it will take the list in the user table and fill it in the new forums users table 1 2 3 4 5 6 .. and so on. The problem is that I want the member ID's to match from my old forum and since there are some user ID's that are completely missing in the DB users wind up with different member ID's.

I have the impex file that does the user imports. Is there a way to modify it so that it takes the exact ID of members in my old forum and assigns them the same ID in the import? I think this is where it happens at:

Code:
// Get a page worths of users and their various details
		$user_array 	= $this->get_details($Db_source, $source_database_type, $source_table_prefix, $user_start_at, $user_per_page, 'user', 'userid');
		$signatures 	= $this->get_details($Db_source, $source_database_type, $source_table_prefix, $user_start_at, $user_per_page, 'usertextfield', 'userid');
		$userfield 		= $this->get_details($Db_source, $source_database_type, $source_table_prefix, $user_start_at, $user_per_page, 'userfield', 'userid');
		$usergroup 		= $this->get_details($Db_target, $target_database_type, $target_table_prefix, 0, -1, 'usergroup', 'importusergroupid');

		$displayobject->display_now("<h4>{$displayobject->phrases['importing']} " . count($user_array) . " {$displayobject->phrases['users']}</h4><p><b>{$displayobject->phrases['from']}</b> : " . $user_start_at . " ::  <b>{$displayobject->phrases['to']}</b> : " . ($user_start_at + count($user_array)) . "</p>");

		$user_object = new ImpExData($Db_target, $sessionobject, 'user');

		foreach ($user_array as $user_id => $user)
		{
			$try = (phpversion() < '5' ? $user_object : clone($user_object));

			// Auto associate
			if ($sessionobject->get_session_var('email_match'))
			{
				$try->_auto_email_associate = true;
			}

			// ID mapping

			$try->set_value('mandatory', 'usergroupid',			$usergroup["$user[usergroupid]"]['usergroupid']);
			$try->set_value('mandatory', 'username',			$user['username']);
			$try->set_value('mandatory', 'email',				$user['email']);
			$try->set_value('mandatory', 'importuserid',		$user_id);
 
Last edited:
I've never worked with impex so I really couldn't say, sorry :(

Maybe Deceptor has an idea.
 
Because of existing data already on your forum making Impex match the userids would be a very challenging task and not worth it in my opinion.
 
Back
Top