# backup method?

**URL:** <https://talk.observablehq.com/t/backup-method/1628>\
**Category:** Help\
**Created:** [January 31, 2019, 1:58pm UTC](https://talk.observablehq.com/t/backup-method/1628 "2019-01-31T13:58:31Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![bgchen](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/bgchen/32/784_2.png) [@bgchen](https://talk.observablehq.com/u/bgchen)\
**Post date:** [February 19, 2019, 6:40pm UTC](https://talk.observablehq.com/t/backup-method/1628/14 "2019-02-19T18:40:37Z")

</div>

Thanks so much for sharing this! I had never looked at this sort of thing before so I’ve learned a ton. Here’s a very rough modification of your code that prompts for username+password+2FA (if necessary) and can perform simple notebook download / upload:

> <https://gist.github.com/bryangingechen/9d86f1e5ec01674a32dd9c54bdc13947>

This is very much beginner code, so feel free to suggest changes or improvements!

It seems that you can upload a full notebook using the `/document/new` endpoint, so that’s what I went with. Though the `edit` websocket has been pretty fun to play around with too…

**Edit** : Here’s a utility script which takes a downloaded notebook JSON file and outputs a new file where the cells are reindexed so that they go from 0,1,… to # cells - 1.

> <https://gist.github.com/bryangingechen/90e9c5cc453c16014b431e0b8bcd90c6>

---

_[View the full topic](https://talk.observablehq.com/t/backup-method/1628)._
