Has anyone tried backing up and restoring a MODx database with EasyPoll installed? I did this the other day and I got a load of errors doing the restore.
This is what I got restoring the backup (.sql file created from MODx managers Tools/Backup) into an empty MySQL Database:
[tt]
Script line: 115 Can’t create table ’.\test\beta_ep_choice.frm’ (errno: 150)
Script line: 130 Table ’test.beta_ep_choice’ doesn’t exist
Script line: 131 Table ’test.beta_ep_choice’ doesn’t exist
Script line: 132 Table ’test.beta_ep_choice’ doesn’t exist
Script line: 133 Table ’test.beta_ep_choice’ doesn’t exist
Script line: 185 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 ’USING BTREE,
KEY `transLangFK` (`idLang`),
KEY `transPollFK` (`idPoll`),
’ at line 6
Script line: 201 Table ’test.beta_ep_translation’ doesn’t exist
Script line: 202 Table ’test.beta_ep_translation’ doesn’t exist
Script line: 203 Table ’test.beta_ep_translation’ doesn’t exist
Script line: 204 Table ’test.beta_ep_translation’ doesn’t exist
Script line: 205 Table ’test.beta_ep_translation’ doesn’t exist
Script line: 4262 The target table beta_poll_results of the INSERT is not insertable-into
Script line: 4263 The target table beta_poll_results of the INSERT is not insertable-into
Script line: 4264 The target table beta_poll_results of the INSERT is not insertable-into
Script line: 4265 The target table beta_poll_results of the INSERT is not insertable-into
[/tt]
This is the first bit of the .sql backup file, with the EasyPoll tables in:
#
# BETA Database Dump
# MODx 0.9.6.1 (rev 3118)
#
# Host: localhost
# Generation Time: Feb 14, 2008 pm29 16:41
# Server version: 5.1.22-rc-community
# PHP Version: 5.2.1
# Database : `modx_beta`
#
# snipped some modx tables out of here...
#
# Table structure for table `beta_ep_choice`
#
DROP TABLE IF EXISTS `beta_ep_choice`;
CREATE TABLE `beta_ep_choice` (
`idChoice` int(10) unsigned NOT NULL AUTO_INCREMENT,
`idPoll` int(10) unsigned NOT NULL,
`Title` varchar(128) NOT NULL,
`Sorting` tinyint(3) unsigned NOT NULL,
`Votes` int(11) NOT NULL,
PRIMARY KEY (`idChoice`),
KEY `pollFK` (`idPoll`),
CONSTRAINT `pollFK` FOREIGN KEY (`idPoll`) REFERENCES `beta_ep_poll` (`idPoll`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
#
# Dumping data for table `beta_ep_choice`
#
INSERT INTO `beta_ep_choice` VALUES ('1','1','Blue','1','0');
INSERT INTO `beta_ep_choice` VALUES ('2','1','Red','2','2');
INSERT INTO `beta_ep_choice` VALUES ('3','1','Green','3','6');
INSERT INTO `beta_ep_choice` VALUES ('4','1','Turquoise','4','0');
# --------------------------------------------------------
#
# Table structure for table `beta_ep_language`
#
DROP TABLE IF EXISTS `beta_ep_language`;
CREATE TABLE `beta_ep_language` (
`idLang` int(10) unsigned NOT NULL AUTO_INCREMENT,
`LangShort` char(3) NOT NULL,
`LangName` varchar(256) NOT NULL,
PRIMARY KEY (`idLang`),
UNIQUE KEY `uniqLang` (`LangShort`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
#
# Dumping data for table `beta_ep_language`
#
INSERT INTO `beta_ep_language` VALUES ('1','en','English');
# --------------------------------------------------------
#
# Table structure for table `beta_ep_poll`
#
DROP TABLE IF EXISTS `beta_ep_poll`;
CREATE TABLE `beta_ep_poll` (
`idPoll` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Title` varchar(128) NOT NULL,
`isActive` tinyint(1) unsigned NOT NULL DEFAULT '0',
`StartDate` datetime DEFAULT NULL,
`EndDate` datetime DEFAULT NULL,
PRIMARY KEY (`idPoll`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
#
# Dumping data for table `beta_ep_poll`
#
INSERT INTO `beta_ep_poll` VALUES ('1','What\'s your favourite colour?','1','2008-01-01 05:04:59','2008-02-29 05:05:05');
# --------------------------------------------------------
#
# Table structure for table `beta_ep_translation`
#
DROP TABLE IF EXISTS `beta_ep_translation`;
CREATE TABLE `beta_ep_translation` (
`idPoll` int(10) unsigned NOT NULL,
`idChoice` int(10) unsigned NOT NULL DEFAULT '0',
`idLang` int(10) unsigned NOT NULL,
`TextValue` varchar(2048) NOT NULL,
PRIMARY KEY (`idChoice`,`idLang`,`idPoll`) USING BTREE,
KEY `transLangFK` (`idLang`),
KEY `transPollFK` (`idPoll`),
CONSTRAINT `transLangFK` FOREIGN KEY (`idLang`) REFERENCES `beta_ep_language` (`idLang`) ON DELETE CASCADE,
CONSTRAINT `transPollFK` FOREIGN KEY (`idPoll`) REFERENCES `beta_ep_poll` (`idPoll`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
#
# Dumping data for table `beta_ep_translation`
#
INSERT INTO `beta_ep_translation` VALUES ('1','0','1','What\'s your favourite colour?');
INSERT INTO `beta_ep_translation` VALUES ('1','1','1','Blue');
INSERT INTO `beta_ep_translation` VALUES ('1','2','1','Red');
INSERT INTO `beta_ep_translation` VALUES ('1','3','1','Green');
INSERT INTO `beta_ep_translation` VALUES ('1','4','1','Turquoise');
# --------------------------------------------------------
#
# Table structure for table `beta_ep_userip`
#
DROP TABLE IF EXISTS `beta_ep_userip`;
CREATE TABLE `beta_ep_userip` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`idPoll` int(10) unsigned NOT NULL,
`ipAddress` varchar(128) NOT NULL,
PRIMARY KEY (`id`),
KEY `ipPollFK` (`idPoll`),
CONSTRAINT `ipPollFK` FOREIGN KEY (`idPoll`) REFERENCES `beta_ep_poll` (`idPoll`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
#
# Dumping data for table `beta_ep_userip`
#
# --------------------------------------------------------
Not sure what’s going on here - is this me doing something wrong? I can supply the full .sql file if required.
Any ideas?
Dunc