{"id":2056,"date":"2013-02-03T21:13:39","date_gmt":"2013-02-04T02:13:39","guid":{"rendered":"http:\/\/fiveforks.com\/ted\/?p=2056"},"modified":"2013-02-03T21:13:39","modified_gmt":"2013-02-04T02:13:39","slug":"wikimedia-database","status":"publish","type":"post","link":"https:\/\/www.fiveforks.com\/ted\/2013\/02\/wikimedia-database\/","title":{"rendered":"Wikimedia Database"},"content":{"rendered":"<p>This past week, a guy signed up to edit the Flashlight Wiki, and he even sent me an email asking to be confirmed, like the instructions say to do. I went ahead and confirmed him for editing and he went to work on the article about Maglites. Apparently on Wikipedia, there was some information being added that was kind of critical of Maglites, and some people said the information didn&#8217;t have legitimate sources since it was from flashlight discussion forums. Because it was still good information, this guy thought it would be good to move it to Flashlight Wiki, where sourcing isn&#8217;t quite as rigorous. I didn&#8217;t have a problem with that.<br \/>\n<!--more--><br \/>\nOne of the things they have on Wikipedia that is not included in a MediaWiki installation is the ability to have footnotes. Even if you install the extension Cite (which I have done), you can&#8217;t use the same format that they use on Wikipedia without installing additional extensions and templates. The Wikipedia version has kind of a fill-in of different aspects of a source like the author, date, title, etc. Then the template takes that data and puts the footnote in the correct format. To me that has always been a pain, but I&#8217;m starting to come around on it.<\/p>\n<p>In order to get that template to work, I had to install the extension ParserFunctions, which is actually included in the MediaWiki installation, but not enabled. So all I had to do was enable it in the localsettings.php file. I also enabled string functions. The guy added the cite web template and everything worked great.<\/p>\n<p>But then today I was doing my weekly backup of the MediaWiki database. Usually when I export the database from the PhpMyAdmin control panel, the gzipped archive runs about 10 MB. I also sometimes create a zip file of all of the MediaWiki installation, which runs about 25 MB, and includes all of the pictures, extensions, skins, etc. Though I&#8217;ve never needed to do a recovery, these two files should let me recover the entire website. The database contains all of the text content, users, edit history, etc. while the zip archive has the settings and pictures.<\/p>\n<p>By the time the database finishes downloading, it is 125 MB, over 10 times the size of the last archive. This is not a good thing. The only thing different that I can think of is me enabling ParserFunctions and the rest of the stuff to get better footnotes. I looked up ways to compact the database, but there doesn&#8217;t seem to be much that can be done. So I decide I will revert the database back to my backup. I go through the list of recent edits and copy the source of all the articles that have changed since the last backup, and save the text in text files.<\/p>\n<p>In phpMyAdmin, I tried importing the backup of the database, but it gave me an error because the database already existed. So I figured I would rename the current database, and then import the backup database into the correct name. I was able to do this, but for some reason the database didn&#8217;t show up in my list of databases in the My SQL Databases control panel. I&#8217;m not sure what is up with that, but the renamed database is still there with the new name. The bad thing is I could delete the database if it would show up, but not if it doesn&#8217;t show up. So instead I delete the renamed database, which for some reason it lets me do. Then I replace it with the contents of the backup database. If I try to import it into the correct name of the database, it tells me the database exists already. But since I have the backup database installed under the new name, I just go ahead and change the wiki&#8217;s localsettings.php file to use the renamed database. And that works out perfectly. Then I went in and re-edited the articles that had changed since the last backup, uploaded two pictures I had uploaded since the last backup, and then reformatted the footnotes using regular old cite instead of cite web.<\/p>\n<p>Anyway, it&#8217;s all working, and I&#8217;ve also reduced the size of my web host account with database getting smaller. Since the old database was still in phpMyAdmin, I did go in and delete all of its tables at least.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This past week, a guy signed up to edit the Flashlight Wiki, and he even sent me an email asking to be confirmed, like the instructions say to do. I went ahead and confirmed him for editing and he went to work on the article about Maglites. Apparently on Wikipedia, there was some information being &hellip; <a href=\"https:\/\/www.fiveforks.com\/ted\/2013\/02\/wikimedia-database\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Wikimedia Database&#8221;<\/span><\/a><\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2056","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.fiveforks.com\/ted\/wp-json\/wp\/v2\/posts\/2056","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fiveforks.com\/ted\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fiveforks.com\/ted\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fiveforks.com\/ted\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fiveforks.com\/ted\/wp-json\/wp\/v2\/comments?post=2056"}],"version-history":[{"count":1,"href":"https:\/\/www.fiveforks.com\/ted\/wp-json\/wp\/v2\/posts\/2056\/revisions"}],"predecessor-version":[{"id":2057,"href":"https:\/\/www.fiveforks.com\/ted\/wp-json\/wp\/v2\/posts\/2056\/revisions\/2057"}],"wp:attachment":[{"href":"https:\/\/www.fiveforks.com\/ted\/wp-json\/wp\/v2\/media?parent=2056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fiveforks.com\/ted\/wp-json\/wp\/v2\/categories?post=2056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fiveforks.com\/ted\/wp-json\/wp\/v2\/tags?post=2056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}