MyBB Community Forums

Full Version: Restoring a backup from 1.2, need help.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm trying to restore a backup from 1.2 on a 1.2 version MyBB board, but I keep erroring.

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''mybb_adminlog' ( `uid` int(10) unsigned NOT NULL default '0', `dateline` ' at line 1

CREATE TABLE `mybb_adminlog` (

`uid` int(10) unsigned NOT NULL default '0',

`dateline` bigint(30) NOT NULL default '0',

`scriptname` varchar(50) NOT NULL default '',

`action` varchar(50) NOT NULL default '',

`querystring` varchar(150) NOT NULL default '',

`ipaddress` varchar(50) NOT NULL default '',

KEY `scriptname` (`scriptname`,`action`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1

INSERT INTO mybb_adminlog (uid,dateline,scriptname,action,querystring,ipaddress) VALUES ('1','1163696637','index.php','home',NULL,'72.232.56.122')

INSERT INTO mybb_adminlog (uid,dateline,scriptname,action,querystring,ipaddress) VALUES ('1','1163696641','index.php','vercheck',NULL,'72.232.56.122')

I'm guessing its because I was using a older version of MySQL at the time, any idea on how I can get compatibility with sql 5+?. Thank you.
You don't really need the admin log. Just truncate it (delete).

You may have other problems though. MyBB has a problem with the export keys not being single quoted. So if you run into this issue then run a text search/replace.

Example:

INSERT INTO mybb_adminlog (uid,dateline,scriptname,action,querystring,ipaddress) VALUES ('1','1163696637','index.php','home',NULL,'72.232.56.122')

Should be

INSERT INTO mybb_adminlog ('uid','dateline','scriptname','action','querystring','ipaddress') VALUES ('1','1163696637','index.php','home',NULL,'72.232.56.122')
Wow, lots of sql changes I need to make -.- why cant this be automated, curses!.
SQL query:

INSERT INTO mybb_adminoptions( uid, cpstyle, notes, permsset, caneditsettings, caneditann, caneditforums, canmodposts, caneditsmilies, caneditpicons, caneditthemes, canedittemps, caneditusers, caneditpfields, caneditugroups, caneditaperms, caneditutitles, caneditattach, canedithelp, caneditlangs, canrunmaint, canrundbtools ) 
VALUES (

'0', NULL , NULL ,  '1',  'no',  'no',  'no',  'no',  'no',  'no',  'no',  'no',  'no',  'no',  'no',  'no',  'no',  'no',  'no',  'no',  'no',  'no'
);

MySQL said: 

#1048 - Column 'cpstyle' cannot be nul

Sigh.

Quote:It looks like "dateline", "action" and "querrystring" are reserved words in MySQL5.
Also, you may want to consider changing from latin1 to utf8.

Hope this helps

Thats great, can I still use this with sql5 then.
It should be. I believe I have suggested it or even given a bug report. It's not yet been fixed.

Go open a bug report. Maybe you'll get a more favorable response.
Thanks, and done.