MyBB Community Forums

Full Version: [SOLVED] Upgrade to 1.4.8 is so slow, and not working. Is there another way?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I switched over from PHPbb to MyBB 1.4.4. My forum is creeping up on it's millionth post. With almost 300k users.

The conversion from PHPbb to MyBB took a long time, but this upgrade seems to be taking even longer (More posts and users maybe?)...

The problem i'm having, is on the first step of the upgrade when attempting to remove the ,'s out of the usernames...

I let this first step run over night, and in the morning, the server was pretty much unresponsive. I was looking at the processes, and seems that the upgrade was frozen, or something, and the server was useless, so i had to reboot it. I started it again, and the same thing happened...

Now, my forums are down, and I'm wondering if there's another way to do the upgrade process directly to MySQL...

I've got a QuadCore, with 12 Gigs of ram.... Can i run SQL statements manually, or do anything to get this upgrade to happen?

Thanks!
can't you download the database locally and migrate it than. Setup the forum remotely and upload the new migrated database to mybb? I thought this is how you do it without shutting down your forum...
I don't mind shutting it down... I'd hate for posts to be lost.

Back to the point of upgrading, is there a way that i can upgrade my forums successfully?

Or just stay with 1.4.4, and bury my head under rocks and hope i don't get hacked.

It goes, and the browser thinks that it's done, but i'm still seeing the process on the server... No idea on what to do... Thanks in advanced.

Here's a screeny...
[Image: attachment.php?aid=15049]
I believe you can go into the upgrade.php files and find the exact code being executed on the MySQL database and then run the query manually.
upgrade15.php
function upgrade15_usernameupdate()
{
	global $db, $output, $mybb;

	$output->print_header("Performing Queries");

	echo "<p>Performing username updates..</p>";
	flush();
	
	require_once MYBB_ROOT."inc/datahandler.php";
	require_once MYBB_ROOT."inc/datahandlers/user.php";
	
	$not_renameable = array();
	
	// Because commas can cause some problems with private message sending in usernames we have to remove them
	$query = $db->simple_select("users", "uid, username", "username LIKE '%,%'");
	while($user = $db->fetch_array($query))
	{
		$userhandler = new UserDataHandler('update');
		
		$updated_user = array(
			"uid" => $user['uid'],
			"username" => str_replace(',', '', $user['username'])
		);
		$userhandler->set_data($updated_user);
		
		if(!$userhandler->validate_user())
		{
			$not_renameable[] = htmlspecialchars_uni($user['username']);
		}
		else
		{
			$userhandler->update_user();
		}
	}
	
	if(!empty($not_renameable))
	{
		echo "<span style=\"color: red;\">NOTICE:</span> The following users could not be renamed automatically. Please rename these users in the Admin CP manually after the upgrade process has finished completing:<br />
		<ul>
		<li>";
		echo implode('</li>\n<li>', $not_renameable);
		echo "</li>
		</ul>";
	}
	
	$contents .= "Click next to continue with the upgrade process.</p>";
	$output->print_contents($contents);
	$output->print_footer("15_done");
}

Unfortunately I don't know MySQL enough to provide the exact query you want to execute but this should put you on the right track. Wink
Hey KuJoe, I'll defiantly give that a shot!
Try running this:

UPDATE `mybb_users` SET `username` = REPLACE(username, ',', '') WHERE LOCATE(',', username)

If my logic is correct that should only bother with usernames that actually have a , in them. I've tested it and it worked but please make sure that you have a backup of the table first just in case something weird happens. Then, you should be able to remove the code that does this from the upgrade script and run through it again. I'm not 100% sure if this would be the most recommended way from a dev but it should work, and if the upgrader is stalling, it should at least get this bit done.
Alright, MarrRogowski, you rock... This is getting me somewhere...

So i did that via SSH (No Time outs)... I get this error "ERROR 1062 (23000): Duplicate entry 'Who me?' for key 2"

This means that it's trying to change the user to another username that already exists..

I'll try to update his account with something else and try again.. I'll keep you updated.. Thanks.

MattRogowski, That worked perfectly, and it only took a couple of seconds.. You are awesome!

Once i renamed all of the users that could not be renamed because it would cause an error due to the key constraints, i was able to go through the upgrade.php, and within seconds, i'm all ready to roll.

Again, Thanks MattRogowski and KuJoe.