Unable to import into FUDForum2Go appliance [message #162120] |
Mon, 22 March 2010 14:52 |
TonyMarston
Messages: 32 Registered: April 2006 Location: Surrey, UK
Karma: 0
|
Member |
|
|
I have a forum backup, using version 3, which was created on my website. I am trying to import it into the FUDForum2Go appliance which I have installed on my laptop. However, I keep getting the following error:
Restoring forum files...
Drop database tables...
Create database tables...
Processing table fud30_action_log...
Fatal error: Uncaught exception 'Exception' with message '(E:\temp\htdocs\include\theme\default\db.inc:102<br />
E:\temp\htdocs\include\theme\default\db.inc:109<br />
E:\temp\htdocs\adm\admimport.php:225<br />
) unrecognized token: "\": HY000<br />
Query: INSERT INTO fud30_action_log VALUES ('105','1154552526','Invalid Password \'ekrit\' for login \'semcycle\'. IP: 24.210.99.49','17','WRONGPASSWD','0')<br />
_POST: array ( 'S' => '01d17ba084d47aea3f5c5ce891ae735f', 'SQ' => 'a9e570544e7de3d032977033d967dcf1', 'path' => 'E:\\www.radicore.org\\FUDforum\\tmp\\FUDforum_01_11_2009_10_21.fud.gz', 'skipsearch' => 'y', 'btn_submit' => 'Import Data', )<br />
Server Version: 3.3.7undefined<br />
[Referring Page] http://127.0.0.1:4001/adm/admimport.php?S=01d17ba084d47aea3f5c5ce891ae735f& amp;amp;SQ=a9e570544e7de3d032977033d967dcf1<br />
' in E:\temp\htdocs\include\core.inc:197 Stack trace: #0 E:\temp\htdocs\include\theme\default\db.inc(102): fud_sql_error_handler('INSERT INTO fud...', 'HY000', 'unrecognized to...', '3.3.7undefined') #1 E:\temp\htdocs\include\theme\default\db.inc(109): uq('INSERT INTO fud...', 1) #2 E:\temp\htdocs\adm\admimport.php(225): q('INSERT INTO fud...') #3 {main} thrown in E:\temp\htdocs\include\core.inc on line 197
Tony Marston
|
|
|
|
Re: Unable to import into FUDForum2Go appliance [message #162126 is a reply to message #162121] |
Tue, 23 March 2010 10:34 |
TonyMarston
Messages: 32 Registered: April 2006 Location: Surrey, UK
Karma: 0
|
Member |
|
|
Why should the fact that the backup was taken from a MySQL database make a difference? The backup format should be totally neutral so that I can backup from one database type and restore into another. Your restore function should simply read the data in the backup file and generate the relevant SQL queries to insert it into the target database.
If you are telling me that I cannot copy the forum data between my main website and the FUDForum2Go appliance then I would say that that is a SERIOUS deficiency.
If I can write software which can transfer all my data between a MySQL database, PostgreSQL database and Oracle database then why can't you handle the difference between MySQL and SQLlite?
Next you'll be telling that it is impossible to take a backup that was created using the 'mysql_*' interface and restore it using the 'mysqli_*' interface simply because the drivers are different!
Tony Marston
|
|
|
Re: Unable to import into FUDForum2Go appliance [message #162127 is a reply to message #162126] |
Tue, 23 March 2010 21:16 |
|
naudefj
Messages: 3771 Registered: December 2004
Karma: 28
|
Senior Member Administrator Core Developer |
|
|
Here is a patch you can try. If it works, I will commit it to the repository:
Index: install/www_root/adm/admimport.php
===================================================================
--- install/www_root/adm/admimport.php (revision 4928)
+++ install/www_root/adm/admimport.php (working copy)
@@ -196,6 +189,14 @@
// Reverse formatting applied in admdump.php.
$line = str_replace('\n', "\n", $line);
+ // Handle different quote styles between databases for cross-database export/imports.
+ // For example, change \' --> '' (MySQL's --> SQLite or pgSQL)
+ if (__dbtype__ == 'mysql') {
+ $line = str_replace("''", "\'", $line);
+ } else {
+ $line = str_replace("\\'", "''", $line);
+ }
+
if (($line = trim($line))) {
if ($line{0} != '(') {
if ($tmp && !$skip) {
|
|
|
|
|
|