Simple script to migrate content from one Hedgedoc instance to another
Find a file
2022-09-17 11:40:16 +02:00
cypress add minimal working example 2022-09-11 23:01:13 +02:00
pads New json format (snake_case to camelCase) 2022-09-16 23:24:28 +02:00
.gitignore Add script that checks if pad is already moved 2022-09-17 11:40:16 +02:00
cypress.config.js add minimal working example 2022-09-11 23:01:13 +02:00
hedgedoc-image.py New json format (snake_case to camelCase) 2022-09-16 23:24:28 +02:00
hedgedoc-is-moved.py Add script that checks if pad is already moved 2022-09-17 11:40:16 +02:00
LICENSE Initial commit 2022-09-11 22:50:39 +02:00
package-lock.json add minimal working example 2022-09-11 23:01:13 +02:00
package.json add minimal working example 2022-09-11 23:01:13 +02:00
README.md Add ability to specify multiple metapads 2022-09-15 19:31:00 +02:00
requirements.txt Add python extractor 2022-09-14 14:05:29 +02:00

Hedgedoc Migrator

Simple script to migrate content from one Hedgedoc instance to another.

Cypress

Follow the guide over here.

You also require NodeJS. Run npm ci to install the required packages.

Execution

To start cypress, simply execute npx cypress open. Then click E2E Testing and run using electron. This step could be automated using the cypress API.

Python

Create new python venv:

python -m venv venv

Activate the new environment (linux)

source venv/bin/activate

Install the requirements

pip install -r requirements.txt

Execution

Start the extractor

python hedgedoc-image.py --replace new_netloc meta_pad1 meta_pad2 ...

For example:

python hedgedoc-image.py --replace pad.hacknang.de https://md.margau.net/dbk-meta

Produced files

The python scripts produces a pads.json which contains the mapping from old_url to new_url. All images land in images/uploads. Only images hosted on the old_pads URL are saved