]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - support/doc/production.md
Update Guide for upgrade procedure (#281) (#291)
[github/Chocobozzz/PeerTube.git] / support / doc / production.md
index c18b4ead059ba5898d99084ee796a7d705809cb1..ba76a81cfcee9cf2499884ebcb97953ef415aba7 100644 (file)
@@ -1,7 +1,12 @@
 # Production guide
 
+  * [Installation](#installation)
+  * [Upgrade](#upgrade) 
+
 ## Installation
 
+**Please don't install PeerTube for production on a small device behind a low bandwidth connection because it could slow down the fediverse.**
+
 ### Dependencies
 
 Follow the steps of the [dependencies guide](dependencies.md).
@@ -49,7 +54,7 @@ $ sudo -u peertube unzip peertube-${VERSION}.zip && sudo -u peertube rm peertube
 Install Peertube
 ```
 $ cd ../ && sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest
-$ cd ./peertube-latest && sudo -u peertube yarn install --production --pure-lockfile
+$ cd ./peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile
 ```
 
 ### PeerTube configuration
@@ -253,7 +258,19 @@ $ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/conf
 ```
 
 ## Upgrade
+#### Auto
+
+Via the bash Script :
+
+```
+$ su - peertube
+$ cd scripts && ./upgrade.sh
+$ exit
+$ systemctl restart peertube
+$ systemctl status peertube
+```
 
+#### Manuel
 Make a SQL backup
 
 ```
@@ -277,28 +294,29 @@ $ cd /var/www/peertube/versions && \
     sudo -u peertube rm peertube-${VERSION}.zip
 ```
 
-Change the link to point to the latest version:
+Install node dependencies:
 
 ```
-$ cd /var/www/peertube && \
-    sudo rm ./peertube-latest && \
-    sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest
+$ cd /var/www/peertube/versions/peertube-${VERSION} && \
+    sudo -u peertube yarn install --production --pure-lockfile
 ```
 
-Install node dependencies:
+Copy new configuration defaults values and update your configuration file:
 
 ```
-$ cd /var/www/peertube/peertube-latest && \
-    sudo -u peertube yarn install --production --pure-lockfile
+$ sudo -u peertube cp /var/www/peertube/versions/peertube-${VERSION}/config/default.yaml /var/www/peertube/config/default.yaml
+$ diff /var/www/peertube/versions/peertube-${VERSION}/config//production.yaml.example /var/www/peertube/config/production.yaml
 ```
 
-Copy new configuration defaults values and update your configuration file:
+Change the link to point to the latest version:
 
 ```
-$ sudo -u peertube cp /var/www/peertube/peertube-latest/config/default.yaml /var/www/peertube/config/default.yaml
-$ diff /var/www/peertube/peertube-latest/config//production.yaml.example /var/www/peertube/config/production.yaml
+$ cd /var/www/peertube && \
+    sudo rm ./peertube-latest && \
+    sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest
 ```
 
+
 Restart PeerTube:
 ```
 $ sudo systemctl restart peertube
@@ -312,6 +330,6 @@ Change `peertube-latest` destination to the previous version and restore your SQ
 $ OLD_VERSION="v0.42.42" && SQL_BACKUP_PATH="backup/sql-peertube_prod-2018-01-19T10:18+01:00.bak" && \
     cd /var/www/peertube && rm ./peertube-latest && \
     sudo -u peertube ln -s "versions/peertube-$OLD_VERSION" peertube-latest && \
-    pg_restore -U peertube -c -d peertube_prod "$SQL_BACKUP_PATH"
+    pg_restore -U peertube -W -h localhost -c -d peertube_prod "$SQL_BACKUP_PATH"
     sudo systemctl restart peertube
 ```