FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Unable to import into FUDForum2Go appliance
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Unable to import into FUDForum2Go appliance [message #162120] Mon, 22 March 2010 10:52 Go to next message
TonyMarston is currently offline  TonyMarston   United Kingdom
Messages: 28
Registered: April 2006
Location: Surrey, UK
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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' =&gt; '01d17ba084d47aea3f5c5ce891ae735f', 'SQ' =&gt; 'a9e570544e7de3d032977033d967dcf1', 'path' =&gt; 'E:\\www.radicore.org\\FUDforum\\tmp\\FUDforum_01_11_2009_10_21.fud.gz', 'skipsearch' =&gt; 'y', 'btn_submit' =&gt; '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 #162121 is a reply to message #162120] Mon, 22 March 2010 11:35 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
My guess is it's because your forum is using MySQL, while FUD2Go uses SQLite. I'm sure it would be possible to support cross database export/imports, but I've never bothered.
Re: Unable to import into FUDForum2Go appliance [message #162126 is a reply to message #162121] Tue, 23 March 2010 06:34 Go to previous messageGo to next message
TonyMarston is currently offline  TonyMarston   United Kingdom
Messages: 28
Registered: April 2006
Location: Surrey, UK
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
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 17:16 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
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) {
Re: Unable to import into FUDForum2Go appliance [message #162157 is a reply to message #162127] Sat, 27 March 2010 07:02 Go to previous messageGo to next message
TonyMarston is currently offline  TonyMarston   United Kingdom
Messages: 28
Registered: April 2006
Location: Surrey, UK
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
How do I apply that patch in MS Windows? And don't tell me that I need VI or VIM.

Tony Marston
Re: Unable to import into FUDForum2Go appliance [message #162158 is a reply to message #162157] Sat, 27 March 2010 07:36 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3624
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
Any decent text editor should do. Notepad++ is a good choice. Also see Applying a patch.
Re: Unable to import into FUDForum2Go appliance [message #162160 is a reply to message #162158] Sat, 27 March 2010 14:01 Go to previous message
TonyMarston is currently offline  TonyMarston   United Kingdom
Messages: 28
Registered: April 2006
Location: Surrey, UK
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
My editor does not understand those commands, and MS Windows does not contain a 'patch' program.

Tony Marston
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: XML Aggregation fails if articles have no 'link' element
Next Topic: Messages are garbled after mporting from backup
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Oct 18 18:01:17 EDT 2017

Total time taken to generate the page: 0.00726 seconds