]> git.immae.eu Git - github/shaarli/Shaarli.git/blob - doc/Upgrade-and-migration.md
Bump version to v0.9.0
[github/shaarli/Shaarli.git] / doc / Upgrade-and-migration.md
1 #Upgrade and migration
2 ## Preparation
3 ### Note your current version
4
5 If anything goes wrong, it's important for us to know which version you're upgrading from.
6 The current version is present in the `version.php` file.
7
8 ### Backup your data
9
10 Shaarli 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
16 See [Shaarli configuration](Shaarli-configuration.html) for more information about Shaarli resources.
17
18 It 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 As 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:
24
25 - backup the `data` directory
26 - install or update Shaarli:
27 - fresh installation - see [Download and installation](Download-and-installation.html)
28 - update - see the following sections
29 - check or restore the `data` directory
30
31 ## Recommended : Upgrading from release archives
32 All tagged revisions can be downloaded as tarballs or ZIP archives from the [releases](https://github.com/shaarli/Shaarli/releases) page.[](.html)
33
34 We recommend that you use the latest release tarball with the `-full` suffix. It contains the dependencies, please read [Download and installation](Download-and-installation.html) for `git` complete instructions.
35
36 Once downloaded, extract the archive locally and update your remote installation (e.g. via FTP) -be sure you keep the content of the `data` directory!
37
38 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 `data/config.json.php` (see [Shaarli configuration](Shaarli-configuration.html) for more details).
39
40 ## Upgrading with Git
41 ### Updating a community Shaarli
42 If 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:[](.html)
43
44 ```bash
45 $ cd /path/to/shaarli
46 $ git pull
47
48 From github.com:shaarli/Shaarli
49 * branch master -> FETCH_HEAD
50 Updating ebd67c6..521f0e6
51 Fast-forward
52 application/Url.php | 1 +
53 shaarli_version.php | 2 +-
54 tests/Url/UrlTest.php | 1 +
55 3 files changed, 3 insertions(+), 1 deletion(-)
56 ```
57
58 Shaarli >= `v0.8.x`: install/update third-party PHP dependencies using [Composer](https://getcomposer.org/):[](.html)
59
60 ```bash
61 $ composer install --no-dev
62
63 Loading composer repositories with package information
64 Updating dependencies
65 - Installing shaarli/netscape-bookmark-parser (v1.0.1)
66 Downloading: 100%
67 ```
68
69 ### Migrating and upgrading from Sebsauvage's repository
70 If 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.[](.html)
71
72 The following guide assumes that:
73 - 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)[](.html)
74 - the default remote is named `origin` and points to Sebsauvage's repository
75 - the current branch is `master`
76 - 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![](.html)
77 - the working copy is clean:
78 - no versioned file has been locally modified
79 - no untracked files are present
80
81 #### Step 0: show repository information
82 ```bash
83 $ cd /path/to/shaarli
84
85 $ git remote -v
86 origin https://github.com/sebsauvage/Shaarli (fetch)
87 origin https://github.com/sebsauvage/Shaarli (push)
88
89 $ git branch -vv
90 * master 029f75f [origin/master] Update README.md[](.html)
91
92 $ git status
93 On branch master
94 Your branch is up-to-date with 'origin/master'.
95 nothing to commit, working directory clean
96 ```
97
98 #### Step 1: update Git remotes
99 ```
100 $ git remote rename origin sebsauvage
101 $ git remote -v
102 sebsauvage https://github.com/sebsauvage/Shaarli (fetch)
103 sebsauvage https://github.com/sebsauvage/Shaarli (push)
104
105 $ git remote add origin https://github.com/shaarli/Shaarli
106 $ git fetch origin
107
108 remote: Counting objects: 3015, done.
109 remote: Compressing objects: 100% (19/19), done.
110 remote: Total 3015 (delta 446), reused 457 (delta 446), pack-reused 2550
111 Receiving objects: 100% (3015/3015), 2.59 MiB | 918.00 KiB/s, done.
112 Resolving deltas: 100% (1899/1899), completed with 48 local objects.
113 From https://github.com/shaarli/Shaarli
114 * [new branch] master -> origin/master[](.html)
115 * [new branch] stable -> origin/stable[](.html)
116 [...][](.html)
117 * [new tag] v0.6.4 -> v0.6.4[](.html)
118 * [new tag] v0.7.0 -> v0.7.0[](.html)
119 ```
120
121 #### Step 2: use the stable community branch
122
123 ```bash
124 $ git checkout origin/stable -b stable
125 Branch stable set up to track remote branch stable from origin.
126 Switched to a new branch 'stable'
127
128 $ git branch -vv
129 master 029f75f [sebsauvage/master] Update README.md[](.html)
130 * stable 890afc3 [origin/stable] Merge pull request #509 from ArthurHoaro/v0.6.5[](.html)
131 ```
132
133 Shaarli >= `v0.8.x`: install/update third-party PHP dependencies using [Composer](https://getcomposer.org/):[](.html)
134
135 ```bash
136 $ composer install --no-dev
137
138 Loading composer repositories with package information
139 Updating dependencies
140 - Installing shaarli/netscape-bookmark-parser (v1.0.1)
141 Downloading: 100%
142 ```
143
144 Optionally, you can delete information related to the legacy version:
145
146 ```bash
147 $ git branch -D master
148 Deleted branch master (was 029f75f).
149
150 $ git remote remove sebsauvage
151
152 $ git remote -v
153 origin https://github.com/shaarli/Shaarli (fetch)
154 origin https://github.com/shaarli/Shaarli (push)
155
156 $ git gc
157 Counting objects: 3317, done.
158 Delta compression using up to 8 threads.
159 Compressing objects: 100% (1237/1237), done.
160 Writing objects: 100% (3317/3317), done.
161 Total 3317 (delta 2050), reused 3301 (delta 2034)to
162 ```
163
164 #### Step 3: configuration
165 After 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](Shaarli-configuration.html) for more details).
166
167 ## Troubleshooting
168
169 If the solutions provided here doesn't work, please open an issue specifying which version you're upgrading from and to.
170
171 ### You must specify an integer as a key
172
173 In `v0.8.1` we changed how link keys are handled (from timestamps to incremental integers).
174 Take a look at `data/updates.txt` content.
175
176 #### `updates.txt` contains `updateMethodDatastoreIds`
177
178 Try to delete it and refresh your page while being logged in.
179
180 #### `updates.txt` doesn't exists or doesn't contain `updateMethodDatastoreIds`
181
182 1. Create `data/updates.txt` if it doesn't exist.
183 2. Paste this string in the update file `;updateMethodRenameDashTags;`
184 3. Login to Shaarli.
185 4. Delete the update file.
186 5. Refresh.