aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-26 10:50:05 +0100
committerChocobozzz <me@florianbigard.com>2018-01-26 10:50:05 +0100
commitce487e1e3b9ae46b4bea2297e13d6f8c5b3f8aeb (patch)
tree44fc98667ce46721aa70d64f35f8a0e62d1092af /support/doc
parentf96d1df32927844ce1412e0e1a522ecc02a719f6 (diff)
downloadPeerTube-ce487e1e3b9ae46b4bea2297e13d6f8c5b3f8aeb.tar.gz
PeerTube-ce487e1e3b9ae46b4bea2297e13d6f8c5b3f8aeb.tar.zst
PeerTube-ce487e1e3b9ae46b4bea2297e13d6f8c5b3f8aeb.zip
Upgrade clearer in production guide
Diffstat (limited to 'support/doc')
-rw-r--r--support/doc/production.md48
1 files changed, 37 insertions, 11 deletions
diff --git a/support/doc/production.md b/support/doc/production.md
index e46d9d9e1..c18b4ead0 100644
--- a/support/doc/production.md
+++ b/support/doc/production.md
@@ -254,7 +254,7 @@ $ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/conf
254 254
255## Upgrade 255## Upgrade
256 256
257Make a SQL backup: 257Make a SQL backup
258 258
259``` 259```
260$ SQL_BACKUP_PATH="backup/sql-peertube_prod-$(date -Im).bak" && \ 260$ SQL_BACKUP_PATH="backup/sql-peertube_prod-$(date -Im).bak" && \
@@ -262,25 +262,51 @@ $ SQL_BACKUP_PATH="backup/sql-peertube_prod-$(date -Im).bak" && \
262 sudo pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH" 262 sudo pg_dump -U peertube -W -h localhost -F c peertube_prod -f "$SQL_BACKUP_PATH"
263``` 263```
264 264
265Update your configuration file. **If some keys are missing, your upgraded PeerTube won't start!** 265Fetch the latest tagged version of Peertube:
266 266
267``` 267```
268$ diff <(curl -s https://raw.githubusercontent.com/Chocobozzz/PeerTube/develop/config/production.yaml.example) /var/www/peertube/config/production.yaml 268$ VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) && echo "Latest Peertube version is $VERSION"
269``` 269```
270 270
271Upgrade PeerTube: 271Download the new version and unzip it:
272 272
273``` 273```
274$ VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) && \ 274$ cd /var/www/peertube/versions && \
275 cd /var/www/peertube/versions && \
276 sudo -u peertube wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" && \ 275 sudo -u peertube wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip" && \
277 sudo -u peertube unzip -o peertube-${VERSION}.zip && sudo -u peertube rm peertube-${VERSION}.zip && \ 276 sudo -u peertube unzip -o peertube-${VERSION}.zip && \
278 cd ../ && sudo rm ./peertube-latest && sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest && \ 277 sudo -u peertube rm peertube-${VERSION}.zip
279 cd ./peertube-latest && sudo -u peertube yarn install --production --pure-lockfile && \ 278```
280 sudo systemctl restart peertube 279
280Change the link to point to the latest version:
281
282```
283$ cd /var/www/peertube && \
284 sudo rm ./peertube-latest && \
285 sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest
286```
287
288Install node dependencies:
289
281``` 290```
291$ cd /var/www/peertube/peertube-latest && \
292 sudo -u peertube yarn install --production --pure-lockfile
293```
294
295Copy new configuration defaults values and update your configuration file:
296
297```
298$ sudo -u peertube cp /var/www/peertube/peertube-latest/config/default.yaml /var/www/peertube/config/default.yaml
299$ diff /var/www/peertube/peertube-latest/config//production.yaml.example /var/www/peertube/config/production.yaml
300```
301
302Restart PeerTube:
303```
304$ sudo systemctl restart peertube
305```
306
307### Things went wrong?
282 308
283Things went wrong? Change `peertube-latest` destination to the previous version and restore your SQL backup: 309Change `peertube-latest` destination to the previous version and restore your SQL backup:
284 310
285``` 311```
286$ OLD_VERSION="v0.42.42" && SQL_BACKUP_PATH="backup/sql-peertube_prod-2018-01-19T10:18+01:00.bak" && \ 312$ OLD_VERSION="v0.42.42" && SQL_BACKUP_PATH="backup/sql-peertube_prod-2018-01-19T10:18+01:00.bak" && \