Some little peertube script changes required for Arch, postgresql, and Node.js updates

Hi all, after some battles on updating Arch and make Peertube again working good, I did found some little things that may be of interest for some of you:

  1. postgresql: version change from 15 to 16 requires you upgrade your databases, so it is suggested you have a pg_dumpall already done before making the upgrade, to make things smoother after (you need move data to dataold and init data directory again before restore your backup)

if you are on peertube 6.1 (6.3 is fine) and you are updating nodejs: 2) Updating Node.js: some functions have been REMOVED, so you’ll find your peertube service stopping to start and you need to edit node_modules/config/lib/config.js

  function _clone(parent, depth) {
+    const util = require('util');

1008

-    } else if (Utils.isRegExp(parent)) {
+    } else if (parent instanceof RegExp) {

1011

-    } else if (Utils.isDate(parent)) {
+    } else if (util.types.isDate(parent)) {

1039

-      } else if (util.isPromise(parent[i])) {
+      } else if (util.types.isPromise(parent[i])) {

The above did let me have again the instance up and SEEMS all ok, but dunno if this suffice or other parts of the code habe to be updated too…

Hello,

Postgresql update should be handled using the relevant postgresql commands (pg_upgradecluster and so on).
Here is a documentation (unfortunatly in french, but you should be able to easily find an english version): Migration d’une versio... | Wiki Fiat tux

You should never change code in the node_modules directory. Those are dependencies, that are installed using yarn.
Maybe running the Peertube build script after upgrading would be enough.

What’s your NodeJS version?
It is not normal that such functions were removed. It is more likely that you have a missing dependency.

The node functions were deprecated and 23.3.0 version of nodejs has removed them, thus the script stopped to work if you have this version of nodejs in your system

About postgresql, yes there are procedures at the scope, in my case the backup/restore was the seamless one but it depends much on which system and situation you have inside your machine.

I tried at first to run the peertube upgrade script but it failing because some package version were missing, so I went for a Syu before retry, also because it was some time I wanted do that and did taken the opportunity with the peertube version upgrade. :innocent:

Have updated OP to specify it is only a 6.1 issue, as 6.3 is fine and as you pointed, don’t need changes :+1: