User account menu

  • Log in
BXTra.net

Breadcrumb

  • Home
  • PHPNuke

PHPNuke

Script to Migrate PHPNuke to Drupal - UTF8 to UTF8

By BXTra | 1:27 AM PST, Fri February 15, 2008
Drupal
PHPNuke

Update (Feb 25, 08): New Version 0.04w that included 2 lines of code below can be downloaded -> HERE .

I need to port a website in PHPNuke 7.8 to Drupal 5.7. I've searched all over and found a script to do that from this website. The latest version on that website is 0.02w. The script works great but with a problem, the language that is not English didn't import correctly. All those non-english characters show as "?" So, that imported data can't be used.

Then, I continue looking for more information and found a newer version which is 0.03w from this website. This newer version gave me the same problem.

I, then, looked into the script, checked my database. I found that the data on my temporary PHPNuke database is UTF8. (It has been converted when I imported into MySQL.) So, what I need to do is to import data from UTF8 to UTF8. The migration script didn't write to do that. So, I put these two lines into the script line 280 (in Migration Script version 0.03w) :

$result = mysql_query("SET NAMES utf8", $link);
$result = mysql_query("SET CHARACTER SET utf8", $link);

The script near line 280 (With 2 more lines of code) will look like below :

	//Connect to MySQL
	$connected = true;
	$link = @mysql_connect($host, $username, $password);
	if (!$link)
	{
		failure("Connection to MySQL could not be made. Edit this file and make sure that the database settings are correct.");
		echo " Error returned by MySQL (if any): (" . mysql_errno() . ") " . mysql_error() . " \n";
		$connected = false;
		if (isset($_GET["section"]))
		{
			exit();
		}
	}
	$result = mysql_query("SET NAMES utf8", $link);
	$result = mysql_query("SET CHARACTER SET utf8", $link);
	
	// if you have php5 and the "tidy" module, this will clean up user text for you.
	function tidyhtml($str)
	{

Test the migration script and it works perfectly now.

Note 1: You can convert MySQL data in PHPNuke to UTF8 using import feature under phpMyAdmin. (When import, select "Character set of the file" to what it original is.) After imported, those data will be UTF8. Then, use script with 2 more lines above to convert data to Drupal.

Note 2: My tested computer runs on Windows XP with the following software installed
     - phpMyAdmin 2.11.0
     - MySQL 5.0.45
     - Apache 2.2
     - PHP 5.2.4

Note 3: What I did is to import users and stories, not forum or anything else. That means I didn't test the script if it works with those functions or not.

  • Read more about Script to Migrate PHPNuke to Drupal - UTF8 to UTF8
  • 4 comments
  • Add new comment
Subscribe to PHPNuke

  • Will the router get the Openvpn as a client option?
    6 years ago
  • cancellation
    6 years 1 month ago
  • Router ASUS RT-N12 D1 tomatoes passwort falsch
    7 years 8 months ago
  • WPS button = 30/30/30 hard reset button
    7 years 9 months ago
  • Save my day!
    8 years 3 months ago
  • How to
    8 years 6 months ago
  • Can i still access my modem (the one with the ISP provided)?
    8 years 6 months ago
  • A saving step!
    8 years 10 months ago
  • Problem with Asus n12e-c1
    9 years ago
  • don't use Hostgator
    9 years 2 months ago

© 2007 - 2023 BXTra.net. All Rights Reserved. 
Certain other content, photos and artwork displayed on BXTra.net are protected by copyright and are the property of their respective owners.

Privacy Policy