Skip to content
Snippets Groups Projects
Commit 9f8b5719 authored by Andreas Domanowski's avatar Andreas Domanowski
Browse files

Revamp readme

parent 9bb86577
No related branches found
No related tags found
1 merge request!1Hedgedoc import
````
WARNING - Use this script at your own discretion. It's a prototype and not exhaustively tested and might throw HTTP errors that were not encounted for.
````
# CodiMD Note Exporter + Hedgedoc Note Importer # CodiMD Note Exporter + Hedgedoc Note Importer
This little tool is intended to help you **backup** the notes that your CodiMD history shows to a local folder. This little tool is intended to help you **backup** the notes that your CodiMD history shows to a local folder.
...@@ -33,10 +37,10 @@ If you only want to export your visited documents and import them manually, just ...@@ -33,10 +37,10 @@ If you only want to export your visited documents and import them manually, just
- Go to https://md.inf.tu-dresden.de/ - Go to https://md.inf.tu-dresden.de/
- Click on your username in the upper right and hit "*Export user data*" - Click on your username in the upper right and hit "*Export user data*"
- Download the file "archive.zip" and place it in the same folder as this file (README.md) - Download the file "archive.zip" and place it in the same folder as this file (README.md)
- **Weed the archive out**! Most likely, it will contain a lot of unused or empty documents. Delete those files in place - **Weed your archive out**! Most likely, it will contain a lot of unused or empty documents. Delete those files in
in the archive, don't extract them. place in the archive, don't extract them.
### 2. Extract the value of your CodiMD session cookie ### 2. Extract the Value of Your Codimd Session Cookie
To ensure that the script can access the documents you accessed in our CodiMD instance, you need to extract the value of To ensure that the script can access the documents you accessed in our CodiMD instance, you need to extract the value of
the `connect.sid` browser cookie for the the `connect.sid` browser cookie for the
...@@ -56,27 +60,27 @@ Now, the instructions are similar for Chrome and Firefox: ...@@ -56,27 +60,27 @@ Now, the instructions are similar for Chrome and Firefox:
5. In the list, search for a cookie with the name `connect.sid` 5. In the list, search for a cookie with the name `connect.sid`
6. Select and copy the value. It must start with the character sequence `s%3A`. 6. Select and copy the value. It must start with the character sequence `s%3A`.
### 3. Extract the value of your HedgeDoc session cookie ### 3. Extract the Value of Your Hedgedoc Session Cookie
Follow the instructions from step 2, but copy the value of the cookie key `connect.hedgeDoc.sid` Follow the instructions from step 2, but copy the value of the cookie key `connect.hedgeDoc.sid`
### 4. Execute the script via the command line ### 4. Execute the Script via the Command Line
Execute `./md-import-export.py` or `python3 md-import-export.py` in a Execute `./md-import-export.py` or `python3 md-import-export.py` in a
shell. The script will ask for your session ids and download the notes you visited to the relative path shell. The script will ask for your session IDs and download the notes you visited to the relative
`./codimd-documents`. path `./codimd-documents`.
Please note that your CodiMD history might reference already deleted notes or notes you no Please note that your CodiMD history might reference already deleted notes or notes you no
longer have access to. The URLs of these inaccessible notes are listed as part of the longer have access to. The URLs of these inaccessible notes are listed as part of the
output of the script. output of the script.
Furthermore, the script tries to upload every file with a `.md` extension to our HedgeDoc instance. Furthermore, the script tries to upload every file in the archive with a `.md` extension to our HedgeDoc instance.
### 5. Visit the Uploaded Documents to Make Them Appear in Your Hedgedoc History ### 5. Visit the Uploaded Documents to Make Them Appear in Your Hedgedoc History
Uploading the documents is not enough to make them appear in your HedgeDoc history. Uploading the documents is not enough to make them appear in your HedgeDoc history.
You need to visit them at least once to make them available. You need to visit them at least once to make them available.
The script automatically generates a file `history_scripts/hedgedocu_documents_to_visit.url`. The script automatically generates a file `history_scripts/hedgedocu_documents_to_visit.url`.
You can either visit every file manually or execute the bash script `history_scripts/visit_migrated_documents.sh`. You can either visit every file manually or execute the bash script `history_scripts/visit_migrated_documents.sh` (Unix & MacOS).
This script will ask you for a browser to open the documents and then open them in batches of 50 URLs. Feel free to contribute a Batch-Script for Windows environments.
Be aware: this might be pretty resource intensive and might take a while. Be aware: this might be pretty resource intensive and might take a while.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment