I'm running MediaWiki on our intranet at work. I recently upgraded our server from Mac OS X 10.3 to 10.4. In the process the MySQL default database location appears to have been moved, so MediaWiki couldn't see its database. I've also subsequently reinstalled MediaWiki (but to a more recent version than before the system upgrade), giving it a new database.
My question is, having found the old database in a directory call wiki (but with no .sql suffix), consisting of the files as pasted below, how do I recover it for the latest version of MediaWiki I have installed?:
I've tried simply moving the database to the new location and attempting to open it with phpMyAdmin but it said "No tables found in database," and:
Warning: mysql_query(): Unable to save result set in /Library/ WebServer/>Documents/phpMyAdmin/libraries/mysql_wrappers.lib.php on line 104 Error SQL-query : SHOW TABLE STATUS FROM `wiki-two` MySQL said: #12 - Can't read dir of './wiki-two/' (Errcode: 13)
You can read more about my situation here: http://discussions.info.apple.com/webx?13@711.nKKQa2uWSAL.4@.68b8e7c3
Thanks, Christiaan
Files I found, which I assume are my database:
archive.MYD links.MYD querycache.MYI archive.MYI links.MYI querycache.frm archive.frm links.frm recentchanges.MYD brokenlinks.MYD links_backup.MYD recentchanges.MYI brokenlinks.MYI links_backup.MYI recentchanges.frm brokenlinks.frm links_backup.frm searchindex.MYD categorylinks.MYD linkscc.MYD searchindex.MYI categorylinks.MYI linkscc.MYI searchindex.frm categorylinks.frm linkscc.frm site_stats.MYD cur.MYD logging.MYD site_stats.MYI cur.MYI logging.MYI site_stats.frm cur.frm logging.frm user.MYD hitcounter.frm math.MYD user.MYI image.MYD math.MYI user.frm image.MYI math.frm user_newtalk.MYD image.frm objectcache.MYD user_newtalk.MYI imagelinks.MYD objectcache.MYI user_newtalk.frm imagelinks.MYI objectcache.frm user_rights.MYD imagelinks.frm old.MYD user_rights.MYI interwiki.MYD old.MYI user_rights.frm interwiki.MYI old.frm watchlist.MYD interwiki.frm oldimage.MYD watchlist.MYI ipblocks.MYD oldimage.MYI watchlist.frm ipblocks.MYI oldimage.frm ipblocks.frm querycache.MYD
Christiaan Briggs wrote:
I'm running MediaWiki on our intranet at work. I recently upgraded our server from Mac OS X 10.3 to 10.4. In the process the MySQL default database location appears to have been moved, so MediaWiki couldn't see its database. I've also subsequently reinstalled MediaWiki (but to a more recent version than before the system upgrade), giving it a new database.
[snip]
Thanks, Christiaan
Files I found, which I assume are my database:
[snip]
You really messed it up.
The *.myd and *.frm files (and the others in the dir) are used internally by MySQL. MediaWiki can't do squat with them.
Basically, shutdown MySQL. Either move the files to the current DB location or change the location to match them. Start MySQL and make sure that went ok.
Create AdminSettings.php, according to the template. Then run maintenance/update.php from the command-line (doesn't work on HTTP!) to upgrade the DB schema. Depending on the size of the wiki, this may take some time.
Then try out the wiki before calling it done. Make sure that you can login, logout, edit pages (logged in and anon), upload files, etc. Be especially watchful for session issues.
BTW, I hope you backed up before beginning this project.
-- Jamie ------------------------------------------------------------------- http://endeavour.zapto.org/astro73/ Thank you to JosephM for inviting me to Gmail! Have lots of invites. Gmail now has 2GB.
On 13 Sep 2005, at 8:50 pm, Jamie Bliss wrote:
You really messed it up.
Yup. Thanks for your help.
BTW, I hope you backed up before beginning this project.
Well, no, but not for lack of trying. I had just finished getting our new backup system running: 3x 100 GB portable hard disks on rotation backing up all production data each day from the server and everyone's home folders from their machines. Problem is somewhere along the line I dropped the script out of Retrospect that backed up relevant intranet files, and although I run my own blog and religiously fetch a dump of my database every time I add a post, for some reason I just didn't backup our MySQL database at work. Being an amateur (my real job is drawing buildings) you tend to learn these things the hard way. :(
(At the moment I'm comforting myself with the fact that if all else fails I can at least open the database files up in a text editor and extract the text)
Basically, shutdown MySQL. Either move the files to the current DB location or change the location to match them. Start MySQL and make sure that went ok.
Okay, I can now view the database in phpMyAdmin, however somethings not quite right as it says all the tables are in use and when I try to look at any given table is says it can't find it: e.g. MySQL said: #1017 - Can't find file: './wiki/cur.frm' (errno: 13)
Create AdminSettings.php, according to the template. Then run maintenance/update.php from the command-line (doesn't work on HTTP!) to upgrade the DB schema. Depending on the size of the wiki, this may take some time.
I created AdminSettings.php and ran the script, however this is what I got (related to above, as in something's pointing to the wrong place?):
Server:/Library/WebServer/Documents/wiki/maintenance root# php update.php Going to run database updates for wiki Depending on the size of your database this may take a while! Abort with control-c in the next five seconds to aboard.. 0 Creating linkscc table...ok Creating hitcounter table...A database error has occurred Query: CREATE TABLE hitcounter ( hc_id INTEGER UNSIGNED NOT NULL ) TYPE=HEAP MAX_ROWS=25000 Function: Error: 1050 Table 'hitcounter' already exists (localhost)
Backtrace: GlobalFunctions.php line 524 calls wfbacktrace() Database.php line 383 calls wfdebugdiebacktrace() Database.php line 333 calls database::reportqueryerror() install-utils.inc line 118 calls database::query() updaters.inc line 44 calls dbsource() updaters.inc line 195 calls add_table() update.php line 26 calls do_all_updates()
I'm assuming you're going to tell me to put it back in the original directory and to get MySQL up and running using the old directory. I'm dreading that; I was winging it just to get MySQL and PHP talking to each other as it is (using someone else's step-by-step instructions).
Thanks again, Christiaan
This might be relevant, I don't know:
When I moved my database (named "wiki") to the new location I renamed the new one that had been created when I reinstalled MediaWiki, from "wiki" to "wiki-temp" and put the old one in place.
Christiaan
On 13 Sep 2005, at 10:27 pm, Christiaan Briggs wrote:
On 13 Sep 2005, at 8:50 pm, Jamie Bliss wrote:
You really messed it up.
Yup. Thanks for your help.
BTW, I hope you backed up before beginning this project.
Well, no, but not for lack of trying. I had just finished getting our new backup system running: 3x 100 GB portable hard disks on rotation backing up all production data each day from the server and everyone's home folders from their machines. Problem is somewhere along the line I dropped the script out of Retrospect that backed up relevant intranet files, and although I run my own blog and religiously fetch a dump of my database every time I add a post, for some reason I just didn't backup our MySQL database at work. Being an amateur (my real job is drawing buildings) you tend to learn these things the hard way. :(
(At the moment I'm comforting myself with the fact that if all else fails I can at least open the database files up in a text editor and extract the text)
Basically, shutdown MySQL. Either move the files to the current DB location or change the location to match them. Start MySQL and make sure that went ok.
Okay, I can now view the database in phpMyAdmin, however somethings not quite right as it says all the tables are in use and when I try to look at any given table is says it can't find it: e.g. MySQL said: #1017 - Can't find file: './wiki/cur.frm' (errno: 13)
Create AdminSettings.php, according to the template. Then run maintenance/update.php from the command-line (doesn't work on HTTP!) to upgrade the DB schema. Depending on the size of the wiki, this may take some time.
I created AdminSettings.php and ran the script, however this is what I got (related to above, as in something's pointing to the wrong place?):
Server:/Library/WebServer/Documents/wiki/maintenance root# php update.php Going to run database updates for wiki Depending on the size of your database this may take a while! Abort with control-c in the next five seconds to aboard.. 0 Creating linkscc table...ok Creating hitcounter table...A database error has occurred Query: CREATE TABLE hitcounter ( hc_id INTEGER UNSIGNED NOT NULL ) TYPE=HEAP MAX_ROWS=25000 Function: Error: 1050 Table 'hitcounter' already exists (localhost)
Backtrace: GlobalFunctions.php line 524 calls wfbacktrace() Database.php line 383 calls wfdebugdiebacktrace() Database.php line 333 calls database::reportqueryerror() install-utils.inc line 118 calls database::query() updaters.inc line 44 calls dbsource() updaters.inc line 195 calls add_table() update.php line 26 calls do_all_updates()
I'm assuming you're going to tell me to put it back in the original directory and to get MySQL up and running using the old directory. I'm dreading that; I was winging it just to get MySQL and PHP talking to each other as it is (using someone else's step-by-step instructions).
Thanks again, Christiaan _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Here is some of the error log that might be relevant too:
050913 21:50:33 mysqld started 050913 21:50:33 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive 050913 21:50:34 InnoDB: Started; log sequence number 0 43644 /usr/local/mysql/bin/mysqld: ready for connections. Version: '4.1.14-standard' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Edition - Standard (GPL) 050913 21:51:04 [ERROR] /usr/local/mysql/bin/mysqld: Can't find file: './wiki/archive.frm' (errno: 13)
.... and so on.
As far as I can tell my database is in /usr/local/mysql/data/ rather than /usr/local/mysql/bin/mysqld (in fact I can't even see a /usr/ local/mysql/bin/mysqld directory), although as far as I know /bin/ mysqld might just be some kind of alias or shortcut (dunno how it all works to be honest).
Christiaan
On 13 Sep 2005, at 10:35 pm, Christiaan Briggs wrote:
This might be relevant, I don't know:
When I moved my database (named "wiki") to the new location I renamed the new one that had been created when I reinstalled MediaWiki, from "wiki" to "wiki-temp" and put the old one in place.
Christiaan
On 13 Sep 2005, at 10:27 pm, Christiaan Briggs wrote:
On 13 Sep 2005, at 8:50 pm, Jamie Bliss wrote:
You really messed it up.
Yup. Thanks for your help.
BTW, I hope you backed up before beginning this project.
Well, no, but not for lack of trying. I had just finished getting our new backup system running: 3x 100 GB portable hard disks on rotation backing up all production data each day from the server and everyone's home folders from their machines. Problem is somewhere along the line I dropped the script out of Retrospect that backed up relevant intranet files, and although I run my own blog and religiously fetch a dump of my database every time I add a post, for some reason I just didn't backup our MySQL database at work. Being an amateur (my real job is drawing buildings) you tend to learn these things the hard way. :(
(At the moment I'm comforting myself with the fact that if all else fails I can at least open the database files up in a text editor and extract the text)
Basically, shutdown MySQL. Either move the files to the current DB location or change the location to match them. Start MySQL and make sure that went ok.
Okay, I can now view the database in phpMyAdmin, however somethings not quite right as it says all the tables are in use and when I try to look at any given table is says it can't find it: e.g. MySQL said: #1017 - Can't find file: './wiki/cur.frm' (errno: 13)
Create AdminSettings.php, according to the template. Then run maintenance/update.php from the command-line (doesn't work on HTTP!) to upgrade the DB schema. Depending on the size of the wiki, this may take some time.
I created AdminSettings.php and ran the script, however this is what I got (related to above, as in something's pointing to the wrong place?):
Server:/Library/WebServer/Documents/wiki/maintenance root# php update.php Going to run database updates for wiki Depending on the size of your database this may take a while! Abort with control-c in the next five seconds to aboard.. 0 Creating linkscc table...ok Creating hitcounter table...A database error has occurred Query: CREATE TABLE hitcounter ( hc_id INTEGER UNSIGNED NOT NULL ) TYPE=HEAP MAX_ROWS=25000 Function: Error: 1050 Table 'hitcounter' already exists (localhost)
Backtrace: GlobalFunctions.php line 524 calls wfbacktrace() Database.php line 383 calls wfdebugdiebacktrace() Database.php line 333 calls database::reportqueryerror() install-utils.inc line 118 calls database::query() updaters.inc line 44 calls dbsource() updaters.inc line 195 calls add_table() update.php line 26 calls do_all_updates()
I'm assuming you're going to tell me to put it back in the original directory and to get MySQL up and running using the old directory. I'm dreading that; I was winging it just to get MySQL and PHP talking to each other as it is (using someone else's step- by-step instructions).
Thanks again, Christiaan _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org