From 91a21c272960889afd4eaa431a3d29b7785b6efc Mon Sep 17 00:00:00 2001 From: nodiscc Date: Sat, 16 May 2020 12:54:51 +0200 Subject: **General rewording, proof-reading, deduplication, shortening, reordering, simplification, cleanup/formatting/standardization** - standardize page names, rework documentation structure, update TOC - use same example paths everywhere - level 1 titles on all pages - fix broken links - .md suffix on all page links (works both from readthedocs and github repository views) **Server:** A full and concise installation guide with examples is a frequent request. The documentation should provide such a guide for basic installation needs, while explaining alternative/advanced configuration at the end. Links to reference guides and documentation should be used more frequently to avoid recommending an outdated or excessively complex configuration. - server: move most server-related info to server-configuration.md, cleanup/shorten - server: update list of php dependencies/libraries, link to composer.json - server: installation: support 3 install methods (from release zip, from sources, using docker) - server: installation: use rsync instead of mv as mv results will change depending of taget directory already existing or not - server: add example/basic usage of certbot - server, upgrade, installation: update file permissions setup, use sudo for upgrade operations in webserver document root - server: apache: add comments to configuration, fix and factorize file permissions setup, set cache-control header, deny access to dotfiles, add missing apache config steps, add http->https redirect example - server: nginx: refactor nginx configuration, add comments, DO log access to denied/protected files - server: add links to MDN for x-forwarded-* http headers explanation, cleanup/clarify robots.txt and crawlers section - server: bump file upload size limit to 100MB we have reports of bookmark exports weighing +40MB - i have a 13MB one here - server: simplify phpinfo documentation - server: move backup and restore information to dedicated page - docker: move all docker docs to Docker.md, simplify/ docker setup, add docker-compose.yml example, replace docker-101 with docker cheatsheet - troubleshooting: move all troubleshooting documentation to troubleshooting.md **Usage:** - index: add getting started section on index page - features/usage: move all usage-related documentation to usage.md, add links from the main feature list to corresponding usage docs, clarify/reword features list - shaarli configuration: add note about configuring from web interface **Removed:** - remove obsolete/orphan images - remove obsolete shaarchiver example - remove outdated "decode datastore content" snippet **Development:** - development: move development-related docs (static analysis, CI, unit tests, 3rd party libs, link structure/directory, guidelines, security....) to dev/ directory - development: Merge several pages to development.md - **Breaking change?:** remove mentions of 'stable' branch, switch to new branch/release model (master=latest commit, release=latest tag) - **Breaking change?:** refer to base sharing unit as "Shaare" everywhere (TODO: reflect changes in the code?) doc: update featues list/link to usage.md for details - development: directory structure: add note about required file permissions - .travis-ci.yml: add comments - .htaccess: add comment --- doc/md/Upgrade-and-migration.md | 154 ++++++++++++++++------------------------ 1 file changed, 63 insertions(+), 91 deletions(-) (limited to 'doc/md/Upgrade-and-migration.md') diff --git a/doc/md/Upgrade-and-migration.md b/doc/md/Upgrade-and-migration.md index d5682a34..8b0db1f8 100644 --- a/doc/md/Upgrade-and-migration.md +++ b/doc/md/Upgrade-and-migration.md @@ -1,96 +1,85 @@ -## Preparation +# Upgrade and migration -### Note your current version +## Note your current version If anything goes wrong, it's important for us to know which version you're upgrading from. The current version is present in the `shaarli_version.php` file. -### Backup your data -Shaarli stores all user data under the `data` directory: +## Backup your data -- `data/config.json.php` (or `data/config.php` for older Shaarli versions) - main configuration file -- `data/datastore.php` - bookmarked links -- `data/ipbans.php` - banned IP addresses -- `data/updates.txt` - contains all automatic update to the configuration and datastore files already run +Shaarli stores all user data and [configuration](Shaarli-configuration.md) under the `data` directory. [Backup](Backup-and-restore.md) this repository _before_ upgrading Shaarli. You will need to restore it after the following upgrade steps. -See [Shaarli configuration](Shaarli-configuration) for more information about Shaarli resources. - -It is recommended to backup this repository _before_ starting updating/upgrading Shaarli: - -- users with SSH access: copy or archive the directory to a temporary location -- users with FTP access: download a local copy of your Shaarli installation using your favourite client - -### Migrating data from a previous installation - -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: - -- backup the `data` directory -- install or update Shaarli: - - fresh installation - see [Download and Installation](Download-and-Installation) - - update - see the following sections -- check or restore the `data` directory - -## Recommended : Upgrading from release archives +```bash +sudo cp -r /var/www/shaarli.mydomain.org/data ~/shaarli-data-backup +``` -All tagged revisions can be downloaded as tarballs or ZIP archives from the [releases](https://github.com/shaarli/Shaarli/releases) page. +## Upgrading from ZIP archives -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. +If you installed Shaarli from a [release ZIP archive](Installation.md#from-release-zip): -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! +```bash +# Download the archive to the server, and extract it +cd ~ +wget https://github.com/shaarli/Shaarli/releases/download/v0.X.Y/shaarli-v0.X.Y-full.zip +unzip shaarli-v0.X.Y-full.zip + +# overwrite your Shaarli installation with the new release **All data will be lost, see _Backup your data_ above.** +sudo rsync -avP --delete Shaarli/ /var/www/shaarli.mydomain.org/ + +# restore file permissions as described on the installation page +sudo chown -R root:www-data /var/www/shaarli.mydomain.org +sudo chmod -R u=rwX /var/www/shaarli.mydomain.org +sudo chmod -R g+rX /var/www/shaarli.mydomain.org/{index.php,application/,plugins/,inc/} +sudo chmod -R g+rwX /var/www/shaarli.mydomain.org/{cache/,data/,pagecache/,tmp/} + +# restore backups of the data directory +sudo cp -r ~/shaarli-data-backup/* /var/www/shaarli.mydomain.org/data/ + +# If you use gettext mode for translations (not the default), reload your web server. +sudo systemctl restart apache2 +sudo systemctl restart nginx +``` -If you use translations in gettext mode - meaning you manually changed the default mode -, -reload your web server. +If you don't have shell access (eg. on shared hosting), backup the shaarli data directory, download the ZIP archive locally, extract it, upload it to the server using file transfer, and restore the data directory backup. -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). +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.md) for more details). -## Upgrading with Git -### Updating a community Shaarli +## Upgrading from Git -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: +If you have installed Shaarli [from sources](Installation.md#from-sources): ```bash -$ cd /path/to/shaarli -$ git pull - -From github.com:shaarli/Shaarli - * branch master -> FETCH_HEAD -Updating ebd67c6..521f0e6 -Fast-forward - application/Url.php | 1 + - shaarli_version.php | 2 +- - tests/Url/UrlTest.php | 1 + - 3 files changed, 3 insertions(+), 1 deletion(-) -``` +# pull new changes from your local clone +cd /var/www/shaarli.mydomain.org/ +sudo git pull -Shaarli >= `v0.8.x`: install/update third-party PHP dependencies using [Composer](https://getcomposer.org/): +# update PHP dependencies (Shaarli >= v0.8) +sudo composer install --no-dev -```bash -$ composer install --no-dev +# update translations (Shaarli >= v0.9.2) +sudo make translate -Loading composer repositories with package information -Updating dependencies - - Installing shaarli/netscape-bookmark-parser (v1.0.1) - Downloading: 100% -``` +# If you use translations in gettext mode (not the default), reload your web server. +sudo systemctl reload apache +sudo systemctl reload nginx -Shaarli >= `v0.9.2` supports translations: +# update front-end dependencies (Shaarli >= v0.10.0) +sudo make build_frontend -```bash -$ make translate -``` +# restore file permissions as described on the installation page +sudo chown -R root:www-data /var/www/shaarli.mydomain.org +sudo chmod -R u=rwX /var/www/shaarli.mydomain.org +sudo chmod -R g+rX /var/www/shaarli.mydomain.org/{index.php,application/,plugins/,inc/} +sudo chmod -R g+rwX /var/www/shaarli.mydomain.org/{cache/,data/,pagecache/,tmp/} +``` -If you use translations in gettext mode, reload your web server. +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.md) for more details). -Shaarli >= `v0.10.0` manages its front-end dependencies with nodejs. You need to install -[yarn](https://yarnpkg.com/lang/en/docs/install/): +--------------------------------------------------------------- -```bash -$ make build_frontend -``` - -### Migrating and upgrading from Sebsauvage's repository +## Migrating and upgrading from Sebsauvage's repository 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. @@ -104,7 +93,7 @@ The following guide assumes that: - no versioned file has been locally modified - no untracked files are present -#### Step 0: show repository information +### Step 0: show repository information ```bash $ cd /path/to/shaarli @@ -122,7 +111,7 @@ Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean ``` -#### Step 1: update Git remotes +### Step 1: update Git remotes ``` $ git remote rename origin sebsauvage @@ -146,7 +135,7 @@ From https://github.com/shaarli/Shaarli * [new tag] v0.7.0 -> v0.7.0 ``` -#### Step 2: use the stable community branch +### Step 2: use the stable community branch ```bash $ git checkout origin/stable -b stable @@ -177,8 +166,7 @@ $ make translate If you use translations in gettext mode, reload your web server. -Shaarli >= `v0.10.0` manages its front-end dependencies with nodejs. You need to install -[yarn](https://yarnpkg.com/lang/en/docs/install/): +Shaarli >= `v0.10.0` manages its front-end dependencies with nodejs. You need to install [yarn](https://yarnpkg.com/lang/en/docs/install/): ```bash $ make build_frontend @@ -204,30 +192,14 @@ Writing objects: 100% (3317/3317), done. Total 3317 (delta 2050), reused 3301 (delta 2034)to ``` -#### Step 3: configuration +### Step 3: configuration 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.json.php` (see [Shaarli configuration](Shaarli-configuration) for more +`data/config.json.php` (see [Shaarli configuration](Shaarli-configuration.md) for more details). ## Troubleshooting -If the solutions provided here don't work, please open an issue specifying which version you're upgrading from and to. - -### You must specify an integer as a key - -In `v0.8.1` we changed how link keys are handled (from timestamps to incremental integers). -Take a look at `data/updates.txt` content. - -#### `updates.txt` contains `updateMethodDatastoreIds` - -Try to delete it and refresh your page while being logged in. - -#### `updates.txt` doesn't exist or doesn't contain `updateMethodDatastoreIds` +If the solutions provided here don't work, see [Troubleshooting](Troubleshooting.md) and/or open an issue specifying which version you're upgrading from and to. -1. Create `data/updates.txt` if it doesn't exist -2. Paste this string in the update file `;updateMethodRenameDashTags;` -3. Login to Shaarli -4. Delete the update file -5. Refresh -- cgit v1.2.3 From 1a19c921a9a94f555c43fd932f9f57ddd5747889 Mon Sep 17 00:00:00 2001 From: nodiscc Date: Sat, 15 Aug 2020 20:12:39 +0200 Subject: doc: updagrde/migration: simplify permissions setup --- doc/md/Upgrade-and-migration.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'doc/md/Upgrade-and-migration.md') diff --git a/doc/md/Upgrade-and-migration.md b/doc/md/Upgrade-and-migration.md index 8b0db1f8..bfef3e8c 100644 --- a/doc/md/Upgrade-and-migration.md +++ b/doc/md/Upgrade-and-migration.md @@ -29,8 +29,7 @@ sudo rsync -avP --delete Shaarli/ /var/www/shaarli.mydomain.org/ # restore file permissions as described on the installation page sudo chown -R root:www-data /var/www/shaarli.mydomain.org -sudo chmod -R u=rwX /var/www/shaarli.mydomain.org -sudo chmod -R g+rX /var/www/shaarli.mydomain.org/{index.php,application/,plugins/,inc/} +sudo chmod -R g+rX /var/www/shaarli.mydomain.org sudo chmod -R g+rwX /var/www/shaarli.mydomain.org/{cache/,data/,pagecache/,tmp/} # restore backups of the data directory @@ -70,8 +69,7 @@ sudo make build_frontend # restore file permissions as described on the installation page sudo chown -R root:www-data /var/www/shaarli.mydomain.org -sudo chmod -R u=rwX /var/www/shaarli.mydomain.org -sudo chmod -R g+rX /var/www/shaarli.mydomain.org/{index.php,application/,plugins/,inc/} +sudo chmod -R g+rX /var/www/shaarli.mydomain.org sudo chmod -R g+rwX /var/www/shaarli.mydomain.org/{cache/,data/,pagecache/,tmp/} ``` -- cgit v1.2.3