Hey everybody, I was wondering whether I can have two discrete wikis (semantic wikis to be more accurate) sharing the same database on the same server. My intention is to launch a simpler copy of the existing wiki (so they are going to have the same database scheme). I want both of them to be up-to-date, namely, if someone edit the one, the changes should appear on the other as well. Is this possible? Thank you, Nata
On 11/11/2010 11:18, Anastasia Dimou wrote:
Hey everybody, I was wondering whether I can have two discrete wikis (semantic wikis to be more accurate) sharing the same database on the same server. My intention is to launch a simpler copy of the existing wiki (so they are going to have the same database scheme). I want both of them to be up-to-date, namely, if someone edit the one, the changes should appear on the other as well. Is this possible?
Hi Nata,
when installing MediaWiki with the MySQL backend, you are asked to provide a prefix for DB tables. This can be left empty, but it can also be some short string such as "mywiki" (or whatever). Wikis will put this text in front of all database table names, thus allowing multiple sets of MediaWiki tables to co-exist in the same database. This setting is also honoured by SMW.
Changing this setting in an existing wiki will not automatically move the data to new tables, though. This task would fall under the topic of migrating wikis between/within databases for which you should find many resources in the MediaWiki documentation. For SMW, it suffices to re-initialise the database, and to rebuild the database content once the MediaWiki pages were moved (this can usually be done via a web interface, see the SMW documentation on "Repairing SMW" for details).
-- Markus
On Thu, 2010-11-11 at 12:07 +0000, Markus Krötzsch wrote:
On 11/11/2010 11:18, Anastasia Dimou wrote:
Hey everybody, I was wondering whether I can have two discrete wikis (semantic wikis to be more accurate) sharing the same database on the same server. My intention is to launch a simpler copy of the existing wiki (so they are going to have the same database scheme). I want both of them to be up-to-date, namely, if someone edit the one, the changes should appear on the other as well. Is this possible?
Hi Nata,
when installing MediaWiki with the MySQL backend, you are asked to provide a prefix for DB tables. This can be left empty, but it can also be some short string such as "mywiki" (or whatever). Wikis will put this text in front of all database table names, thus allowing multiple sets of MediaWiki tables to co-exist in the same database. This setting is also honoured by SMW.
Changing this setting in an existing wiki will not automatically move the data to new tables, though. This task would fall under the topic of migrating wikis between/within databases for which you should find many resources in the MediaWiki documentation. For SMW, it suffices to re-initialise the database, and to rebuild the database content once the MediaWiki pages were moved (this can usually be done via a web interface, see the SMW documentation on "Repairing SMW" for details).
-- Markus
Thank you Markus for your reply and the information you provided for the wiki migration. But still it is not totally clear to me. Even if I use the database prefix, for example wiki1 for the one wiki and wiki2 for the second one, any change affecting the tables with wiki1 prefix, will affect the tables currying wiki2 prefix?If I create a page using the first wiki whose table has the prefix wiki1, will it appear on the second wiki (the one whose tables has wiki2 as prefix)?
On 11/11/2010 12:25, Anastasia Dimou wrote:
On Thu, 2010-11-11 at 12:07 +0000, Markus Krötzsch wrote:
On 11/11/2010 11:18, Anastasia Dimou wrote:
Hey everybody, I was wondering whether I can have two discrete wikis (semantic wikis to be more accurate) sharing the same database on the same server. My intention is to launch a simpler copy of the existing wiki (so they are going to have the same database scheme). I want both of them to be up-to-date, namely, if someone edit the one, the changes should appear on the other as well. Is this possible?
Hi Nata,
when installing MediaWiki with the MySQL backend, you are asked to provide a prefix for DB tables. This can be left empty, but it can also be some short string such as "mywiki" (or whatever). Wikis will put this text in front of all database table names, thus allowing multiple sets of MediaWiki tables to co-exist in the same database. This setting is also honoured by SMW.
Changing this setting in an existing wiki will not automatically move the data to new tables, though. This task would fall under the topic of migrating wikis between/within databases for which you should find many resources in the MediaWiki documentation. For SMW, it suffices to re-initialise the database, and to rebuild the database content once the MediaWiki pages were moved (this can usually be done via a web interface, see the SMW documentation on "Repairing SMW" for details).
-- Markus
Thank you Markus for your reply and the information you provided for the wiki migration. But still it is not totally clear to me. Even if I use the database prefix, for example wiki1 for the one wiki and wiki2 for the second one, any change affecting the tables with wiki1 prefix, will affect the tables currying wiki2 prefix?If I create a page using the first wiki whose table has the prefix wiki1, will it appear on the second wiki (the one whose tables has wiki2 as prefix)?
Superficial me -- I misinterpreted your notion of "discrete" and skipped the crucial last sentence in your question. I think you are rather looking for the opposite of what I suggested: two distinct code bases (installation directories, possibly with code sharing) with the same database tables.
I don't think that there should be big issues having two MediaWiki installations of the same version using (exactly) the same database connection settings, i.e. acting on the same tables. I cannot currently imagine any problems with this at all, but maybe some people on this list have some more fantasy than I. Difficulties could occur if additional infrastructure is used around MediaWiki, in particular caching services. In this case, changes on one site must also make sure to invalidate external caches on the other. Otherwise some people might see older copies of pages etc. on one of the sites in some situations. Extensions that have their own database table for storing some additional page-related data (like SMW) are very similar to caches in this context, and they would not work reliably if used only on one of the sites.
Besides this, the main constraint for the setup thus seems to be that you must really have the same version and settings for both MediaWikis, and that you have to be careful with extensions that introduce new features (like ParserFunctions) that people can use in wiki text. Such features would only be interpreted properly on the site that has the extension installed. The setup might also be unsuitable for extensions that modify MediaWiki code (like the Halo extension does).
So AFAIR the basic setup with same DB settings for two sites should be possible, and that it is mainly a question of which extensions you want to use. As usual, if you do experiments on a production system, then you should of course be sure to have backups of your data.
-- Markus
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
How about using only 1 wiki, but giving it two different looks (GUI's)?
1. Create two different hostnames, wiki.example.com and simplewiki.example.com, pointing to the same server in DNS.
2. Add logic to your site that changes the GUI (or skin) depending on the hostname. This could go in LocalSettings.php, an extension, or even the wiki's Mediawiki:Common.js page.
Now you have the appearance of two different wikis with the same articles, but really there is only one wiki. This is MUCH simpler than what you're proposing.
DanB
Hello,
I run three mediawiki installs all using one and the same databases, so it will not be a problem if you have two wiki's working out of one database.
Best,
Huib
2010/11/11 Daniel Barrett danb@vistaprint.com
How about using only 1 wiki, but giving it two different looks (GUI's)?
- Create two different hostnames, wiki.example.com and
simplewiki.example.com, pointing to the same server in DNS.
- Add logic to your site that changes the GUI (or skin) depending on the
hostname. This could go in LocalSettings.php, an extension, or even the wiki's Mediawiki:Common.js page.
Now you have the appearance of two different wikis with the same articles, but really there is only one wiki. This is MUCH simpler than what you're proposing.
DanB
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Huib Laurens writes:
I run three mediawiki installs all using one and the same databases, so it will not be a problem if you have two wiki's working out of one database.
There are three possibilities when you talk about multiple wikis in one database:
1. One database, multiple database prefixes, one code tree 2. One database, multiple database prefixes, multiple code trees 3. One database, one database prefix (all wikis literally share the same tables), any number of code trees (one or multiple)
The poster is asking about case #3. Doing this with one code tree plus "GUI changes per hostname" is easy. If you have 3 code trees, when you upgrade MediaWiki, do you do three upgrades or one? When you run maintenance/update.php, which wiki do you run it from? You avoid these issues with one code tree and changing the skin by hostname.
DanB
I am not sure if GUI changes are sufficient in my occasion, but I do understand that it is the optimal solution. Thank you all for your answers, I'll let the list informed about the results of my effort!
On 11/11/2010 7:15 μμ, Daniel Barrett wrote:
Huib Laurens writes:
I run three mediawiki installs all using one and the same databases, so it will not be a problem if you have two wiki's working out of one database.
There are three possibilities when you talk about multiple wikis in one database:
- One database, multiple database prefixes, one code tree
- One database, multiple database prefixes, multiple code trees
- One database, one database prefix (all wikis literally share the same tables), any number of code trees (one or multiple)
The poster is asking about case #3. Doing this with one code tree plus "GUI changes per hostname" is easy. If you have 3 code trees, when you upgrade MediaWiki, do you do three upgrades or one? When you run maintenance/update.php, which wiki do you run it from? You avoid these issues with one code tree and changing the skin by hostname.
DanB
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Anastasia Dimou wrote:
I am not sure if GUI changes are sufficient in my occasion, but I do understand that it is the optimal solution.
That will depend on what you mean with "a simpler copy of the existing wiki" (see your original post).
If it means certain areas of the wiki then you could use name spaces to mark some areas as off-limit.
If you want to hide certain part on each page that would be more difficult, but with SMW you should be able to achieve this (perhaps in combination with some CSS on skin level).
hth Frank
mediawiki-l@lists.wikimedia.org