Upgrading superdesk
  • Hi,

    what are the steps for upgrading superdesk? I have an instance 1.14 which I assume is ready for an upgrade (or three)


    Post edited by Trond Husø at 2020-03-13 07:09:50
  • 15 Comments sorted by
  • hi,

    there is also redis but you don't have to backup that one.

    that update description looks ok, on client you might run also npm upgrade after npm install, depends on the npm version if that's needed or not, but won't do any harm.

  • yes redis is for cache/notifications, you can skip that.

    it would be wise to backup mongo, you can restore elastic from there if needed.

  • it should be:

    cd /opt/superdesk

    . activate.sh

    honcho run python manage.py app:index_from_mongo --all
  • No answer here, so will use this post to log what I am doing. Today I backed up mongodb and I am planning on doing the same with elastic. 
    Are there any other databases involved in Superdesk?

    There is an update-description here I am planning on running, but must be sure I can undo any wrong-doings (rollback).

    Post edited by Trond Husø at 2020-05-06 04:31:01
  • Vote Up0Vote Down RobertBRobertB
    Posts: 42Member
    Dear Petr,
    is there any instructions how to install superdesk on fresh Ubuntu Server 20.04 LTS?
  • Hi Petr, thanks for responding.

    redis is more for session control I guess. That is at least what many use it for.

    Would it be safe just to run the update, or would it be wise to backup mongo + elastic (anyone following know how to backup elastic?)


  • petr, 
    Is restoring elastic something Superdesk does automatically, or is it a manual process?

    To sum up:
    1) Backup mongodb (mongodb dump)


    source /opt/superdesk/activate.sh
    cd /opt/superdesk
    git pull

    cd /opt/superdesk/server
    pip install -U -r requirements.txt
    ./manage.py data:upgrade
    ./manage.py app:initialize_data

    cd /opt/superdesk/client
    npm install
    npm update
    grunt build

    systemctl restart superdesk
    Post edited by Trond Husø at 2020-05-12 17:05:03
  • It is not straight forward to upgrade. I will use this comment to add my findings.

    First my version of mongodb was 3.2 and Superdesk requires 3.4+. So a new install had to be done.

    You can more or less use these commands:

    https://medium.com/mongoaudit/how-to-upgrade-mongodb-to-latest-stable- version-9607266834cf:
    sudo rm /etc/apt/sources.list.d/mongodb*.list
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv
    echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
    sudo apt-get update
    sudo apt-get install -y mongodb-org 

    After upgrading MongoDb, you need to use this command:

    db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } ) 

    Python did more or less go as expected, but there were some errors there as well. I haven't logged it (or I did, but my forum session was dropped and so I lost it).

    Node was another showstopper. The version I had was to old and needed an upgrade. But which version to upgrade to wasn't clear, so I used the latest. It seems to me as that version was to new for Superdesk.

    npm install

    This command resulted in a lot of deprecated versions of the installed packages. It continued to failing running the main install as well.

    A suggestion was to add -g at the end.

    npm update -g

    Adding -g at the end of the command on update did the trick I think.

    After running node update -g I came to grunt build. That one caused other issues, like not finding the superdesk-grunt file under superdesk-core . Checked under src/superdesk-core, but it wasn't there.

    It might be that my version of Superdesk was/is too old for an upgrade. Petr, if you have any suggestions, I am open for any solution.

    Is there a way to install a new version and import the data from the old version?

    Post edited by Trond Husø at 2020-05-13 02:28:48
  • Trying to install new version on new server. Seeing this error after using ubuntu 18.04.4 LTS

    ERROR: requests-oauthlib 1.3.0 has requirement oauthlib>=3.0.0, but you'll have oauthlib 2.1.0 which is incompatible.
    ERROR: eve 0.7.8 has requirement werkzeug<=0.11.15,>=0.9.4, but you'll have werkzeug 0.16.1 which is incompatible.
    ERROR: wooper 0.4.2 has requirement requests==2.3.0, but you'll have requests 2.23.0 which is incompatible.
  • After install I have now restored mongodb. 

    How do I restore the index in elastic?

  • To Index elastic search from mongo you have to run the following command - as Petr has written above. If you are on a clean ubuntu installation, you might not have installed pip and so you shall do:

    apt install python-pip

    then run:
    pip install honcho

    then you can run from the /opt/superdesk/server directory:

    honcho run python manage.py app:index_from_mongo --all

    I did how ever get this error when I tried:

    Traceback (most recent call last):
      File "manage.py", line 14, in <module>
        import superdesk
    ImportError: No module named superdesk

    The solution to this error is the following:

    source /opt/superdesk/activate.sh
    cd server
    honcho run python manage.py app:index_from_mongo --all

    I picked up this error or warning:
    manage.py:15: ExtDeprecationWarning: Importing flask.ext.script is deprecated, use flask_script instead.
      from flask.ext.script import Manager

    Post edited by Trond Husø at 2020-05-14 09:27:37
  • When testing Superdesk installation, I can see some desks missing. I am therefor wondering - where are those stored? I did a dump of mongodb.

    Never mind. It is my user that is now set as admin only and not a journalist/Author. So admin is not seeing it (but will when I change this setting).

    I also needed to add myself to a desk. So all is good.
    Post edited by Trond Husø at 2020-05-15 05:46:02
  • Petr (or others at SourceFabric):

    What is your recommended upgrade / keeping up to date with latest changes and such? Is it as we started out with? Do this:

    source /opt/superdesk/activate.sh
    cd /opt/superdesk
    git pull

    cd /opt/superdesk/server
    pip install -U -r requirements.txt
    ./manage.py data:upgrade
    ./manage.py app:initialize_data

    cd /opt/superdesk/client
    npm install
    npm update
    grunt build

    systemctl restart superdesk
    Post edited by Trond Husø at 2020-05-15 05:47:32
  • I've had reasonable success with reinstalling superdesk by simply deleting the folder it is installed in and starting over as well. As long as the DB is left alone and pointed to the same way after installation, all data has repopulated for me. Of course, you always want to maintain backups anyway.

    I should point out, I did this one day in frustration because I did not want to do everything again.
    Post edited by Bryan Garland at 2020-05-27 09:39:17
  • nice, Bryan. Thanks for the feedback.