3 ### Note your current version
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.
10 Shaarli stores all user data under the `data` directory:
12 - `data/config.php` - main configuration file
13 - `data/datastore.php` - bookmarked links
14 - `data/ipbans.php` - banned IP addresses
15 - `data/updates.txt` - contains all automatic update to the configuration and datastore files already run
17 See [Shaarli configuration](Shaarli-configuration) for more information about Shaarli resources.
19 It is recommended to backup this repository _before_ starting updating/upgrading Shaarli:
21 - users with SSH access: copy or archive the directory to a temporary location
22 - users with FTP access: download a local copy of your Shaarli installation using your favourite client
24 ### Migrating data from a previous installation
26 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:
28 - backup the `data` directory
29 - install or update Shaarli:
30 - fresh installation - see [Download and installation](Download-and-installation)
31 - update - see the following sections
32 - check or restore the `data` directory
34 ## Recommended : Upgrading from release archives
36 All tagged revisions can be downloaded as tarballs or ZIP archives from the [releases](https://github.com/shaarli/Shaarli/releases) page.
38 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) for `git` complete instructions.
40 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!
42 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) for more details).
46 ### Updating a community Shaarli
48 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:
54 From github.com:shaarli/Shaarli
55 * branch master -> FETCH_HEAD
56 Updating ebd67c6..521f0e6
58 application/Url.php | 1 +
59 shaarli_version.php | 2 +-
60 tests/Url/UrlTest.php | 1 +
61 3 files changed, 3 insertions(+), 1 deletion(-)
64 Shaarli >= `v0.8.x`: install/update third-party PHP dependencies using [Composer](https://getcomposer.org/):
67 $ composer install --no-dev
69 Loading composer repositories with package information
71 - Installing shaarli/netscape-bookmark-parser (v1.0.1)
75 ### Migrating and upgrading from Sebsauvage's repository
77 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.
79 The following guide assumes that:
81 - 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)
82 - the default remote is named `origin` and points to Sebsauvage's repository
83 - the current branch is `master`
84 - 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!
85 - the working copy is clean:
86 - no versioned file has been locally modified
87 - no untracked files are present
89 #### Step 0: show repository information
95 origin https://github.com/sebsauvage/Shaarli (fetch)
96 origin https://github.com/sebsauvage/Shaarli (push)
99 * master 029f75f [origin/master] Update README.md
103 Your branch is up-to-date with 'origin/master'.
104 nothing to commit, working directory clean
107 #### Step 1: update Git remotes
110 $ git remote rename origin sebsauvage
112 sebsauvage https://github.com/sebsauvage/Shaarli (fetch)
113 sebsauvage https://github.com/sebsauvage/Shaarli (push)
115 $ git remote add origin https://github.com/shaarli/Shaarli
118 remote: Counting objects: 3015, done.
119 remote: Compressing objects: 100% (19/19), done.
120 remote: Total 3015 (delta 446), reused 457 (delta 446), pack-reused 2550
121 Receiving objects: 100% (3015/3015), 2.59 MiB | 918.00 KiB/s, done.
122 Resolving deltas: 100% (1899/1899), completed with 48 local objects.
123 From https://github.com/shaarli/Shaarli
124 * [new branch] master -> origin/master
125 * [new branch] stable -> origin/stable
127 * [new tag] v0.6.4 -> v0.6.4
128 * [new tag] v0.7.0 -> v0.7.0
131 #### Step 2: use the stable community branch
134 $ git checkout origin/stable -b stable
135 Branch stable set up to track remote branch stable from origin.
136 Switched to a new branch 'stable'
139 master 029f75f [sebsauvage/master] Update README.md
140 * stable 890afc3 [origin/stable] Merge pull request #509 from ArthurHoaro/v0.6.5
143 Shaarli >= `v0.8.x`: install/update third-party PHP dependencies using [Composer](https://getcomposer.org/):
146 $ composer install --no-dev
148 Loading composer repositories with package information
149 Updating dependencies
150 - Installing shaarli/netscape-bookmark-parser (v1.0.1)
154 Optionally, you can delete information related to the legacy version:
157 $ git branch -D master
158 Deleted branch master (was 029f75f).
160 $ git remote remove sebsauvage
163 origin https://github.com/shaarli/Shaarli (fetch)
164 origin https://github.com/shaarli/Shaarli (push)
167 Counting objects: 3317, done.
168 Delta compression using up to 8 threads.
169 Compressing objects: 100% (1237/1237), done.
170 Writing objects: 100% (3317/3317), done.
171 Total 3317 (delta 2050), reused 3301 (delta 2034)to
174 #### Step 3: configuration
176 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) for more details).
180 If the solutions provided here don't work, please open an issue specifying which version you're upgrading from and to.
182 ### You must specify an integer as a key
184 In `v0.8.1` we changed how link keys are handled (from timestamps to incremental integers).
185 Take a look at `data/updates.txt` content.
187 #### `updates.txt` contains `updateMethodDatastoreIds`
189 Try to delete it and refresh your page while being logged in.
191 #### `updates.txt` doesn't exist or doesn't contain `updateMethodDatastoreIds`
193 1. Create `data/updates.txt` if it doesn't exist
194 2. Paste this string in the update file `;updateMethodRenameDashTags;`
196 4. Delete the update file