You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gnosygnu_xowa/home/wiki/Dev/Design/Database.html

403 lines
15 KiB

<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Dev/Design/Database - XOWA</title>
<link rel="shortcut icon" href="https://gnosygnu.github.io/xowa/xowa_logo.png" />
<link rel="stylesheet" href="https://gnosygnu.github.io/xowa/xowa_common.css" type="text/css">
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject skin-vector action-submit vector-animateLayout" spellcheck="false">
<div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<div id="content" class="mw-body">
<h1 id="firstHeading" class="firstHeading"><span>Dev/Design/Database</span></h1>
<div id="bodyContent" class="mw-body-content">
<div id="siteSub">From XOWA: the free, open-source, offline wiki application</div>
<div id="contentSub"></div>
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">
<div id="toc" class="toc">
<div id="toctitle" class="toctitle">
<h2>
Contents
</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1">
<a href="#Overview"><span class="tocnumber">1</span> <span class="toctext">Overview</span></a>
</li>
<li class="toclevel-1 tocsection-2">
<a href="#Details"><span class="tocnumber">2</span> <span class="toctext">Details</span></a>
</li>
<li class="toclevel-1 tocsection-3">
<a href="#Options"><span class="tocnumber">3</span> <span class="toctext">Options</span></a>
</li>
<li class="toclevel-1 tocsection-4">
<a href="#Multi-file_layout"><span class="tocnumber">4</span> <span class="toctext">Multi-file layout</span></a>
</li>
<li class="toclevel-1 tocsection-5">
<a href="#Version_compatibility"><span class="tocnumber">5</span> <span class="toctext">Version compatibility</span></a>
</li>
</ul>
</div>
<h2>
<span class="mw-headline" id="Overview">Overview</span>
</h2>
<p>
As of v2.4.1.1, XOWA has changed the database layout to be more simple and portable. Regular users should not notice any difference. Users who move XOWA wikis between computer systems will notice some benefits.
</p>
<h2>
<span class="mw-headline" id="Details">Details</span>
</h2>
<ul>
<li>
<b>.xowa</b>: XOWA databases now have the extension <code>.xowa</code> instead of <code>.sqlite3</code>.
<ul>
<li>
For example, importing Simple Wikipedia now generates a file called <code>simple.wikipedia.org-text.xowa</code> instead of <code>simple.wikipedia.org.000.sqlite3</code>
</li>
<li>
Note that the underlying file is still a sqlite3 database. The extension has just been renamed from <code>.sqlite3</code> to <code>.xowa</code>.
</li>
<li>
Note that all new wikis uploaded to archive.org will be in .xowa format. The same also goes for new torrents.
</li>
</ul>
</li>
<li>
<b>Backward compatible</b>: XOWA v2.4.1.1 and higher opens both <code>.xowa</code> wikis and <code>.sqlite3</code> wikis. There is no need to upgrade to the new wikis unless you're planning on using some of the features below. However, users are encouraged to generate new wikis with the new format.
</li>
<li>
<b>One file for most wikis</b>: Small wikis will default to one file instead of several.
<ul>
<li>
For example, importing simple.wikipedia.org will generate 1 file called <code>simple.wikipedia.org-text.xowa</code>. In contrast, it used to generate 5 files: <code>simple.wikipedia.org.000.sqlite3</code> up to <code>simple.wikipedia.org.004.sqlite3</code>
</li>
</ul>
</li>
<li>
<b>Multiple 'detachable' files for large wikis</b>: Larger wikis will still generate multiple files. See the Multi-file layout section below for more detail.
</li>
<li>
<b>Databases in same directory</b>: All database files are now under <code>/xowa/wiki/wiki_name</code>. File databases no longer have to go to <code>/xowa/file/wiki_name</code>. The latter was a point of confusion for new users, as well as an inconvenience when trying to move wikis to new machines.
</li>
</ul>
<h2>
<span class="mw-headline" id="Options">Options</span>
</h2>
<p>
General behavior for "single" vs "multiple" file import can be customized at <a href="/wiki/Options/Import" id="xolnki_2" title="Options/Import">Options/Import</a> under Database Layout
</p>
<h2>
<span class="mw-headline" id="Multi-file_layout">Multi-file layout</span>
</h2>
<p>
Large wikis will still generate multiple files. This includes English Wikipedia, German Wikipedia as well as about a dozen others. The primary reasons are as follows:
</p>
<ul>
<li>
<b>FAT32 4 GB limit</b>: FAT32 supports a maximum file size of 4 GB. Although modern operating can support files greater than 4 GB, most flash cards still use a FAT32 file-system. In addition, large files are not supported in other formats (for example, DVDs, archive.org with a 10 GB limit, etc.)
</li>
<li>
<b>Detachable databases</b>: Wikis will still work even if individual databases are deleted or removed. For example, if you don't plan to read the articles in the Wikipedia namespace and want to save 2.6 GB of disk space then you can simply remove the file called "en.wikipedia.org-text-ns.004.xowa".
</li>
</ul>
<p>
Note that detached databases can be reattached simply by moving the file back into its proper location. For example, consider the following:
</p>
<ul>
<li>
<span class='path'>C:\xowa_release\wiki\en.wikipedia.org\en.wikipedia.org-xtn.category.core.xowa</span> is deleted.
<ul>
<li>
Categories will no longer show, but the wiki functions as normal
</li>
</ul>
</li>
<li>
<span class='path'>C:\xowa_release\wiki\en.wikipedia.org\en.wikipedia.org-xtn.category.core.xowa</span> is restored.
<ul>
<li>
Categories will now work again.
</li>
</ul>
</li>
</ul>
<p>
The following table provides more information on what happens when a database is detached:
</p>
<table class='wikitable'>
<tr>
<th>
file-name suffix
</th>
<th>
example
</th>
<th>
effect if removed
</th>
</tr>
<tr>
<td>
core
</td>
<td>
en.wikipedia.org-core.xowa
</td>
<td>
Core file: wiki will not work
</td>
</tr>
<tr>
<td>
text-ns.***-db.***
</td>
<td>
en.wikipedia.org-text-ns.012.xowa
</td>
<td>
Articles in the namespace will not be available. See <a href="http://en.wikipedia.org/wiki/Wikipedia:Namespace" rel="nofollow" class="external free">http://en.wikipedia.org/wiki/Wikipedia:Namespace</a> For example, ns.012 is for "Help:" articles
</td>
</tr>
<tr>
<td>
xtn.category
</td>
<td>
en.wikipedia.org-xtn.category.xowa
</td>
<td>
Categories will not show up at the bottom of the article
</td>
</tr>
<tr>
<td>
xtn.index
</td>
<td>
en.wikipedia.org-xtn.index.xowa
</td>
<td>
"Special:Search" will not work; EX: en.wikipedia.org/wiki/Special:Search/Earth?search=Earth&amp;fulltext=y
</td>
</tr>
<tr>
<td>
wbase
</td>
<td>
www.wikidata.org-wbase.xowa
</td>
<td>
Core file: Wikidata will not work.
</td>
</tr>
<tr>
<td>
file-core
</td>
<td>
en.wikipedia.org-file-core.xowa
</td>
<td>
Wiki will not show images
</td>
</tr>
<tr>
<td>
file-data
</td>
<td>
en.wikipedia.org-file-data.001.xowa
</td>
<td>
Images in that database will not show
</td>
</tr>
</table>
<h2>
<span class="mw-headline" id="Version_compatibility">Version compatibility</span>
</h2>
<p>
The formats for wiks and files are interchangable between old and new formats. A user may keep their existing <b>old</b> file databases and still generate <b>new</b> wikis whenever they want to.
</p>
<p>
For example, consider English Wikipedia. All of the following combinations of <b>old</b> and <b>new</b> should work:
</p>
<table class="wikitable">
<tr>
<th>
wiki type
</th>
<th>
file type
</th>
<th>
wiki path example
</th>
<th>
file path example
</th>
</tr>
<tr>
<td>
old
</td>
<td>
old
</td>
<td>
<span class='path'>C:\xowa_release\wiki\en.wikipedia.org\en.wikipedia.org.000.sqlite3</span>
</td>
<td>
<span class='path'>C:\xowa_release\file\en.wikipedia.org\fsdb.main\fsdb.abc.sqlite3</span>
</td>
</tr>
<tr>
<td>
new
</td>
<td>
old
</td>
<td>
<span class='path'>C:\xowa_release\wiki\en.wikipedia.org\en.wikipedia.org-core.xowa</span>
</td>
<td>
<span class='path'>C:\xowa_release\file\en.wikipedia.org\fsdb.main\fsdb.abc.sqlite3</span>
</td>
</tr>
<tr>
<td>
old
</td>
<td>
new
</td>
<td>
<span class='path'>C:\xowa_release\wiki\en.wikipedia.org\en.wikipedia.org.000.sqlite3</span>
</td>
<td>
<span class='path'>C:\xowa_release\wiki\en.wikipedia.org\en.wikipedia.org-file-core.xowa</span>
</td>
</tr>
<tr>
<td>
new
</td>
<td>
new
</td>
<td>
<span class='path'>C:\xowa_release\wiki\en.wikipedia.org\en.wikipedia.org-core.xowa</span>
</td>
<td>
<span class='path'>C:\xowa_release\wiki\en.wikipedia.org\en.wikipedia.org-file-core.xowa</span>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="mw-head" class="noprint">
<div id="left-navigation">
<div id="p-namespaces" class="vectorTabs">
<h3>Namespaces</h3>
<ul>
<li id="ca-nstab-main" class="selected"><span><a id="ca-nstab-main-href" href="index.html">Page</a></span></li>
</ul>
</div>
</div>
</div>
<div id='mw-panel' class='noprint'>
<div id='p-logo'>
<a style="background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href="http://xowa.org/" title="Visit the main page"></a>
</div>
<div class="portal" id='xowa-portal-home'>
<h3>XOWA</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/index.html" title='Visit the main page'>Main page</a></li>
<li><a href="http://xowa.org/screenshots.html" title='See screenshots of XOWA'>Screenshots</a></li>
<li><a href="https://www.youtube.com/watch?v=q0qbXYXEH6M" title="See a video of XOWA Desktop in action">Video</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/home/wiki/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-started'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/home/wiki/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/home/wiki/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/home/wiki/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/home/wiki/App/Import/Other_wikis.html" title='Learn how to set up other Wikipedias'>Other Wikipedias</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-android'>
<h3>Android</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/Android/Setup.html" title='Setup XOWA on your Android device'>Setup</a></li>
<li><a href="https://www.youtube.com/watch?v=jsMTBxGweUw" title="See a video of XOWA Android in action">Video</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Feedback.html" title='Questions? Comments? Leave feedback for XOWA'>Feedback</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-blog'>
<h3>Blog</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/Blog.html" title='Follow XOWA''s development process'>Current</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-links'>
<h3>Links</h3>
<div class="body">
<ul>
<li><a href="http://dumps.wikimedia.org/backup-index.html" title="Get wiki datababase dumps directly from Wikimedia">Wikimedia dumps</a></li>
<li><a href="https://archive.org/search.php?query=xowa" title="Search archive.org for XOWA files">XOWA @ archive.org</a></li>
<li><a href="http://en.wikipedia.org" title="Visit Wikipedia (and compare to XOWA!)">English Wikipedia</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-donate'>
<h3>Donate</h3>
<div class="body">
<ul>
<li><a href="https://archive.org/donate/index.php" title="Support archive.org!">archive.org</a></li><!-- listed first due to recent fire damages: http://blog.archive.org/2013/11/06/scanning-center-fire-please-help-rebuild/ -->
<li><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title="Support Wikipedia!">Wikipedia</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Donate.html" title="Support XOWA!">XOWA</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>