Sqlite.html 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <!DOCTYPE html>
  2. <html dir="ltr">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  5. <title>Archive/Import/Sqlite - XOWA</title>
  6. <link rel="shortcut icon" href="https://gnosygnu.github.io/xowa/xowa_logo.png" />
  7. <link rel="stylesheet" href="https://gnosygnu.github.io/xowa/xowa_common.css" type="text/css">
  8. </head>
  9. <body class="mediawiki ltr sitedir-ltr ns-0 ns-subject skin-vector action-submit vector-animateLayout" spellcheck="false">
  10. <div id="mw-page-base" class="noprint"></div>
  11. <div id="mw-head-base" class="noprint"></div>
  12. <div id="content" class="mw-body">
  13. <h1 id="firstHeading" class="firstHeading"><span>Archive/Import/Sqlite</span></h1>
  14. <div id="bodyContent" class="mw-body-content">
  15. <div id="siteSub">From XOWA: the free, open-source, offline wiki application</div>
  16. <div id="contentSub"></div>
  17. <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">
  18. <table class="metadata plainlinks ambox ambox-delete" style="">
  19. <tr>
  20. <td class="mbox-empty-cell">
  21. </td>
  22. <td class="mbox-text" style="">
  23. <p>
  24. <span class="mbox-text-span">The v0.7.0 sqlite database format is now finalized. If you've imported your wiki to sqlite in v0.6.2 or v0.6.3 you should import it again in v0.7.0.</span>
  25. </p>
  26. </td>
  27. </tr>
  28. </table>
  29. <p>
  30. As of v0.6.2, XOWA offers the ability to save a wiki in one sqlite database (as opposed to many text files). For more details about sqlite vs text files see <a href="http://xowa.org/home/wiki/Archive/Import/Overview.html" id="xolnki_2" title="Archive/Import/Overview">Archive/Import/Overview</a>.
  31. </p>
  32. <h2>
  33. <span class="mw-headline" id="Sqlite_model_database">Sqlite model database</span>
  34. </h2>
  35. <p>
  36. Every .sqlite3 database is copied from one central source: /xowa/bin/any/sql/xowa/xowa.sqlite3. The SQL used to generate the database can be found at xowa.sql file in the same directory.
  37. </p>
  38. <h2>
  39. <span class="mw-headline" id="UI_usage">UI usage</span>
  40. </h2>
  41. <ul>
  42. <li>
  43. Go to <a href="http://xowa.org/home/wiki/Options/Import.html" id="xolnki_3" title="Options/Import" class="xowa-visited">Options/Import</a>
  44. </li>
  45. <li>
  46. Choose <b>sqlite</b> as the <b>Wiki storage type</b>
  47. </li>
  48. </ul>
  49. <h2>
  50. <span class="mw-headline" id="Command-line_usage">Command-line usage</span>
  51. </h2>
  52. <p>
  53. The steps below assume simple.wikipedia.org.
  54. </p>
  55. <ul>
  56. <li>
  57. Replace the contents of xowa_build.gfs with the following:
  58. </li>
  59. </ul>
  60. <pre style='overflow:scroll'>
  61. app.bldr.pause_at_end_('n');
  62. app.scripts.run_file_by_type('user_system_cfg');
  63. app.setup.dumps {
  64. db_text_max = 3000;
  65. db_categorylinks_max = 3600;
  66. db_wikidata_max = 3600;
  67. db_ns_map =
  68. "
  69. Template~Module
  70. ";
  71. }
  72. app.bldr.cmds {
  73. add_many ('simple.wikipedia.org', 'import.sql.init').src_xml_fil = '/home/simplewiki-latest-pages-articles.xml';
  74. add_many ('simple.wikipedia.org', 'import.sql.init', 'import.sql.page', 'import.sql.category_v1', 'import.sql.category_registry', 'import.sql.categorylinks', 'import.sql.term');
  75. }
  76. app.bldr.run;
  77. </pre>
  78. <p>
  79. Note the following:
  80. </p>
  81. <ul>
  82. <li>
  83. For any other wiki, replace 'simple.wikipedia.org' with the wiki domain name.
  84. </li>
  85. <li>
  86. To use the category v2 system:
  87. <ul>
  88. <li>
  89. Remove the 'import.sql.category_v1' command. The category_v1 command generates a temporary categorylinks.sql file from the database dump
  90. </li>
  91. <li>
  92. Download the atual categorylinks.sql file from the dump server. See <a href="http://xowa.org/home/wiki/Help:Core/Category.html" id="xolnki_4" title="Help:Core/Category">Help:Core/Category</a>
  93. </li>
  94. </ul>
  95. </li>
  96. <li>
  97. The above will create a minimum of 4 sqlite files. If you want only 1 sqlite file, use the following for app.setup.dumps:
  98. </li>
  99. </ul>
  100. <pre>
  101. app.setup.dumps {
  102. db_text_max = 0
  103. db_categorylinks_max = 0;
  104. db_wikidata_max = 0;
  105. db_ns_map = "";
  106. }
  107. </pre>
  108. <p>
  109. For more info on these configuration settings, see <a href="http://xowa.org/home/wiki/Archive/Import/Sqlite/Config.html" id="xolnki_5" title="Archive/Import/Sqlite/Config">Archive/Import/Sqlite/Config</a>
  110. </p>
  111. </div>
  112. </div>
  113. </div>
  114. <div id="mw-head" class="noprint">
  115. <div id="left-navigation">
  116. <div id="p-namespaces" class="vectorTabs">
  117. <h3>Namespaces</h3>
  118. <ul>
  119. <li id="ca-nstab-main" class="selected"><span><a id="ca-nstab-main-href" href="index.html">Page</a></span></li>
  120. </ul>
  121. </div>
  122. </div>
  123. </div>
  124. <div id='mw-panel' class='noprint'>
  125. <div id='p-logo'>
  126. <a style="background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href="http://xowa.org/" title="Visit the main page"></a>
  127. </div>
  128. <div class="portal" id='xowa-portal-home'>
  129. <h3>XOWA</h3>
  130. <div class="body">
  131. <ul>
  132. <li><a href="http://xowa.org/index.html" title='Visit the main page'>Main page</a></li>
  133. <li><a href="http://xowa.org/screenshots.html" title='See screenshots of XOWA'>Screenshots</a></li>
  134. <li><a href="http://xowa.org/home/wiki/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
  135. <li><a href="http://xowa.org/home/wiki/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
  136. </ul>
  137. </div>
  138. </div>
  139. <div class="portal" id='xowa-portal-started'>
  140. <h3>Getting started</h3>
  141. <div class="body">
  142. <ul>
  143. <li><a href="http://xowa.org/home/wiki/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
  144. <li><a href="http://xowa.org/home/wiki/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
  145. <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>
  146. <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>
  147. <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>
  148. </ul>
  149. </div>
  150. </div>
  151. <div class="portal" id='xowa-portal-android'>
  152. <h3>Android</h3>
  153. <div class="body">
  154. <ul>
  155. <li><a href="http://xowa.org/home/wiki/Android/Setup.html" title='Setup XOWA on your Android device'>Setup</a></li>
  156. </ul>
  157. </div>
  158. </div>
  159. <div class="portal" id='xowa-portal-help'>
  160. <h3>Help</h3>
  161. <div class="body">
  162. <ul>
  163. <li><a href="http://xowa.org/home/wiki/Help/About.html" title='Get more information about XOWA'>About</a></li>
  164. <li><a href="http://xowa.org/home/wiki/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
  165. <li><a href="http://xowa.org/home/wiki/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
  166. <li><a href="http://xowa.org/home/wiki/Help/Feedback.html" title='Questions? Comments? Leave feedback for XOWA'>Feedback</a></li>
  167. </ul>
  168. </div>
  169. </div>
  170. <div class="portal" id='xowa-portal-blog'>
  171. <h3>Blog</h3>
  172. <div class="body">
  173. <ul>
  174. <li><a href="http://xowa.org/home/wiki/Blog.html" title='Follow XOWA''s development process'>Current</a></li>
  175. </ul>
  176. </div>
  177. </div>
  178. <div class="portal" id='xowa-portal-links'>
  179. <h3>Links</h3>
  180. <div class="body">
  181. <ul>
  182. <li><a href="http://dumps.wikimedia.org/backup-index.html" title="Get wiki datababase dumps directly from Wikimedia">Wikimedia dumps</a></li>
  183. <li><a href="https://archive.org/search.php?query=xowa" title="Search archive.org for XOWA files">XOWA @ archive.org</a></li>
  184. <li><a href="http://en.wikipedia.org" title="Visit Wikipedia (and compare to XOWA!)">English Wikipedia</a></li>
  185. </ul>
  186. </div>
  187. </div>
  188. <div class="portal" id='xowa-portal-donate'>
  189. <h3>Donate</h3>
  190. <div class="body">
  191. <ul>
  192. <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/ -->
  193. <li><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title="Support Wikipedia!">Wikipedia</a></li>
  194. <!-- <li><a href="" title="Support XOWA! (but only after you've supported archive.org and Wikipedia)">XOWA</a></li> -->
  195. </ul>
  196. </div>
  197. </div>
  198. <div class="portal" id='xowa-portal-image'>
  199. <br/>
  200. <a href="https://play.google.com/store/apps/details?id=org.xowa" class="image">
  201. <img width='140px' src="https://gnosygnu.github.io/xowa/en-play-badge.png" />
  202. </a>
  203. </div>
  204. </div>
  205. </body>
  206. </html>