1
MadFish
Problem with restoring a backup database
  • 2005/7/31 9:42

  • MadFish

  • Friend of XOOPS

  • Posts: 1056

  • Since: 2003/9/27


I'm trying to roll back a XOOPS install to 2.13a, but my database backup is generating an error when I try to restore it:

Quote:
#1170 - BLOB column 'hometext' used in key specification without a key length

Can anyone suggest how to fix this? The backup was made with XOOPS Backup and Restore 3.0. MySQL version 4.0.24

Query is below:

SQL-query:

CREATE TABLE xoops_stories(
storyid int( 8 ) unsigned NOT NULL AUTO_INCREMENT ,
uid int( 5 ) unsigned DEFAULT '0' NOT NULL ,
title varchar( 255 ) NOT NULL ,
created int( 10 ) unsigned DEFAULT '0' NOT NULL ,
published int( 10 ) unsigned DEFAULT '0' NOT NULL ,
expired int( 10 ) unsigned DEFAULT '0' NOT NULL ,
hostname varchar( 20 ) NOT NULL ,
nohtml tinyint( 1 ) DEFAULT '0' NOT NULL ,
nosmiley tinyint( 1 ) DEFAULT '0' NOT NULL ,
hometext text NOT NULL ,
bodytext text NOT NULL ,
counter int( 8 ) unsigned DEFAULT '0' NOT NULL ,
topicid smallint( 4 ) unsigned DEFAULT '1' NOT NULL ,
ihome tinyint( 1 ) DEFAULT '0' NOT NULL ,
notifypub tinyint( 1 ) DEFAULT '0' NOT NULL ,
story_type varchar( 5 ) NOT NULL ,
topicdisplay tinyint( 1 ) DEFAULT '0' NOT NULL ,
topicalign char( 1 ) DEFAULT 'R' NOT NULL ,
comments smallint( 5 ) unsigned DEFAULT '0' NOT NULL ,
rating double( 6, 4 ) DEFAULT '0.0000' NOT NULL ,
votes int( 11 ) unsigned DEFAULT '0' NOT NULL ,
keywords varchar( 255 ) NOT NULL ,
description varchar( 255 ) NOT NULL ,
PRIMARY KEY ( storyid ) ,
KEY idxstoriestopic( topicid ) ,
KEY ihome( ihome ) ,
KEY uid( uid ) ,
KEY published_ihome( published, ihome ) ,
KEY title( title( 40 ) ) ,
KEY created( created ) ,
KEY search( title, hometext, bodytext )
)

2
jdseymour
Re: Problem with restoring a backup database

Try this one. I exported through phpmyadmin:

DROP TABLE IF EXISTS `xoops_stories`;
CREATE TABLE `xoops_stories` (
  `
storyid` int(8) unsigned NOT NULL auto_increment,
  `
uid` int(5) unsigned NOT NULL default '0',
  `
title` varchar(255) NOT NULL default '',
  `
created` int(10) unsigned NOT NULL default '0',
  `
published` int(10) unsigned NOT NULL default '0',
  `
expired` int(10) unsigned NOT NULL default '0',
  `
hostname` varchar(20) NOT NULL default '',
  `
nohtml` tinyint(1) NOT NULL default '0',
  `
nosmiley` tinyint(1) NOT NULL default '0',
  `
hometext` text NOT NULL,
  `
bodytext` text NOT NULL,
  `
keywords` varchar(255) NOT NULL default '',
  `
description` varchar(255) NOT NULL default '',
  `
counter` int(8) unsigned NOT NULL default '0',
  `
topicid` smallint(4) unsigned NOT NULL default '1',
  `
ihome` tinyint(1) NOT NULL default '0',
  `
notifypub` tinyint(1) NOT NULL default '0',
  `
story_type` varchar(5) NOT NULL default '',
  `
topicdisplay` tinyint(1) NOT NULL default '0',
  `
topicalign` char(1) NOT NULL default 'R',
  `
comments` smallint(5) unsigned NOT NULL default '0',
  `
rating` double(6,4) NOT NULL default '0.0000',
  `
votes` int(11) unsigned NOT NULL default '0',
  
PRIMARY KEY  (`storyid`),
  
KEY `idxstoriestopic` (`topicid`),
  
KEY `ihome` (`ihome`),
  
KEY `uid` (`uid`),
  
KEY `published_ihome` (`published`,`ihome`),
  
KEY `title` (`title`(40)),
  
KEY `created` (`created`),
  
FULLTEXT KEY `search` (`title`,`hometext`,`bodytext`)
) 
TYPE=MyISAM AUTO_INCREMENT=2 ;

HTH.

3
MadFish
Re: Problem with restoring a backup database
  • 2005/7/31 10:35

  • MadFish

  • Friend of XOOPS

  • Posts: 1056

  • Since: 2003/9/27


Many thanks, that works (in that the table is created with no problems). I managed to fix the same problem in another module table by pulling out the original sql query from the module code.

Unfortunately, I now have a White Screen of Death Problem so something else is wrong...maybe the data (shudder) but I guess it's an improvement :)

Edit: WSOD was my fault - now got everything back except for the news index page...work continues!