andreask7 / lwt

Learning with Texts (LWT) is a tool for Language Learning. The official version (not this one) is available at :
http://lwt.sf.net
Other
33 stars 7 forks source link

backup? #16

Closed dif1754 closed 8 years ago

dif1754 commented 8 years ago

Hi.

I wanted to make a backup so I used the specific LWT button: image

I've opened the .sql.gz file and this is what I got (only drop and create of tables...). Where are the data?

Thanks.

-- lwt-backup-exp_version-2016-02-17-13-23-05.sql.gz

DROP TABLE IF EXISTS archivedtexts;
CREATE TABLE `archivedtexts` (   `AtID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,   `AtLgID` tinyint(3) unsigned NOT NULL,   `AtTitle` varchar(200) NOT NULL,   `AtText` text NOT NULL,   `AtAnnotatedText` longtext NOT NULL,   `AtAudioURI` varchar(200) DEFAULT NULL,   `AtSourceURI` varchar(1000) DEFAULT NULL,   PRIMARY KEY (`AtID`),   KEY `AtLgID` (`AtLgID`),   KEY `AtLgIDSourceURI` (`AtSourceURI`(20),`AtLgID`) ) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS archtexttags;
CREATE TABLE `archtexttags` (   `AgAtID` smallint(5) unsigned NOT NULL,   `AgT2ID` smallint(5) unsigned NOT NULL,   PRIMARY KEY (`AgAtID`,`AgT2ID`),   KEY `AgT2ID` (`AgT2ID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS feedlinks;
CREATE TABLE `feedlinks` (   `FlID` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,   `FlTitle` varchar(200) NOT NULL,   `FlLink` varchar(400) NOT NULL,   `FlDescription` text NOT NULL,   `FlDate` datetime NOT NULL,   `FlAudio` varchar(200) NOT NULL,   `FlText` longtext NOT NULL,   `FlNfID` tinyint(3) unsigned NOT NULL,   PRIMARY KEY (`FlID`),   UNIQUE KEY `FlTitle` (`FlNfID`,`FlTitle`),   KEY `FlLink` (`FlLink`(333)),   KEY `FlDate` (`FlDate`) ) ENGINE=MyISAM AUTO_INCREMENT=1823 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS languages;
CREATE TABLE `languages` (   `LgID` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,   `LgName` varchar(40) NOT NULL,   `LgDict1URI` varchar(200) NOT NULL,   `LgDict2URI` varchar(200) DEFAULT NULL,   `LgGoogleTranslateURI` varchar(200) DEFAULT NULL,   `LgExportTemplate` varchar(1000) DEFAULT NULL,   `LgTextSize` smallint(5) unsigned NOT NULL DEFAULT '100',   `LgCharacterSubstitutions` varchar(500) NOT NULL,   `LgRegexpSplitSentences` varchar(500) NOT NULL,   `LgExceptionsSplitSentences` varchar(500) NOT NULL,   `LgRegexpWordCharacters` varchar(500) NOT NULL,   `LgRemoveSpaces` tinyint(1) unsigned NOT NULL,   `LgSplitEachChar` tinyint(1) unsigned NOT NULL,   `LgRightToLeft` tinyint(1) unsigned NOT NULL,   PRIMARY KEY (`LgID`),   UNIQUE KEY `LgName` (`LgName`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS textitems2;
CREATE TABLE `textitems2` (   `Ti2WoID` mediumint(8) unsigned NOT NULL,   `Ti2LgID` tinyint(3) unsigned NOT NULL,   `Ti2TxID` smallint(5) unsigned NOT NULL,   `Ti2SeID` mediumint(8) unsigned NOT NULL,   `Ti2Order` smallint(5) unsigned NOT NULL,   `Ti2WordCount` tinyint(3) unsigned NOT NULL,   `Ti2Text` varchar(250) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,   PRIMARY KEY (`Ti2TxID`,`Ti2Order`,`Ti2WordCount`),   KEY `Ti2WoID` (`Ti2WoID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS newsfeeds;
CREATE TABLE `newsfeeds` (   `NfID` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,   `NfLgID` tinyint(3) unsigned NOT NULL,   `NfName` varchar(40) NOT NULL,   `NfSourceURI` varchar(200) NOT NULL,   `NfArticleSectionTags` text NOT NULL,   `NfFilterTags` text NOT NULL,   `NfUpdate` int(12) unsigned NOT NULL,   `NfOptions` varchar(200) NOT NULL,   PRIMARY KEY (`NfID`),   KEY `NfLgID` (`NfLgID`),   KEY `NfUpdate` (`NfUpdate`) ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS sentences;
CREATE TABLE `sentences` (   `SeID` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,   `SeLgID` tinyint(3) unsigned NOT NULL,   `SeTxID` smallint(5) unsigned NOT NULL,   `SeOrder` smallint(5) unsigned NOT NULL,   `SeText` text,   `SeFirstPos` smallint(5) unsigned NOT NULL,   PRIMARY KEY (`SeID`),   KEY `SeLgID` (`SeLgID`),   KEY `SeTxID` (`SeTxID`),   KEY `SeOrder` (`SeOrder`) ) ENGINE=MyISAM AUTO_INCREMENT=13661 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS settings;
CREATE TABLE `settings` (   `StKey` varchar(40) NOT NULL,   `StValue` varchar(40) DEFAULT NULL,   PRIMARY KEY (`StKey`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS tags;
CREATE TABLE `tags` (   `TgID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,   `TgText` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,   `TgComment` varchar(200) NOT NULL DEFAULT '',   PRIMARY KEY (`TgID`),   UNIQUE KEY `TgText` (`TgText`) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS tags2;
CREATE TABLE `tags2` (   `T2ID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,   `T2Text` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,   `T2Comment` varchar(200) NOT NULL DEFAULT '',   PRIMARY KEY (`T2ID`),   UNIQUE KEY `T2Text` (`T2Text`) ) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS texts;
CREATE TABLE `texts` (   `TxID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,   `TxLgID` tinyint(3) unsigned NOT NULL,   `TxTitle` varchar(200) NOT NULL,   `TxText` text NOT NULL,   `TxAnnotatedText` longtext NOT NULL,   `TxAudioURI` varchar(200) DEFAULT NULL,   `TxSourceURI` varchar(1000) DEFAULT NULL,   `TxPosition` smallint(5) DEFAULT '0',   `TxAudioPosition` float DEFAULT '0',   PRIMARY KEY (`TxID`),   KEY `TxLgID` (`TxLgID`),   KEY `TxLgIDSourceURI` (`TxSourceURI`(20),`TxLgID`) ) ENGINE=MyISAM AUTO_INCREMENT=89 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS texttags;
CREATE TABLE `texttags` (   `TtTxID` smallint(5) unsigned NOT NULL,   `TtT2ID` smallint(5) unsigned NOT NULL,   PRIMARY KEY (`TtTxID`,`TtT2ID`),   KEY `TtT2ID` (`TtT2ID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS words;
CREATE TABLE `words` (   `WoID` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,   `WoLgID` tinyint(3) unsigned NOT NULL,   `WoText` varchar(250) NOT NULL,   `WoTextLC` varchar(250) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,   `WoStatus` tinyint(4) NOT NULL,   `WoTranslation` varchar(500) NOT NULL DEFAULT '*',   `WoRomanization` varchar(100) DEFAULT NULL,   `WoSentence` varchar(1000) DEFAULT NULL,   `WoWordCount` tinyint(3) unsigned NOT NULL DEFAULT '0',   `WoCreated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,   `WoStatusChanged` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',   `WoTodayScore` double NOT NULL DEFAULT '0',   `WoTomorrowScore` double NOT NULL DEFAULT '0',   `WoRandom` double NOT NULL DEFAULT '0',   PRIMARY KEY (`WoID`),   UNIQUE KEY `WoTextLCLgID` (`WoTextLC`,`WoLgID`),   KEY `WoLgID` (`WoLgID`),   KEY `WoStatus` (`WoStatus`),   KEY `WoTranslation` (`WoTranslation`(20)),   KEY `WoCreated` (`WoCreated`),   KEY `WoStatusChanged` (`WoStatusChanged`),   KEY `WoWordCount` (`WoWordCount`),   KEY `WoTodayScore` (`WoTodayScore`),   KEY `WoTomorrowScore` (`WoTomorrowScore`),   KEY `WoRandom` (`WoRandom`) ) ENGINE=MyISAM AUTO_INCREMENT=1503 DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS wordtags;
CREATE TABLE `wordtags` (   `WtWoID` mediumint(8) unsigned NOT NULL,   `WtTgID` smallint(5) unsigned NOT NULL AUTO_INCREMENT,   PRIMARY KEY (`WtWoID`,`WtTgID`),   KEY `WtTgID` (`WtTgID`) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
dif1754 commented 8 years ago

I've just taken a look to the PHP log (found via the XAMP app) and this is was I found:

[[17-Feb-2016 13:25:09 Europe/Berlin] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, object given in C:\xampp\htdocs\lwt\backup_restore.php on line 83

[17-Feb-2016 13:25:09 Europe/Berlin] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, object given in C:\xampp\htdocs\lwt\backup_restore.php on line 83

[17-Feb-2016 13:25:09 Europe/Berlin] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, object given in C:\xampp\htdocs\lwt\backup_restore.php on line 83

[17-Feb-2016 13:25:09 Europe/Berlin] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, object given in C:\xampp\htdocs\lwt\backup_restore.php on line 83

[17-Feb-2016 13:25:09 Europe/Berlin] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, object given in C:\xampp\htdocs\lwt\backup_restore.php on line 83

[17-Feb-2016 13:25:09 Europe/Berlin] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, object given in C:\xampp\htdocs\lwt\backup_restore.php on line 83

[17-Feb-2016 13:25:09 Europe/Berlin] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, object given in C:\xampp\htdocs\lwt\backup_restore.php on line 83

[17-Feb-2016 13:25:09 Europe/Berlin] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, object given in C:\xampp\htdocs\lwt\backup_restore.php on line 83

[17-Feb-2016 13:25:09 Europe/Berlin] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, object given in C:\xampp\htdocs\lwt\backup_restore.php on line 83

[17-Feb-2016 13:25:09 Europe/Berlin] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, object given in C:\xampp\htdocs\lwt\backup_restore.php on line 83

[17-Feb-2016 13:25:09 Europe/Berlin] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, object given in C:\xampp\htdocs\lwt\backup_restore.php on line 83

[17-Feb-2016 13:25:09 Europe/Berlin] PHP Warning: mysql_fetch_row() expects parameter 1 to be resource, object given in C:\xampp\htdocs\lwt\backup_restore.php on line 83

](url)

andreask7 commented 8 years ago

Hello, please change mysql_fetch_row($result) into mysqli_fetch_row($result) in backup_restore.php on line 83

dif1754 commented 8 years ago

Hi, I did it, it seems to work, there are data inside the file; but I did not make the actual RESTORE to see if everything is really restored. Hope all is ok (please, can you make the test?).

Thanks.

andreask7 commented 8 years ago

Hello, I found another bug. Change convert_string_to_sqlsyntax into convert_string_to_sqlsyntax_nonull in backup_restore.php on line 86 and on line 166 and make a new backup. If you want to test, whether everything works, you can create a new table set by clicking on Default Table Set at the bottom of index.php and load the backup

dif1754 commented 8 years ago

Hi I created a new Table Set, but when I try to restore the backup via LWT onto that new Table Set, the web app is waiting several seconds to import the data, too much.

After a while I try to use the program but it seems blocked: I click anywhere, then wait a lot of time, tens of seconds.... unusable.

If I delete the all the tables with "Table Set"_ with phpMyAdmin, the program start to behave normally....

I did some tests with several table set names, but the web app becomes slow......

I don't know, I guess I will use the phpmyAdmin, I feel safer and don't have those kinds of issues...

Bye

dif1754 commented 8 years ago

UPDATE: after I switched back to the default Table Set, the web app as was fast as usual (local db)... then I switched to the other Table Set, and also that was fast.

I don't know... maybe mySQL server was doing some internal job after the import?

Anyhow, since the restore is working on the other Table Set, I will delete that Table Set and continue to use the Default one.

Bye

dif1754 commented 8 years ago

UPDATE 2: for the sake of curiosity, after experiencing the slowness in the last 10 import tests, I did it once again with a new Table Set and NOW all is as fast as usual on both Table Sets...

Maybe was a personal temporary problem?

Anyhow, now it works.

Bye