Upgrading peertube to 6.0.1

Originally posted at: https://eijil.com/t/upgrading-peertube-from-5-2-1-to-6-01/476

According to the changelog, upgrading peertube requires manually modifying some configuration files, first and formost, you need to upgrade nodejs to version 18.

Run the script

After you upgrade nodejs to version 18, run the upgrade script listed in the official upgrade doc.

cd /var/www/peertube/peertube-latest/scripts && sudo -H -u peertube ./upgrade.sh
sudo systemctl restart peertube # Or use your OS command to restart PeerTube if you don't use systemd

One the above script finished running, you’ll need to manually modify some configuration files.

I’m using notepad++ with the plugin Compare to help me with the job.

Make sure to back up files before starting this task!

Change the production.yaml

The first file you need to modify manually is the new production.yaml.example which is located in /var/www/peertube/versions/peertube-v6.0.1/config, you’ll use the new file to overwrite the old one which is located in /var/www/peertube/config named production.yaml.

Download the new config file from the VPS and rename the new file production.yaml.example to 6.0.1.yaml and the old production.yaml to 5.2.1.yaml, this is not mandatory but is recommended to avoid confusion when modifying files later on.

Open both files with notepad++. Then click Plugins->Compare->Compare:

Notepad++ will display the two files side by side on the screen, and highlight the differences.

The new file is on the left side, which is the one you’ll be editing, and the old configuration file is on the right side. You’ll need to transfer some of the configuration information from the old file into the new one.

The things you need to change are related to your Peertube instance, such as domain name, keys, database details, redis, domain certificates etc. Be really careful during this process and double-check everything.

Once the old config infos were seccessfully migrated, rename the folder:

sudo -u peertube mv '/var/www/peertube/storage/videos/' '/var/www/peertube/storage/web-videos/'

Since the folder name has been changed in the new production.yaml(6.0.1.yaml), so we need to change it manually.

Save the new file 6.0.1.yaml as production.yaml, upload and overwrite the old one(remember to make a back up!) located in /var/www/peertube/config

Pay attention to the file’s ownership. If it’s not already set to peertube, you can change it by running the command chown peertube production.yaml

Change the nginx file

This step is similar to the previous one, so I won’t repeat it. Just fill in the old configuration details into the new Nginx config file, and make sure to check it several times for accuracy! Make a back up before you overwrite the file.

Restart everything

That’s it! Now, all we need is to restart everything. You can simply reboot the server, or you can restart peertube and nginx manually:

sudo systemctl reload nginx
sudo systemctl restart peertube

If anything goes wrong, look into the log by running sudo journalctl -fu peertube

Leave a reply:

Your email address will not be published.