MyBB Community Forums

Full Version: Private Messages SQL Error SMF 2 > MYBB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Darn. Thanks anyway. ^_^ Good luck with whatever you're up to.

We'll probably just notify our members they're going to lose PMs then Smile
Personally I think it's better because it will cut a huge ammount in size on the database.
We stress tested our new vps held up quite nicely. We only had around 120k pms a great deal yeah. We're gonna tell the people to back them up if they want to save anything.

We're losing around 20k posts on this move and 120k pms. Not that bad.
It's getting close to where we're going to convert the live database. Anyone else happen to run into this issue and figure out a way to save them?
Alrighty; going to start the live transfer without PM's unfortunately Sad
Hi, I had the same sql error. Out of circa 25000 PMs i had to remove manualy 50 sql entries (rows). So if you are willing to do the same process maybe you'll lose just a few of them but you can get them manualy back if they are somehow important. It is a bit time consuming, but if you have phpmyadmin it shoulndn't take so long.
Supersasho; I did that for a handful. Sadly >_< It kept saying next, one next one. And had over 200 errors and rows I had to remove. If I had to do that for over 100k pms it'd be torture Sad

Any updates on this? Anyone working on this one? Sad
<?php
/**
 * MyBB 1.6
 * Copyright 2009 MyBB Group, All Rights Reserved
 *
 * Website: http://www.mybb.com
 * License: http://www.mybb.com/about/license
 */

class Converter_Module_Privatemessages extends Converter_Module
{
	public $default_values = array(
		'import_pmid' => '',
		'uid' => 0,
		'toid' => 0,
		'fromid' => 0,
		'recipients' => '',
		'folder' => 1,
		'subject' => '',
		'icon' => 0,
		'message' => '',
		'dateline' => 0,
		'deletetime' => 0,
		'status' => 0,
		'statustime' => 0,
		'includesig' => 0,
		'smilieoff' => 0,
		'receipt' => 2,
		'readtime' => 0
	);

	/**
	 * Insert privatemessages into database
	 *
	 * @param pm The insert array going into the MyBB database
	 */
	public function insert($data)
	{
		global $db, $output;

		$this->debug->log->datatrace('$data', $data);

		$output->print_progress("start", $data[$this->settings['progress_column']]);

		// Call our currently module's process function
		$data = $this->convert_data($data);

		// Should loop through and fill in any values that aren't set based on the MyBB db schema or other standard default values
		$data = $this->process_default_values($data);

		$insert_array = array();

		foreach($data as $key => $value)
		{
			if(preg_replace('/[^a-z]+/', '', $key) != 'importpmid')
				$insert_array[$key] = $db->escape_string($value);
		}

		$this->debug->log->datatrace('$insert_array', $insert_array);

		$db->insert_query("privatemessages", $insert_array);
		$pmid = $db->insert_id();

		$db->insert_query("privatemessage_trackers", array(
			'pmid' => intval($pmid),
			'import_pmid' => intval($data['import_pmid']),
		));

		$this->increment_tracker('privatemessages');

		$output->print_progress("end");

		return $pmid;
	}
}

?>​

maybe try this?
How to use this file? instead of privatemessages.php or should this be run separately?
Thanks I'll try it out!

@supersasho: guessing this is modules > privatemessages.php
Pages: 1 2 3