From e1ab52d7ec7370a6f9f5937192d6003206af1ac0 Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Tue, 9 Nov 2021 11:05:35 +0100 Subject: Add migrate-to-object-storage script (#4481) * add migrate-to-object-storage-script closes #4467 * add migrate-to-unique-playlist-filenames script * fix(migrate-to-unique-playlist-filenames): update master/segments256 run updateMasterHLSPlaylist and updateSha256VODSegments after file rename. * Improve move to object storage scripts * PR remarks Co-authored-by: Chocobozzz --- support/doc/tools.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'support/doc/tools.md') diff --git a/support/doc/tools.md b/support/doc/tools.md index 78ace1344..c8cc2d1d7 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md @@ -17,6 +17,7 @@ - [regenerate-thumbnails.js](#regenerate-thumbnailsjs) - [create-transcoding-job.js](#create-transcoding-jobjs) - [create-import-video-file-job.js](#create-import-video-file-jobjs) + - [create-move-video-storage-job.js](#create-move-video-storage-jobjs) - [prune-storage.js](#prune-storagejs) - [update-host.js](#update-hostjs) - [reset-password.js](#reset-passwordjs) @@ -303,6 +304,33 @@ $ cd /var/www/peertube-docker $ docker-compose exec -u peertube peertube npm run create-import-video-file-job -- -v [videoUUID] -i [videoFile] ``` +### create-move-video-storage-job.js + +Use this script to move all video files or a specific video file to object storage. + +```bash +$ # Basic installation +$ cd /var/www/peertube/peertube-latest +$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-move-video-storage-job -- --to-object-storage -v [videoUUID] + +$ # Docker installation +$ cd /var/www/peertube-docker +$ docker-compose exec -u peertube peertube npm run create-move-video-storage-job -- --to-object-storage -v [videoUUID] +``` + +The script can also move all video files that are not already in object storage: + +```bash +$ # Basic installation +$ cd /var/www/peertube/peertube-latest +$ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-move-video-storage-job -- --to-object-storage --all-videos + +$ # Docker installation +$ cd /var/www/peertube-docker +$ docker-compose exec -u peertube peertube npm run create-move-video-storage-job -- --to-object-storage --all-videos +``` + + ### prune-storage.js Some transcoded videos or shutdown at a bad time can leave some unused files on your storage. -- cgit v1.2.3