Manual talk:Moving a wiki

Please post support requests on Project:Support desk. Thanks, robchurch | talk 06:20, 13 January 2007 (UTC)

Refactor to [backup, install, restore]
I was a bit surprised that


 * 1) MediaWiki had a backup manual, but no restore manual ... since, obviously, one needs to be able to restore a backup.
 * 2) This manual (appropriately) points to the backup manual (to avoid duplication and variant versions of information).
 * 3) This manual has essentially no information about installing MediaWiki onto the destination server (which may be required for a move or duplication).
 * 4) This manual has a considerable amount of material that was about restoring from a backup.

So I


 * 1) copied the restore-related sections from this manual to a new restore manual
 * 2) edited the new restore manual to remove the assumption that one was moving or duplicating onto a new MediaWiki instance (since one may restore onto the same instance from which one backed up)
 * 3) recommend that this manual be refactored to
 * 4) point to the new restore manual, deleting the copied restore-oriented material
 * 5) point to appropriate installation instructions, e.g., the installation guide

I.e., I recommend that this manual be replaced with essentially 3 links


 * 1) backup origin wiki
 * 2) (optional) install MediaWiki on destination server
 * 3) restore backup to new destination MediaWiki

with "glue text" as needed. I can do this if desired, just send email. --Tlroche 23:53, 9 December 2011 (UTC)

Still in need of more detail
in the back up the database section the article states "you need to backup the database" which is not only fantastically obvious but also not terribly helpful. Recommend that we actually create instructions on HOW to do this. it wouldn't be hard to adapt these wiki instructions for backing up a wordpress mysql file.

http://codex.wordpress.org/Backing_Up_Your_Database


 * Actually, I put up a decent step-by-step instruction set for Ubuntu here: Manual talk:Backing up a wiki KermEd 18:10, 12 May 2011 (UTC)

Which directory to back up?
Thanks Rob for the rewrite. It is good. Is it only the images folder that needs to be backed up? If so, maybe the guide could just be tweaked to explain this. Also, perhaps it could be extended to explain that this can also be used as an operations guide for backup & restore. --Mydoghasworms 19:47, 31 May 2006 (UTC)

Complete rewrite
A complete rewrite of this guide is available at Help:How to move a wiki to another server. After a user complaint in the #mediawiki IRC channel, I lashed out and rewrote the lot. Rob Church Talk 20:14, 30 December 2005 (UTC)
 * link is broken 69.251.20.244 19:00, 17 February 2007 (UTC)

I fixed it. Adamtheclown 03:17, 23 November 2010 (UTC)

Only for upgrades?
Newbie question: is this only for a situation of moving a database from one database server to another? It seems like upgrading would do the same thing as moving a database, unless it's on a different server. --Mr alex hall 08:55, 7 Dec 2004 (UTC)


 * It's for moving from one server to another. Upgrading doesn't require nearly as much effort, although you should still be making backups. Rob Church Talk 20:20, 30 December 2005 (UTC)

Getting the Help pages
Also, I'd like to install the Help: pages. How does one download data from Meta-wiki, or any mediawiki that one doesn't have admin privileges on? Drauh 05:20, 24 Dec 2004 (UTC)


 * Use Special:Export with a list of page titles. Rob Church Talk 20:20, 30 December 2005 (UTC)

Null password
Tony: I'm working on a shell script to auto back up my wiki, is there a way to pass a null password to mysqldump? I've tried every thing like --password="" and "echo "" | mysqldump..."


 * If you have a null password, normally you'd just not pass a password parameter. --brion 08:06, 18 Mar 2005 (UTC)

Preparing for download
When i want to export the database like the devs do, with cur, old and so, what are the commands? They don't export all tables, or? -- MichaelDiederich 23:12, 23 Mar 2005 (UTC)


 * Using the command-line client for mySQL, you can specify a list of tables to be included. Third-party utilities such as phpMyAdmin allow you to exclude certain tables from dumps too. Rob Church Talk 20:20, 30 December 2005 (UTC)

Clearing the cache
I moved the URL location of my wiki. This resulted in wrong URL for the topics in the wiki. I found out that wiki was using a cache to speed up things. To clear the cache I removed all records from object_cache. Is there another option to clear the cache or this the way to do so? Please advice. J.C. Wesdorp (212.238.212.92 21:34, 12 July 2005 (UTC))


 * That should work fine. If moving to a new server, however, check the value of $IP and $wgScriptPath in LocalSettings.php or links will be generated without the correct URL. Rob Church Talk 20:20, 30 December 2005 (UTC)

Temporary files
It looks like there's a bunch of stuff in the images directory that doesn't need to be backed up. The timeline and tmp directories seem to contain images generated by EasyTimeline -- they'll be regenerated if deleted. What about the temp and thumbs directories? Will they be regenerated, too? --MarcSherman 19:06, 22 July 2005 (UTC)


 * Temp does not need to be preserved at all. Thumbs can be discarded, but you should then also clear the parser cache to ensure that they are regenerated when pages using them are re-rendered. --brion 09:48, 23 July 2005 (UTC)

Shared hosting
What about remote webhosting. How can simple users backup all their data and move the wiki to a new server/location if they cannot run shell scripts?


 * For these situations, I find third party tools such as phpMyAdmin do an adequate job; indeed, I prefer using it to the command-line client at times. Rob Church Talk 20:20, 30 December 2005 (UTC)


 * You can not import using phpMyAdmin, can you?

Database Restore
Hi, I'm running a mediawiki 1.5.5 on my workstation at work. Quite unexpectedly, my workstation was swaped out without any notice. I did have a copy of my wiki installation and the MySQL/data/wiki/ folder with the wiki database in it saved on a network share from a week prior. After installing L.A.M.P. back on the new workstation (mysql 4.1, just like the old workstation) I tried to drop in the old \data folder hoping everything would work, but it doesn't. phpMyAdmin gives the following:
 * #1016 - Can't open file: 'archive.ibd' (errno: 1)

Please help!

--bryce

P.S. - Let me know if this isn't the right place to post this, I couldn't find a help forum anywhere.

Reply
The wikidb database is an InnoDB database. The archive.idb isn't a real file, it's a virtual file within /var/lib/mysql/ibdata1. /var/log/mysqld.log should point you to http://www.innodb.com/ibman.html section 15.1, which in turn gets you to http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting-datadict.html for some background. Restore the top-level /var/lib/mysql files and you may be all set.

I'm not sure that this will fix your problem, but it's my best guess.

SQL syntax error after import
Hi, I'm running the newest mediawiki, and something went wrong with my previous installation (I got blank screen) so I exported the sql, reinstalled the newest wiki and got it working, and then overwrited the tables. When I set it up, it says:

Tietokantavirhe Tietokantakyselyssä oli syntaksivirhe. Syynä saattaa olla virheellinen kysely, tai se saattaa johtua ohjelmointivirheestä. Viimeinen tietokantakysely, jota yritettiin, oli: (SQL-kysely piilotettu) . Se tehtiin funktiosta ”Block::load”. MySQL palautti virheen ”1054: Unknown column 'ipb_anon_only' in 'where clause' (localhost)”.

Someone in the 'net suggested running maintenance/update.php from the command line, but it isn't an option, since all I have is a ftp connection, not ssh. Any suggestions?

--Timo H. / Finland

mysqldump
I just added an example command to back up the database using mysqldump. I'm a novice and don't know if this is sufficient; it would be lovely if someone could verify. Thanks - Tempshill2 18:26, 17 January 2006 (UTC)

Could someone add an example command for restoring the database? That'd be very nice :) Thanks --128.253.43.26 21:08, 7 February 2006 (UTC)

Can't import
So I followed the directions on exporting the wiki database, but I can't import in on my other server. I keep getting syntax errors with the import SQL. Is there a forum that I can go to and get help for this kind of trouble?
 * Hi, prehaps some common errors should be mentioned here. You didn't mention the error number but the most common one is, that your mysql versions are not the same. In case you export the database with phpMyAdmin you can choose a compatible-mode. You should choose one which sounds like the version of your mysql on the destination server. Another common error is, InnoDB is not accepted. I worked around this by replacing InnoDB by MyISAM. I think its not the best way but it worked. (Most editors (kate) have a replace_all funktion included, I made use of this one). Lukas

Corrupt page titles after restore
I performed a backup of the database (using phpMyAdmin and also mysqldump) and then a restore and all the article titles that contained special Romanian characters were corrupted. Titles without special characters were not affected, and the body of all articles WITH or WITHOUT special characters were not affected. I'm running Wiki 1.6.3, source system is Linux with My SQL 4.1.19, destination system is Windows with My SQL 4.1.20

MySQL server collation is UTF-8, the database collation is latin1_swedish_ci, and columns are latin1_bin. I tried using the mysqldump --default-character-set=latin1 but that didn't work either.
 * Hello. I've got the same problem with MW 1.5.4 and two GNU/Linux systems : before backup and after. Is there really nobody who knows the solution ?
 * --Xiloynaha

Guarantees downtime
Doing it this way seems a bit amateurish as it guarantees downtime. I'm sure there has to be a better way, such as installing Mediawiki on the new host with the same settings, updating DNS to point there, and setting the new MySQL as a slave database until it's caught up? Then once DNS has propogated and the databases aligned, turn the old wiki off? I've no idea if this works in practice I might add :) --Kingboyk 18:10, 10 January 2007 (UTC)

Need more details
The instructions don't help, they just refer to other places... annoying indeed. 69.251.20.244 18:57, 17 February 2007 (UTC)

Can I import pages from a moinmoin wiki?
I have a little wiki with just one user (me) that I created with moinmoin. I'd like to import the content to my new MediaWiki. How can I do it?

Changing the folder's name post-install
Hi, this is my first post here, I will try to keep a high SNR.

@Before: a freshly installed MediaWiki 1.11 (upgraded from 1.6), labelled mediawiki-1.11.0 @after: a non-working MediaWiki 1.11 simply labelled mediawiki.

Removing the version number from the folder name broek the wiki. I modified LocalSetting.php (the $wgScriptPath variable) but it still does not work.

Here is the text I get:

Warning: require_once(/srv/d_latapie/www/www.latapie.name/htdocs/mediawiki-1.11.0/includes/ProfilerStub.php) [function.require-once]: failed to open stream: No such file or directory in /srv/d_latapie/www/www.latapie.name/htdocs/mediawiki-1.11.0/StartProfiler.php on line 3

Fatal error: require_once [function.require]: Failed opening required '/srv/d_latapie/www/www.latapie.name/htdocs/mediawiki-1.11.0/includes/ProfilerStub.php' (include_path='.:/usr/share/php:/usr/share/pear') in /srv/d_latapie/www/www.latapie.name/htdocs/mediawiki-1.11.0/StartProfiler.php on line 3

Any idea on how to solve it? Thank you. David Latapie 06:32, 17 January 2008 (UTC)
 * Hi - I have a similar problem. I just want to change my wiki folder's name, but it breaks everything. Do I have to do a SQLDump, delete the DB, reinstall and import... or is there an easy solution? Thanks, --Thekryz 16:19, 18 May 2008 (UTC)

In your LocalSettings.php file, look for any mention of the old name and replace it by the new name. It should work then. No pathes are stored in the database. -- Duesentrieb ⇌ 08:21, 19 May 2008 (UTC)

PS: Note that $wgScriptPath refers to the web path, while the error above is caused by a bad include path. The include path is stored in the variable $IP, which is usually atomatically set at the very top of your LocalSettings.php file. You can try to set it to the absolute (filesystem) path of your installation manually, just before the line saying $path = array... HTH -- Duesentrieb ⇌ 08:25, 19 May 2008 (UTC)

PPS: hm, actually... StartProfiler is special, because it's used before LocalSettings is even read. It doesn't use $IP at all. Since it's in the same directory as the index.php, it should always simply work. Hm... this *could* be caused by symlinking the include directory. other than that, I have no idea. -- Duesentrieb ⇌ 08:28, 19 May 2008 (UTC)

Not the exact answer to OP's problem, but something that could give a headache to newbies like me. When shifting the wiki, make sure that in LocalSettings.php, all the variables containing path are changed properly. In my case, it was $wgArticle variable which needed to be changed. But, it is not clear from the article. -- Mehul Ved 08:16, 19 September 2009 (UTC)

These instructions are terrible
It is very sad that eight years after mediawiki was first created, mediawiki, a program intended to involve everyone in the creative process, can only be installed by a minute portion of the population.

Part of the problem is the complex software, but a good portion of the blame is the god awful instructions found on most mediawiki pages. This page is a shining example of computer geniuses attempting to write simple easy to understand instructions and failing miserably. This sentence embodies how worthless the majority of the instructions are for the vast majority of people:
 * On the destination server, create a new MySQL database and a user, and grant that user permissions on the database. SELECT, INSERT, UPDATE and DELETE permissions should suffice. You may need to consult the MySQL documentation, your hosting provider's control panel documentation, or the documentation of any other utilities you are using for information on how to do this.

You might as well be explaining quantum mechanics to myself and most people. Complex terms are not explained, there are no screenshots, the writers make a lot of assumptions, and it is written badly.

As someone who has published a guide, over the past five years I have spent hundreds of hours attempting to rewrite dozens of articles here and other mediawiki sites to the best of my ability. But articles like this are nearly hopeless.

I don't know why it is that technical information on wikipedia and guides on mediawiki are so completely worthless. Why?

Maybe the mediawiki foundation can hire professional writers to volunteer to write these pages. Maybe the mediawiki can ask current authors to release their guides to mediawiki. All I know is this guide is awful, a reflection of most pages on this mediawiki.

I would rewrite it myself from the ground up, but I just spent 20 days trying to get help to upload multiple images to my wikia. My multiple requests for help here and IRC were left unanswered, and I finally ended up paying someone $65 to help me. I don't have the technical skills to write this without dedicated help.

In 2012 at mediawiki's ten year anniversary is there still not going to be a simple mediawiki installation guide that even 30% of the public can understand?

Adamtheclown

video tutorial of how to install mediawiki?
Note there maybe a good enough video found on youtube already:


 * I was thinking about this lately, maybe:
 * installation videos,
 * screenshots taken from those videos, and
 * written tutorials corresponding to those screenshots
 * added to this page would be the way to go.
 * Even though I no longer need another mediawiki, I would be willing to work with an established trusted editor to create a mediawiki installation video, installing mediawiki on my site on my computer:
 * An editor could log on through logmein onto my computer.
 * I would turn on a screen video capturer
 * We could discuss the video progress real time over Skype as this editor installs mediawiki. As a complete newbie, who has never installed mediawiki, I would be able to give them a newbies perspective on what is confusing and when to slow down the installation for the video.
 * We would edit out the personal information and post it here or on youtube if there is a youtube extension on this site.
 * I could then take screenshots from this mediawiki installation video to create a written tutorial.
 * I have a domain name I am not using which expires in December which we can use and godaddy allows as many websites as I want on my account.
 * Anyone interested? All you would have to do is have logmein and skype on your computer, and install mediawiki remotely, I will do the rest. Adamtheclown 19:10, 23 November 2010 (UTC)

Troubleshooting an 1146 error or a 500 internal server error in Ubuntu
If you're getting an error similar to the following: MySQL returned error "1146: Table '...' doesn't exist (localhost)". Run the update.php file in your mediawiki maintenance directory. php /var/lib/mediawiki/maintenance/update.php

or if you're getting a 500 internal server error, check that all " and ' are closed and you aren't missing any $ before tokens in your LocalSettings.php file.

Need updated instructions on moving a wiki from an old version to new, empty instance
Why? Because I think there are many people like me who want to upgrade an existing, working wiki, to gain benefit of new features, while leaving the existing, working instance undisturbed. I do NOT want to run the upgrade process on an old instance!
 * There are many ways to do this, depending on your needs.--Jasper Deng (talk) 02:47, 14 April 2012 (UTC)

Import the database backup
The Import the database backup doesn't actually explain anything about importing the database from the backup made earlier. Saying "Consult the documentation to find out how it's done." is not helpful. The Possible methods given are just external links, none of which provide the necessary information.

How does one import the database backup, in each of the different methods?

Example:From the command line using mysql
After using mysqldump, eg.

Note: After using using mysqldump, you can't just use mysqlimport. Mysqlimport requires the data to be loaded in some delimited text format, eg. CSV, whereas the output of mysqldump is a sequence of SQL statements.

To import dbdump.txt from the command line do: and afterwards in ../maintenance do:

--Robkam (talk) 23:17, 9 December 2012 (UTC)

Backup
The section Backup, doesn't actually give any details about how to backup. --Robkam (talk) 11:35, 11 December 2012 (UTC)