How to import old MLF database to MLF2? (Technics)

by mlffan, (6485 days ago)

Hi, I have tried to import the database of old version maybe 1.x to the new mlf2.0 from myphpadmin.

However, it shows many mistakes, it seems the mysql database structure has changed. How to solve this problem? Thank you for your kind help in advance.

locked
5960 views
Avatar

How to import old MLF database to MLF2? - PART 1

by Micha ⌂, (6484 days ago) @ mlffan

Hi,

I have written a quick & dirty script:

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" xml:lang="de">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<meta name="DC.Format" content="text/html" />
<meta http-equiv="content-language" content="de" />
<meta name="DC.Creator" content="Michael L&ouml;sler" />
<meta name="DC.Publisher" content="Michael L&ouml;sler" />
<meta name="DC.Type" content="Text" />  
<meta name="DC.Language" content="de" />
<meta name="DC.Coverage" content="Germany" />
<meta name="DC.Rights" content="Copyrighted Work" />
<meta name="DC.Identifier" content="http://derletztekick.com" />
 
<meta name="robots" content="NOINDEX, NOFOLLOW" />
<title>MyLiitleForum1.7 to MyLittleForum2.0 || derletztekick.com :: Mein kleines Scriptarchiv</title>
</head>
<body>
<h1>MyLittleForum1.7 to MyLittleForum2.0</h1>
<?php
 error_reporting(E_ALL);
 define("MYSQL_HOST",     "localhost");
 define("MYSQL_USER",     "username");
 define("MYSQL_PASS",     "passwort");
 define("MYSQL_DATABASE", "databasename");
 
 mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) OR die(mysql_error());
 mysql_select_db(MYSQL_DATABASE) OR die(mysql_error());
 
 $mlf17_forumdlk_banlists = "forum17_banlists";
 $mlf20_forumdlk_banlists = "forum20_banlists";
 
 $mlf17_forumdlk_categories = "forum17_categories";
 $mlf20_forumdlk_categories = "forum20_categories";
 
 $mlf17_forumdlk_entries = "forum17_entries";
 $mlf20_forumdlk_entries = "forum20_entries";
 
 $mlf17_forumdlk_userdata = "forum17_userdata";
 $mlf20_forumdlk_userdata = "forum20_userdata";
 
 echo "<p>&Uuml;bertrage ".$mlf17_forumdlk_banlists." nach ".$mlf20_forumdlk_banlists."</p>n";
 $sql = "SELECT `list` FROM `".$mlf17_forumdlk_banlists."`";
 $result = mysql_query($sql) OR die(mysql_error());
 if (mysql_num_rows($result)){
  while($row = mysql_fetch_array( $result, MYSQL_ASSOC )){
   $insert_data = "INSERT INTO `".$mlf20_forumdlk_banlists."` 
     (`list`) VALUES 
     ('".$row['list']."')";
   $insert = mysql_query($insert_data);  
  }
 }
 
 echo "<hr/>n<p>&Uuml;bertrage ".$mlf17_forumdlk_categories." nach ".$mlf20_forumdlk_categories."</p>n";
 $sql = "SELECT * FROM `".$mlf17_forumdlk_categories."`";
 $result = mysql_query($sql) OR die("Konnte gewaehlte Tabelle nicht abfragen. Fehlermeldung: ".mysql_error());
 if (mysql_num_rows($result)){
  while($row = mysql_fetch_array( $result, MYSQL_ASSOC )){
   $insert_data = "INSERT INTO `".$mlf20_forumdlk_categories."` 
     (`id`, `order_id`, `category`, `description`, `accession`) VALUES 
     ('".$row['id']."', '".$row['category_order']."', '".$row['category']."' , '".$row['description']."', '".$row['accession']."')";
   $insert = mysql_query($insert_data);
  }
 }
 
 

see part 2

Micha

P.S. only 5000 characters :-(

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

locked
5883 views
Avatar

How to import old MLF database to MLF2? - PART 2

by Micha ⌂, (6484 days ago) @ Micha

Part 2

 
 echo "<hr/>n<p>&Uuml;bertrage ".$mlf17_forumdlk_entries." nach ".$mlf20_forumdlk_entries."</p>n";
 $sql = "SELECT * FROM `".$mlf17_forumdlk_entries."`";
 $result = mysql_query($sql) OR die(mysql_error());
 if (mysql_num_rows($result)){
  while($row = mysql_fetch_array( $result, MYSQL_ASSOC )){
   $insert_data = "INSERT INTO `".$mlf20_forumdlk_entries."` 
     (`id`, `pid`, `tid`, `uniqid`,`time`, `last_reply`, `edited`, `edited_by`, `user_id`, `name`, `subject`, `category`, `email`, `hp`, `location`, `ip`, `text`, `show_signature`, `email_notification`, `marked`, `locked`, `sticky`, `views`) VALUES 
     ('".$row['id']."', '".$row['pid']."', '".$row['tid']."' , '".$row['uniqid']."', '".$row['time']."', '".$row['last_answer']."', '".$row['edited']."', '".$row['edited_by']."', '".$row['user_id']."', '".$row['name']."', '".$row['subject']."', '".$row['category']."', '".$row['email']."', '".$row['hp']."', '".$row['place']."', '".$row['ip']."', '".$row['text']."', '".$row['show_signature']."', '".$row['email_notify']."', '".$row['marked']."', '".$row['locked']."', '".$row['fixed']."', '".$row['views']."')";
   $insert = mysql_query($insert_data);
  }
 }
 
 echo "<hr/>n<p>&Uuml;bertrage ".$mlf17_forumdlk_userdata." nach ".$mlf20_forumdlk_userdata."</p>n";
 $sql = "SELECT * FROM `".$mlf17_forumdlk_userdata."`";
 $result = mysql_query($sql) OR die(mysql_error());
 if (mysql_num_rows($result)){
  while($row = mysql_fetch_array( $result, MYSQL_ASSOC )){
   $insert_data = "INSERT INTO `".$mlf20_forumdlk_userdata."` 
     (`user_id`,`user_type`, `user_name`,`user_real_name`,`user_pw`,`user_email`, `email_contact`,`user_hp`, `user_location`, `signature`,`profile`, `logins`, `last_login`,`last_logout`,`user_ip`,`registered`, `user_view`,`new_posting_notification`,`new_user_notification`,`time_difference`, `user_lock`, `pwf_code`, `activate_code`) VALUES 
     ('".$row['user_id']."', '".$row['user_type']."', '".$row['user_name']."', '".$row['user_real_name']."', '".$row['user_pw']."', '".$row['user_email']."', '".$row['hide_email']."', '".$row['user_hp']."', '".$row['user_place']."', '".$row['signature']."', '".$row['profile']."', '".$row['logins']."', '".$row['last_login']."', '".$row['last_logout']."', '".$row['user_ip']."', '".$row['registered']."', '".$row['user_view']."', '".$row['new_posting_notify']."', '".$row['new_user_notify']."', '".$row['time_difference']."', '".$row['user_lock']."', '".$row['pwf_code']."', '".$row['activate_code']."')";
   $insert = mysql_query($insert_data);
  }
 }
 
?>
</body>
</html>
 

Micha

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

locked
5769 views

How to import old MLF database to MLF2? - PART 2

by mlffan, (6484 days ago) @ Micha

Thank you, Milo, I do appreciate.

When I using this script, it shows

Übertrage forum_banlists nach forum20_banlists

Übertrage forum_categories nach forum20_categories

Übertrage forum_entries nach forum20_entries

Übertrage forum_userdata nach forum20_userdata

what should I do?

locked
5760 views

How to import old MLF database to MLF2? - PART 2

by mlffan, (6484 days ago) @ mlffan

Hi, sorry, I forgot to modify the table names. lol

Thank you, all done!!! does helpful, mate!!!

locked
5648 views
Avatar

How to import old MLF database to MLF2? - PART 2

by Micha ⌂, (6483 days ago) @ mlffan

Hello,

Hi, sorry, I forgot to modify the table names. lol

Yes, of cource - it's just a quick and dirty script!

Thank you, all done!!! does helpful, mate!!!

No Problem

--
applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

locked
5901 views

How to import old MLF database to MLF2? - PART 1

by mike ⌂, (6459 days ago) @ Micha

very cool, thank you

locked
5700 views

RSS Feed of thread