Ask Your Question

Sage upgrade from 5.11 (RedHat Server)

asked 2020-10-05 22:22:20 +0100

Razor3468 gravatar image

updated 2020-10-05 22:38:07 +0100

So i will start off by saying that I am a complete novice when it comes to Sage. The current server has been handed off to me, the individual who originally built it is no longer around (naturally), and I have been assigned to install the latest version of sage on new server (RedHat 8 VM). I will note that the current version of Sage (5.11) is running on RedHat 6.10

Now my troubles begin. I have the new VM deployed, downloaded the prebuilt binary (sage-9.1-Debian_GNU_Linux_10-x86_64.tar.bz2) to the server and extracted it, and started sage. The first issue i'm having, is it seems in the past a service has been setup to automatically start on boot/startup, and the users browse to server via the FQDN and port number (as in ""), and they are greeted with the "Sage NoteBook" login screen. I have no idea how to get sage to start on this server, where I can simply browse to the server's FQDN and access the page?

Second issue, lets say by some miracle I can get the web working perfectly, how can I import all the users and data from the original server, to this new instance?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-10-05 23:58:23 +0100

slelievre gravatar image

updated 2020-10-06 18:40:37 +0100

The server you have been handed is running a SageNB server. This only runs with Python 2.

Prebuilt binaries for Sage 9.1 are based on Python 3, and cannot be used for running a SageNB server.

There are a few choices to make. The first choice is between

  • install a SageNB server
    • pros:
      • will look familiar to users who have worked with it so far
      • has some nice features still missing on the Jupyter side
    • cons:
      • no longer maintained
      • only works with Python 2 whose end of life was 2020-01-01
      • only works with Sage <= 9.1; will not work with Sage >= 9.2
  • install a JupyterHub server or a CoCalc server
    • pros:
      • maintained
      • good installation instructions and help channels exist
      • will work for the foreseeable future
    • cons:
      • cost of migration for users
        • learn new interface
        • migrate existing worksheets
      • some SageNB features still missing

If you really want to install a SageNB server, choose between

  • port SageNB (and its dependencies) to Python 3 (just kidding)
  • build Sage 9.0 or 9.1 from source, configuring with `--with-python=2``
  • use Sage 8.9 binaries, which are based on Python 2
  • use Sage as provided by Fedora's package manager rpm

In case you use binaries, since your server is running RedHat, prefer Fedora binaries to Debian binaries.

I cannot answer your second question as I have never dealt with migrating user data across SageNB versions. Maybe there is nothing to do.

Note that when you install Sage <= 8.9 based on Python 2, sagenb is a standard package, so it gets installed as part of installing Sage.


If you install Sage 9.0 or 9.1 based on Python 2, sagenb has become an optional package, see

so after building Sage you would run sage -i sagenb to install SageNB.

If you are installing SageNB, maybe start by upgrading to Sage 8.9 in order to keep things a little simpler.

edit flag offensive delete link more


I had a feeling this wasnt going to be a simple upgrade. So just to make sure I understand correctly, this "notebook" feature that is accessed via the URL is not included with the base download from I did some searching and this seems to be the github for SageNB, maybe you can correct me if im wrong!

Looking at the original server, I dont see directory structures that resemble this. Just the base "sage-5.4.1" folder (guessing the original admin did upgrades to 5.11 after the fact?) and a "sage_notebook.sagenb" folder. The "sagenb" folder does contain a "home" directory, a "twistedconf.tac" file, and few files with...a .pickle extension? When browsing to the old server's URL, it displays "The Sage Notebook Version 5.11"

Razor3468 gravatar imageRazor3468 ( 2020-10-06 14:58:56 +0100 )edit

May I suggest to query the (former) users of the old Sage NB server if keeping their files in executable form is of importance...

I secon slelievre's advice, and add that installing a Sage-NB server is probably a dead end : you'd be kicking the can down the road ... a little. Sage moves at a phenomenal pace currently, and you'd be stranded with an ever-obsolescing version...

Is the (old) server still accessible ? If so, ISTR that there existed ways to dump those files in (human(?)-)readable form, which could be used to preserve them somehow.

I'd suggest to query the sage-devel list or the sage-cocalc list, where long-time developpers and users abound, susceptible to giving you a better advice than I can.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2020-10-06 16:30:45 +0100 )edit

A possible workaround would be to install a temporary NB-able server (i. e. 8.9) on a low-cost, low-performance spare machine (or a VM), with one allowed use : allow users to dump their old SageNB files to Jupyter format. These files could be then moved/uploaded to the new server by the users.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2020-10-06 16:38:13 +0100 )edit

Thanks for the tip Emmanuel! I will have to inquire further about how reasonable it is to start from scratch with the new version. Since the current version is so old, it seems like it could be quite the pain to get it moved over. I'm trying to compile Sage 9.1 on my RHEL 8 server now (using python 2), but it keeps failing saying that im missing about 46 packages, of which I cannot find a repo for RedHat 8 that has them. Guess im stuck with the per-built binaries with that. To answer your question though, the old server IS still accessible, and I see a "Home" directory with multiple user directories under it. Im not sure how this could be migrated to the new version though, specially considering the jump from 5.11 to 9.1

Razor3468 gravatar imageRazor3468 ( 2020-10-06 17:54:00 +0100 )edit

If you can set up a spare machine (or VM), you may try to setup a sage 9.1 server (Python 3) and use it to test the ability of users to convert their old notebook files to Jupyter files. If this works, you are out of the woods : setup a "main" 9.1 Python 3 server, and leave to your users the responsibility of converting them. This and this may be relevant. Your users' files may be in their home directories. Check with them !

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2020-10-06 21:27:45 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-10-05 22:21:03 +0100

Seen: 235 times

Last updated: Oct 06 '20