Ask Your Question
1

How can I retrieve sage worksheets from old hard drive

asked 2019-03-29 16:59:35 +0200

David E. Roberson gravatar image

Recently, my computer (a Macbook Pro) stopped working suddenly. I have now replaced it with a newer Macbook Pro, and I would like to get my sage worksheets from my previous computer onto my new one. The drive on the old computer is fine and I have access to everything on it, but I do not know where the sage worksheets are stored. According to this: https://ask.sagemath.org/question/865... they should be in the directory ~/.sage/sage_notebook.sagenb/home/. I have copied the .sage directory from my old hard drive to my new one. Inside there is indeed a directory called sage_notebook.sagenb and inside that there is a directory called home. Inside home is a folder named __store__, and then three shortcuts (I think they are shortcuts, they are little folders with arrows in the bottom left corner) named admin, guest, and pub. Both guest and pub are empty. The contents of __store__ are mostly inscrutable. There are essentially three possible paths one can take:

/__store__/0/08/084/084e/guest/ which is empty

/__store__/3/3a/3a2/3a21/pub/ which is empty

/__store__/2/21/212/2123/admin/ which is filled with folders 0 through 34 and a file called history.pickle

Inside each of the folders labeled 0 through 34 are two folders named cells and data and two files named worksheet_conf.pickle and worksheet.html. The data and cells folders are sometimes empty but other times data contains some of my .sobj files and cells contains one or many folders labelled by seemingly random numbers. Inside these folders are files of various types, I think I have seen .sobj, .png, and .txt files so far.

What do I do so that when I run notebook() in a sage terminal and it opens up a browser window with all of my worksheets listed I will be able to see the worksheets that I had on my previous computer?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-04-06 12:53:05 +0200

slelievre gravatar image

updated 2019-04-08 23:18:05 +0200

If no new worksheets have been created in your new computer, just copy the whole ~/.sage folder from your old computer to your new computer.

Otherwise you could

  • from the SageNB, download each of your "new worksheets" , e.g. your Downloads folder
  • quit the SageNB and quit Sage
  • backup your current ~/.sage (say as ~/dot-sage-backup), for example by typing in a terminal

    $ mv ~/.sage ~/dot-sage-backup
    
  • copy the old .sage from your former computer to your home folder

  • then start the SageNB notebook and upload your new worksheets to it

Hopefully this goes well.

This could also be the opportunity to migrate all your SageNB worksheets (old and new) to Jupyter notebook worksheets and to start using the Jupyter notebook.

edit flag offensive delete link more

Comments

Unfortunately I have already created some new worksheets.

David E. Roberson gravatar imageDavid E. Roberson ( 2019-04-07 11:24:59 +0200 )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

Stats

Asked: 2019-03-29 16:59:35 +0200

Seen: 299 times

Last updated: Apr 08 '19