aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/md/Upgrade-and-migration.md
diff options
context:
space:
mode:
authornodiscc <nodiscc@gmail.com>2017-01-26 18:52:54 +0100
committernodiscc <nodiscc@gmail.com>2017-06-18 00:19:49 +0200
commit53ed6d7d1e678d7486337ce67a2f17b30bac21ac (patch)
treef8bef0164a70bd03d2b9781951c01bdd018f1842 /doc/md/Upgrade-and-migration.md
parentd5d22a6d07917865c44148ad76f43c65a929a890 (diff)
downloadShaarli-53ed6d7d1e678d7486337ce67a2f17b30bac21ac.tar.gz
Shaarli-53ed6d7d1e678d7486337ce67a2f17b30bac21ac.tar.zst
Shaarli-53ed6d7d1e678d7486337ce67a2f17b30bac21ac.zip
Generate HTML documentation using MkDocs (WIP)
MkDocs is a static site generator geared towards building project documentation. Documentation source files are written in Markdown, and configured with a single YAML file. * http://www.mkdocs.org/ * http://www.mkdocs.org/user-guide/configuration/ Ref. #312 * remove pandoc-generated HTML documentation * move markdown doc to doc/md/, * mkdocs.yml: * generate HTML doc in doc/html * add pages TOC/ordering * use index.md as index page * Makefile: remove execute permissions from generated files * Makefile: rewrite htmlpages GFM to markdown conversion using sed: awk expression aslo matched '][' which causes invalid output on complex links with images or code blocks * Add mkdocs.yml to .gitattributes, exclude this file from release archives * Makefile: rename: htmldoc -> doc_html target * run make doc: pull latest markdown documentation from wiki * run make htmlpages: update html documentation
Diffstat (limited to 'doc/md/Upgrade-and-migration.md')
-rw-r--r--doc/md/Upgrade-and-migration.md194
1 files changed, 194 insertions, 0 deletions
diff --git a/doc/md/Upgrade-and-migration.md b/doc/md/Upgrade-and-migration.md
new file mode 100644
index 00000000..7348891f
--- /dev/null
+++ b/doc/md/Upgrade-and-migration.md
@@ -0,0 +1,194 @@
1## Preparation
2
3### Note your current version
4
5If anything goes wrong, it's important for us to know which version you're upgrading from.
6The current version is present in the `version.php` file.
7
8### Backup your data
9
10Shaarli stores all user data under the `data` directory:
11- `data/config.php` - main configuration file
12- `data/datastore.php` - bookmarked links
13- `data/ipbans.php` - banned IP addresses
14- `data/updates.txt` - contains all automatic update to the configuration and datastore files already run
15
16See [[Shaarli configuration]] for more information about Shaarli resources.
17
18It is recommended to backup this repository _before_ starting updating/upgrading Shaarli:
19- users with SSH access: copy or archive the directory to a temporary location
20- users with FTP access: download a local copy of your Shaarli installation using your favourite client
21
22### Migrating data from a previous installation
23
24As all user data is kept under `data`, this is the only directory you need to worry about when migrating to a new installation, which corresponds to the following steps:
25
26- backup the `data` directory
27- install or update Shaarli:
28 - fresh installation - see [[Download and installation]]
29 - update - see the following sections
30- check or restore the `data` directory
31
32## Recommended : Upgrading from release archives
33
34All tagged revisions can be downloaded as tarballs or ZIP archives from the [releases](https://github.com/shaarli/Shaarli/releases) page.
35
36We recommend that you use the latest release tarball with the `-full` suffix. It contains the dependencies, please read [[Download and installation]] for `git` complete instructions.
37
38Once downloaded, extract the archive locally and update your remote installation (e.g. via FTP) -be sure you keep the content of the `data` directory!
39
40After 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 `data/config.json.php` (see [[Shaarli configuration]] for more details).
41
42## Upgrading with Git
43
44### Updating a community Shaarli
45
46If you have installed Shaarli from the [community Git repository](Download#clone-with-git-recommended), simply [pull new changes](https://www.git-scm.com/docs/git-pull) from your local clone:
47
48```bash
49$ cd /path/to/shaarli
50$ git pull
51
52From github.com:shaarli/Shaarli
53 * branch master -> FETCH_HEAD
54Updating ebd67c6..521f0e6
55Fast-forward
56 application/Url.php | 1 +
57 shaarli_version.php | 2 +-
58 tests/Url/UrlTest.php | 1 +
59 3 files changed, 3 insertions(+), 1 deletion(-)
60```
61
62Shaarli >= `v0.8.x`: install/update third-party PHP dependencies using [Composer](https://getcomposer.org/):
63
64```bash
65$ composer install --no-dev
66
67Loading composer repositories with package information
68Updating dependencies
69 - Installing shaarli/netscape-bookmark-parser (v1.0.1)
70 Downloading: 100%
71```
72
73### Migrating and upgrading from Sebsauvage's repository
74
75If you have installed Shaarli from [Sebsauvage's original Git repository](https://github.com/sebsauvage/Shaarli), you can use [Git remotes](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) to update your working copy.
76
77The following guide assumes that:
78- you have a basic knowledge of Git [branching](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) and [remote repositories](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes)
79- the default remote is named `origin` and points to Sebsauvage's repository
80- the current branch is `master`
81 - if you have personal branches containing customizations, you will need to [rebase them](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) 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!
82- the working copy is clean:
83 - no versioned file has been locally modified
84 - no untracked files are present
85
86#### Step 0: show repository information
87
88```bash
89$ cd /path/to/shaarli
90
91$ git remote -v
92origin https://github.com/sebsauvage/Shaarli (fetch)
93origin https://github.com/sebsauvage/Shaarli (push)
94
95$ git branch -vv
96* master 029f75f [origin/master] Update README.md
97
98$ git status
99On branch master
100Your branch is up-to-date with 'origin/master'.
101nothing to commit, working directory clean
102```
103
104#### Step 1: update Git remotes
105
106```
107$ git remote rename origin sebsauvage
108$ git remote -v
109sebsauvage https://github.com/sebsauvage/Shaarli (fetch)
110sebsauvage https://github.com/sebsauvage/Shaarli (push)
111
112$ git remote add origin https://github.com/shaarli/Shaarli
113$ git fetch origin
114
115remote: Counting objects: 3015, done.
116remote: Compressing objects: 100% (19/19), done.
117remote: Total 3015 (delta 446), reused 457 (delta 446), pack-reused 2550
118Receiving objects: 100% (3015/3015), 2.59 MiB | 918.00 KiB/s, done.
119Resolving deltas: 100% (1899/1899), completed with 48 local objects.
120From https://github.com/shaarli/Shaarli
121 * [new branch] master -> origin/master
122 * [new branch] stable -> origin/stable
123[...]
124 * [new tag] v0.6.4 -> v0.6.4
125 * [new tag] v0.7.0 -> v0.7.0
126```
127
128#### Step 2: use the stable community branch
129
130```bash
131$ git checkout origin/stable -b stable
132Branch stable set up to track remote branch stable from origin.
133Switched to a new branch 'stable'
134
135$ git branch -vv
136 master 029f75f [sebsauvage/master] Update README.md
137* stable 890afc3 [origin/stable] Merge pull request #509 from ArthurHoaro/v0.6.5
138```
139
140Shaarli >= `v0.8.x`: install/update third-party PHP dependencies using [Composer](https://getcomposer.org/):
141
142```bash
143$ composer install --no-dev
144
145Loading composer repositories with package information
146Updating dependencies
147 - Installing shaarli/netscape-bookmark-parser (v1.0.1)
148 Downloading: 100%
149```
150
151Optionally, you can delete information related to the legacy version:
152
153```bash
154$ git branch -D master
155Deleted branch master (was 029f75f).
156
157$ git remote remove sebsauvage
158
159$ git remote -v
160origin https://github.com/shaarli/Shaarli (fetch)
161origin https://github.com/shaarli/Shaarli (push)
162
163$ git gc
164Counting objects: 3317, done.
165Delta compression using up to 8 threads.
166Compressing objects: 100% (1237/1237), done.
167Writing objects: 100% (3317/3317), done.
168Total 3317 (delta 2050), reused 3301 (delta 2034)to
169```
170
171#### Step 3: configuration
172
173After migrating, access your fresh Shaarli installation from a web browser; the configuration will then be automatically updated, and new settings added to `data/config.php` (see [[Shaarli configuration]] for more details).
174
175## Troubleshooting
176
177If the solutions provided here doesn't work, please open an issue specifying which version you're upgrading from and to.
178
179### You must specify an integer as a key
180
181In `v0.8.1` we changed how link keys are handled (from timestamps to incremental integers).
182Take a look at `data/updates.txt` content.
183
184#### `updates.txt` contains `updateMethodDatastoreIds`
185
186Try to delete it and refresh your page while being logged in.
187
188#### `updates.txt` doesn't exists or doesn't contain `updateMethodDatastoreIds`
189
190 1. Create `data/updates.txt` if it doesn't exist.
191 2. Paste this string in the update file `;updateMethodRenameDashTags;`
192 3. Login to Shaarli.
193 4. Delete the update file.
194 5. Refresh.