Browse files

Add an etherpad migration guide

In this guide I share how a migration from etherpad to codimd can
be done. I am not completely sure if the script that is included is
completely error-free. Readers/reviewers should be aware that there
may be bugs.may be bugs.

Signed-off-by: Daan Sprenkels <>
  • Loading branch information...
dsprenkels committed Nov 10, 2018
1 parent 4e5e7df commit 1f8e8b476feba62df9c61b7ccf5c1c0e61d0bcd6
Showing with 131 additions and 0 deletions.
  1. +131 −0 docs/guides/
@@ -0,0 +1,131 @@
Pad migration guide from etherpad-lite
The goal of this migration is to do a "dumb" import from all the pads in Etherpad, to notes in
CodiMD. In particular, the url locations of the pads in Etherpad will be lost. Furthermore, any
metadata in Etherpad, such as revisions, author data and also formatted text will not be migrated
to CodiMD (only the plain text contents).
Note that this guide is not really meant as a support guide. I migrated my own Etherpad to CodiMD,
and it turned out to be quite easy in my opinion. In this guide I share my experience. Stuff may
require some creativity to work properly in your case. When I wrote this guide, I was using
[Etherpad 1.7.0] and [CodiMD 1.2.1]. Good luck!
[Etherpad 1.7.0]:
[CodiMD 1.2.1]:
## 0. Requirements
- `curl`
- running Etherpad server
- running CodiMD server
- [codimd-cli]
## 1. Retrieve the list of pads
First, compose a list of all the pads that you want to have migrated from your Etherpad. Other than
the admin interface, Etherpad does not have a dedicated function to dump a list of all the pads.
However, the Etherpad wiki explains how to list all the pads by [talking directly to the
You will end up with a file containing a pad name on each line:
## 2. Run the migration
Download [codimd-cli] and put the script in the same directory as the file containing the pad names.
Add to this directory the file listed below, I called it ``. Modify at least the
configuration settings `ETHERPAD_SERVER` and `CODIMD_SERVER`.
# Description: Migrate pads from etherpad to codimd
# Author: Daan Sprenkels <>
# This script uses the codimd command line script[1] to import a list of pads from
# [1]:
# The base url to where etherpad is hosted
# The base url where codimd is hosted
# Write a list of pads and the urls which they were migrated to
# Fail if not called correctly
if (( $# != 1 )); then
echo "Usage: $0 PAD_NAMES_FILE"
exit 2
# Do the migration
for PAD_NAME in $1; do
# Download the pad
curl "$ETHERPAD_SERVER/p/$PAD_NAME/export/txt" >"$PAD_FILE"
# Import the pad into codimd
OUTPUT="$(./codimd import "$PAD_FILE")"
Call this file like this:
./ pad_names.txt
This will download all the pads in `pad_names.txt` and put them on CodiMD. They will get assigned
random ids, so you won't be able to find them. The script will save the mappings to a file though
(in my case `redirects.txt`). You can use this file to redirect your users when they visit your
etherpad using a `301 Permanent Redirect` status code (see the next section).
## 3. Setup redirects (optional)
I got a `redirects.txt` file that looked a bit like this:
date-ideas -> Found. Redirecting to
groceries -> Found. Redirecting to
london -> Found. Redirecting to
weddingchecklist -> Found. Redirecting to
Using some `sed` magic, I changed it to an nginx config snippet:
location = /p/date-ideas {
return 301;
location = /p/groceries {
return 301;
location = /p/london {
return 301;
location = /p/weddingchecklist {
return 301;
I put this file into my `` nginx config, such that all the users would be
redirected accordingly.

0 comments on commit 1f8e8b4

Please sign in to comment.