How to import old MLF database to MLF2? - PART 1 (Technics)
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ösler" /> <meta name="DC.Publisher" content="Michael Lö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>Ü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>Ü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