diff options
Diffstat (limited to 'support/doc')
-rw-r--r-- | support/doc/production.md | 48 |
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 | ||
257 | Make a SQL backup: | 257 | Make 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 | ||
265 | Update your configuration file. **If some keys are missing, your upgraded PeerTube won't start!** | 265 | Fetch 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 | ||
271 | Upgrade PeerTube: | 271 | Download 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 | |
280 | Change 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 | |||
288 | Install node dependencies: | ||
289 | |||
281 | ``` | 290 | ``` |
291 | $ cd /var/www/peertube/peertube-latest && \ | ||
292 | sudo -u peertube yarn install --production --pure-lockfile | ||
293 | ``` | ||
294 | |||
295 | Copy 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 | |||
302 | Restart PeerTube: | ||
303 | ``` | ||
304 | $ sudo systemctl restart peertube | ||
305 | ``` | ||
306 | |||
307 | ### Things went wrong? | ||
282 | 308 | ||
283 | Things went wrong? Change `peertube-latest` destination to the previous version and restore your SQL backup: | 309 | Change `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" && \ |