Topic on Project:Support desk

Backup: Extract database?

5
84.143.94.123 (talkcontribs)

I have the following situation:

Server HDD crash with just a backup of the mysql data base. The former admin is not available anymore and we have no knowledge of MySQL or PHP, Media wiki is some older version from ~2010.

I can see all the wiki pages in mysql\data\wiki\text.MYD. However it is one huge file with 1.3 million lines and it contains every version of every page.

Is it possible to extract the wiki pages in some useful form?

88.130.101.155 (talkcontribs)

In order to set up the wiki again, you need two things: The wiki files (the MediaWiki source code, best would be exactly that version, which you had before, and custom things in your install like uploaded images and the LocalSettings.php file) and secondly the database.

If you have the complete mysql/data/ folder, you might be very lucky. I guess that with all files from there, you should be able to restore the whole database.

Reading up here http://stackoverflow.com/questions/879176/how-to-recover-mysql-db-from-myd-myi-frm-files makes it sound like it is simple to restore the tables, if they were of the MyISAM type (= you have .myd, .myi and .frm files).

If you have InnoDB types, you have to do some additional magic, see http://stackoverflow.com/questions/10934745/restore-the-mysql-database-from-frm-files.

84.143.94.175 (talkcontribs)

Thank you!

I was able to set up xampp on a local pc, copy the old mysql database to mysql\data\ and run mysql with --skip-grant-tables to disable the password check.

Then I could open this database in the current version of mediawiki without problem and save all pages I needed.

84.146.102.83 (talkcontribs)

Okay, turns out there is one problem left:

Every wiki page that contains a special character like ü, ä, ö is now missing. For example the page "Technik" is now accessible but "Übersetzen" is now red and missing.

Is there some kind of text encoding option that I have to change?

Ciencia Al Poder (talkcontribs)

Maybe you need to set $wgDBTableOptions to specify the correct charset. But that may be hard to know beforehand. If it was an old installation, it may be latin1, or utf8, or who knows...

Reply to "Backup: Extract database?"