index.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <link rel="shortcut icon" href="../img/favicon.ico">
  9. <title>Upgrade and migration - Shaarli Documentation</title>
  10. <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
  11. <link rel="stylesheet" href="../css/theme.css" type="text/css" />
  12. <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
  13. <link rel="stylesheet" href="../css/highlight.css">
  14. <link href="../github-markdown.css" rel="stylesheet">
  15. <script>
  16. // Current page data
  17. var mkdocs_page_name = "Upgrade and migration";
  18. var mkdocs_page_input_path = "Upgrade-and-migration.md";
  19. var mkdocs_page_url = "/Upgrade-and-migration/";
  20. </script>
  21. <script src="../js/jquery-2.1.1.min.js"></script>
  22. <script src="../js/modernizr-2.8.3.min.js"></script>
  23. <script type="text/javascript" src="../js/highlight.pack.js"></script>
  24. </head>
  25. <body class="wy-body-for-nav" role="document">
  26. <div class="wy-grid-for-nav">
  27. <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
  28. <div class="wy-side-nav-search">
  29. <a href=".." class="icon icon-home"> Shaarli Documentation</a>
  30. <div role="search">
  31. <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
  32. <input type="text" name="q" placeholder="Search docs" />
  33. </form>
  34. </div>
  35. </div>
  36. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  37. <ul class="current">
  38. <li class="toctree-l1">
  39. <a class="" href="..">Home</a>
  40. </li>
  41. <li class="toctree-l1">
  42. <span class="caption-text">Setup</span>
  43. <ul class="subnav">
  44. <li class="">
  45. <a class="" href="../Download-and-Installation/">Download and Installation</a>
  46. </li>
  47. <li class=" current">
  48. <a class="current" href="./">Upgrade and migration</a>
  49. <ul class="subnav">
  50. <li class="toctree-l3"><a href="#preparation">Preparation</a></li>
  51. <ul>
  52. <li><a class="toctree-l4" href="#note-your-current-version">Note your current version</a></li>
  53. <li><a class="toctree-l4" href="#backup-your-data">Backup your data</a></li>
  54. <li><a class="toctree-l4" href="#migrating-data-from-a-previous-installation">Migrating data from a previous installation</a></li>
  55. </ul>
  56. <li class="toctree-l3"><a href="#recommended-upgrading-from-release-archives">Recommended : Upgrading from release archives</a></li>
  57. <li class="toctree-l3"><a href="#upgrading-with-git">Upgrading with Git</a></li>
  58. <ul>
  59. <li><a class="toctree-l4" href="#updating-a-community-shaarli">Updating a community Shaarli</a></li>
  60. <li><a class="toctree-l4" href="#migrating-and-upgrading-from-sebsauvages-repository">Migrating and upgrading from Sebsauvage's repository</a></li>
  61. </ul>
  62. <li class="toctree-l3"><a href="#troubleshooting">Troubleshooting</a></li>
  63. <ul>
  64. <li><a class="toctree-l4" href="#you-must-specify-an-integer-as-a-key">You must specify an integer as a key</a></li>
  65. </ul>
  66. </ul>
  67. </li>
  68. <li class="">
  69. <a class="" href="../Server-requirements/">Server requirements</a>
  70. </li>
  71. <li class="">
  72. <a class="" href="../Server-configuration/">Server configuration</a>
  73. </li>
  74. <li class="">
  75. <a class="" href="../Server-security/">Server security</a>
  76. </li>
  77. <li class="">
  78. <a class="" href="../Shaarli-configuration/">Shaarli configuration</a>
  79. </li>
  80. <li class="">
  81. <a class="" href="../Plugins/">Plugins</a>
  82. </li>
  83. </ul>
  84. </li>
  85. <li class="toctree-l1">
  86. <span class="caption-text">Docker</span>
  87. <ul class="subnav">
  88. <li class="">
  89. <a class="" href="../docker/docker-101/">Docker 101</a>
  90. </li>
  91. <li class="">
  92. <a class="" href="../docker/shaarli-images/">Shaarli images</a>
  93. </li>
  94. <li class="">
  95. <a class="" href="../docker/reverse-proxy-configuration/">Reverse proxy configuration</a>
  96. </li>
  97. <li class="">
  98. <a class="" href="../docker/resources/">Docker resources</a>
  99. </li>
  100. </ul>
  101. </li>
  102. <li class="toctree-l1">
  103. <span class="caption-text">Usage</span>
  104. <ul class="subnav">
  105. <li class="">
  106. <a class="" href="../Features/">Features</a>
  107. </li>
  108. <li class="">
  109. <a class="" href="../Bookmarklet/">Bookmarklet</a>
  110. </li>
  111. <li class="">
  112. <a class="" href="../Browsing-and-searching/">Browsing and searching</a>
  113. </li>
  114. <li class="">
  115. <a class="" href="../Firefox-share/">Firefox share</a>
  116. </li>
  117. <li class="">
  118. <a class="" href="../RSS-feeds/">RSS feeds</a>
  119. </li>
  120. <li class="">
  121. <a class="" href="../REST-API/">REST API</a>
  122. </li>
  123. </ul>
  124. </li>
  125. <li class="toctree-l1">
  126. <span class="caption-text">How To</span>
  127. <ul class="subnav">
  128. <li class="">
  129. <a class="" href="../Backup,-restore,-import-and-export/">Backup, restore, import and export</a>
  130. </li>
  131. <li class="">
  132. <a class="" href="../Various-hacks/">Various hacks</a>
  133. </li>
  134. </ul>
  135. </li>
  136. <li class="toctree-l1">
  137. <a class="" href="../Troubleshooting/">Troubleshooting</a>
  138. </li>
  139. <li class="toctree-l1">
  140. <span class="caption-text">Development</span>
  141. <ul class="subnav">
  142. <li class="">
  143. <a class="" href="../Development-guidelines/">Development guidelines</a>
  144. </li>
  145. <li class="">
  146. <a class="" href="../Continuous-integration-tools/">Continuous integration tools</a>
  147. </li>
  148. <li class="">
  149. <a class="" href="../GnuPG-signature/">GnuPG signature</a>
  150. </li>
  151. <li class="">
  152. <a class="" href="../Coding-guidelines/">Coding guidelines</a>
  153. </li>
  154. <li class="">
  155. <a class="" href="../Directory-structure/">Directory structure</a>
  156. </li>
  157. <li class="">
  158. <a class="" href="../3rd-party-libraries/">3rd party libraries</a>
  159. </li>
  160. <li class="">
  161. <a class="" href="../Plugin-System/">Plugin System</a>
  162. </li>
  163. <li class="">
  164. <a class="" href="../Release-Shaarli/">Release Shaarli</a>
  165. </li>
  166. <li class="">
  167. <a class="" href="../Versioning-and-Branches/">Versioning and Branches</a>
  168. </li>
  169. <li class="">
  170. <a class="" href="../Security/">Security</a>
  171. </li>
  172. <li class="">
  173. <a class="" href="../Static-analysis/">Static analysis</a>
  174. </li>
  175. <li class="">
  176. <a class="" href="../Theming/">Theming</a>
  177. </li>
  178. <li class="">
  179. <a class="" href="../Unit-tests/">Unit tests</a>
  180. </li>
  181. </ul>
  182. </li>
  183. <li class="toctree-l1">
  184. <span class="caption-text">About</span>
  185. <ul class="subnav">
  186. <li class="">
  187. <a class="" href="../FAQ/">FAQ</a>
  188. </li>
  189. <li class="">
  190. <a class="" href="../Community-&-Related-software/">Community & Related software</a>
  191. </li>
  192. </ul>
  193. </li>
  194. </ul>
  195. </div>
  196. &nbsp;
  197. </nav>
  198. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  199. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  200. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  201. <a href="..">Shaarli Documentation</a>
  202. </nav>
  203. <div class="wy-nav-content">
  204. <div class="rst-content">
  205. <div role="navigation" aria-label="breadcrumbs navigation">
  206. <ul class="wy-breadcrumbs">
  207. <li><a href="..">Docs</a> &raquo;</li>
  208. <li>Setup &raquo;</li>
  209. <li>Upgrade and migration</li>
  210. <li class="wy-breadcrumbs-aside">
  211. <a href="https://github.com/shaarli/Shaarli/edit/master/docs/Upgrade-and-migration.md"
  212. class="icon icon-github"> Edit on GitHub</a>
  213. </li>
  214. </ul>
  215. <hr/>
  216. </div>
  217. <div role="main">
  218. <div class="section">
  219. <h2 id="preparation">Preparation</h2>
  220. <h3 id="note-your-current-version">Note your current version</h3>
  221. <p>If anything goes wrong, it's important for us to know which version you're upgrading from.<br />
  222. The current version is present in the <code>version.php</code> file.</p>
  223. <h3 id="backup-your-data">Backup your data</h3>
  224. <p>Shaarli stores all user data under the <code>data</code> directory:
  225. - <code>data/config.php</code> - main configuration file
  226. - <code>data/datastore.php</code> - bookmarked links
  227. - <code>data/ipbans.php</code> - banned IP addresses
  228. - <code>data/updates.txt</code> - contains all automatic update to the configuration and datastore files already run</p>
  229. <p>See <a href="../Shaarli configuration">Shaarli configuration</a> for more information about Shaarli resources.</p>
  230. <p>It is recommended to backup this repository <em>before</em> starting updating/upgrading Shaarli:
  231. - users with SSH access: copy or archive the directory to a temporary location
  232. - users with FTP access: download a local copy of your Shaarli installation using your favourite client</p>
  233. <h3 id="migrating-data-from-a-previous-installation">Migrating data from a previous installation</h3>
  234. <p>As all user data is kept under <code>data</code>, this is the only directory you need to worry about when migrating to a new installation, which corresponds to the following steps:</p>
  235. <ul>
  236. <li>backup the <code>data</code> directory</li>
  237. <li>install or update Shaarli:<ul>
  238. <li>fresh installation - see <a href="../Download and installation">Download and installation</a></li>
  239. <li>update - see the following sections</li>
  240. </ul>
  241. </li>
  242. <li>check or restore the <code>data</code> directory</li>
  243. </ul>
  244. <h2 id="recommended-upgrading-from-release-archives">Recommended : Upgrading from release archives</h2>
  245. <p>All tagged revisions can be downloaded as tarballs or ZIP archives from the <a href="https://github.com/shaarli/Shaarli/releases">releases</a> page.</p>
  246. <p>We recommend that you use the latest release tarball with the <code>-full</code> suffix. It contains the dependencies, please read <a href="../Download and installation">Download and installation</a> for <code>git</code> complete instructions.</p>
  247. <p>Once downloaded, extract the archive locally and update your remote installation (e.g. via FTP) -be sure you keep the content of the <code>data</code> directory!</p>
  248. <p>After upgrading, access your fresh Shaarli installation from a web browser; the configuration and data store will then be automatically updated, and new settings added to <code>data/config.json.php</code> (see <a href="../Shaarli configuration">Shaarli configuration</a> for more details).</p>
  249. <h2 id="upgrading-with-git">Upgrading with Git</h2>
  250. <h3 id="updating-a-community-shaarli">Updating a community Shaarli</h3>
  251. <p>If you have installed Shaarli from the <a href="../Download#clone-with-git-recommended">community Git repository</a>, simply <a href="https://www.git-scm.com/docs/git-pull">pull new changes</a> from your local clone:</p>
  252. <pre><code class="bash">$ cd /path/to/shaarli
  253. $ git pull
  254. From github.com:shaarli/Shaarli
  255. * branch master -&gt; FETCH_HEAD
  256. Updating ebd67c6..521f0e6
  257. Fast-forward
  258. application/Url.php | 1 +
  259. shaarli_version.php | 2 +-
  260. tests/Url/UrlTest.php | 1 +
  261. 3 files changed, 3 insertions(+), 1 deletion(-)
  262. </code></pre>
  263. <p>Shaarli &gt;= <code>v0.8.x</code>: install/update third-party PHP dependencies using <a href="https://getcomposer.org/">Composer</a>:</p>
  264. <pre><code class="bash">$ composer install --no-dev
  265. Loading composer repositories with package information
  266. Updating dependencies
  267. - Installing shaarli/netscape-bookmark-parser (v1.0.1)
  268. Downloading: 100%
  269. </code></pre>
  270. <h3 id="migrating-and-upgrading-from-sebsauvages-repository">Migrating and upgrading from Sebsauvage's repository</h3>
  271. <p>If you have installed Shaarli from <a href="https://github.com/sebsauvage/Shaarli">Sebsauvage's original Git repository</a>, you can use <a href="https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes">Git remotes</a> to update your working copy.</p>
  272. <p>The following guide assumes that:
  273. - you have a basic knowledge of Git <a href="https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell">branching</a> and <a href="https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes">remote repositories</a>
  274. - the default remote is named <code>origin</code> and points to Sebsauvage's repository
  275. - the current branch is <code>master</code>
  276. - if you have personal branches containing customizations, you will need to <a href="https://git-scm.com/book/en/v2/Git-Branching-Rebasing">rebase them</a> after the upgrade; beware though, a lot of changes have been made since the community fork has been created, so things are very likely to break!
  277. - the working copy is clean:
  278. - no versioned file has been locally modified
  279. - no untracked files are present</p>
  280. <h4 id="step-0-show-repository-information">Step 0: show repository information</h4>
  281. <pre><code class="bash">$ cd /path/to/shaarli
  282. $ git remote -v
  283. origin https://github.com/sebsauvage/Shaarli (fetch)
  284. origin https://github.com/sebsauvage/Shaarli (push)
  285. $ git branch -vv
  286. * master 029f75f [origin/master] Update README.md
  287. $ git status
  288. On branch master
  289. Your branch is up-to-date with 'origin/master'.
  290. nothing to commit, working directory clean
  291. </code></pre>
  292. <h4 id="step-1-update-git-remotes">Step 1: update Git remotes</h4>
  293. <pre><code>$ git remote rename origin sebsauvage
  294. $ git remote -v
  295. sebsauvage https://github.com/sebsauvage/Shaarli (fetch)
  296. sebsauvage https://github.com/sebsauvage/Shaarli (push)
  297. $ git remote add origin https://github.com/shaarli/Shaarli
  298. $ git fetch origin
  299. remote: Counting objects: 3015, done.
  300. remote: Compressing objects: 100% (19/19), done.
  301. remote: Total 3015 (delta 446), reused 457 (delta 446), pack-reused 2550
  302. Receiving objects: 100% (3015/3015), 2.59 MiB | 918.00 KiB/s, done.
  303. Resolving deltas: 100% (1899/1899), completed with 48 local objects.
  304. From https://github.com/shaarli/Shaarli
  305. * [new branch] master -&gt; origin/master
  306. * [new branch] stable -&gt; origin/stable
  307. [...]
  308. * [new tag] v0.6.4 -&gt; v0.6.4
  309. * [new tag] v0.7.0 -&gt; v0.7.0
  310. </code></pre>
  311. <h4 id="step-2-use-the-stable-community-branch">Step 2: use the stable community branch</h4>
  312. <pre><code class="bash">$ git checkout origin/stable -b stable
  313. Branch stable set up to track remote branch stable from origin.
  314. Switched to a new branch 'stable'
  315. $ git branch -vv
  316. master 029f75f [sebsauvage/master] Update README.md
  317. * stable 890afc3 [origin/stable] Merge pull request #509 from ArthurHoaro/v0.6.5
  318. </code></pre>
  319. <p>Shaarli &gt;= <code>v0.8.x</code>: install/update third-party PHP dependencies using <a href="https://getcomposer.org/">Composer</a>:</p>
  320. <pre><code class="bash">$ composer install --no-dev
  321. Loading composer repositories with package information
  322. Updating dependencies
  323. - Installing shaarli/netscape-bookmark-parser (v1.0.1)
  324. Downloading: 100%
  325. </code></pre>
  326. <p>Optionally, you can delete information related to the legacy version:</p>
  327. <pre><code class="bash">$ git branch -D master
  328. Deleted branch master (was 029f75f).
  329. $ git remote remove sebsauvage
  330. $ git remote -v
  331. origin https://github.com/shaarli/Shaarli (fetch)
  332. origin https://github.com/shaarli/Shaarli (push)
  333. $ git gc
  334. Counting objects: 3317, done.
  335. Delta compression using up to 8 threads.
  336. Compressing objects: 100% (1237/1237), done.
  337. Writing objects: 100% (3317/3317), done.
  338. Total 3317 (delta 2050), reused 3301 (delta 2034)to
  339. </code></pre>
  340. <h4 id="step-3-configuration">Step 3: configuration</h4>
  341. <p>After migrating, access your fresh Shaarli installation from a web browser; the configuration will then be automatically updated, and new settings added to <code>data/config.php</code> (see <a href="../Shaarli configuration">Shaarli configuration</a> for more details).</p>
  342. <h2 id="troubleshooting">Troubleshooting</h2>
  343. <p>If the solutions provided here doesn't work, please open an issue specifying which version you're upgrading from and to.</p>
  344. <h3 id="you-must-specify-an-integer-as-a-key">You must specify an integer as a key</h3>
  345. <p>In <code>v0.8.1</code> we changed how link keys are handled (from timestamps to incremental integers).
  346. Take a look at <code>data/updates.txt</code> content.</p>
  347. <h4 id="updatestxt-contains-updatemethoddatastoreids"><code>updates.txt</code> contains <code>updateMethodDatastoreIds</code></h4>
  348. <p>Try to delete it and refresh your page while being logged in.</p>
  349. <h4 id="updatestxt-doesnt-exists-or-doesnt-contain-updatemethoddatastoreids"><code>updates.txt</code> doesn't exists or doesn't contain <code>updateMethodDatastoreIds</code></h4>
  350. <ol>
  351. <li>Create <code>data/updates.txt</code> if it doesn't exist.</li>
  352. <li>Paste this string in the update file <code>;updateMethodRenameDashTags;</code></li>
  353. <li>Login to Shaarli.</li>
  354. <li>Delete the update file.</li>
  355. <li>Refresh.</li>
  356. </ol>
  357. </div>
  358. </div>
  359. <footer>
  360. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  361. <a href="../Server-requirements/" class="btn btn-neutral float-right" title="Server requirements">Next <span class="icon icon-circle-arrow-right"></span></a>
  362. <a href="../Download-and-Installation/" class="btn btn-neutral" title="Download and Installation"><span class="icon icon-circle-arrow-left"></span> Previous</a>
  363. </div>
  364. <hr/>
  365. <div role="contentinfo">
  366. <!-- Copyright etc -->
  367. </div>
  368. Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
  369. </footer>
  370. </div>
  371. </div>
  372. </section>
  373. </div>
  374. <div class="rst-versions" role="note" style="cursor: pointer">
  375. <span class="rst-current-version" data-toggle="rst-current-version">
  376. <a href="https://github.com/shaarli/Shaarli" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
  377. <span><a href="../Download-and-Installation/" style="color: #fcfcfc;">&laquo; Previous</a></span>
  378. <span style="margin-left: 15px"><a href="../Server-requirements/" style="color: #fcfcfc">Next &raquo;</a></span>
  379. </span>
  380. </div>
  381. <script src="../js/theme.js"></script>
  382. </body>
  383. </html>