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 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!
curl
First, compose a list of all the pads that you want to migrate from your Etherpad. Other than the admin interface, Etherpad does not have a dedicated function to dump a list of all pads. However, the Etherpad wiki explains how to list all the pads by talking directly to the database.
You will end up with a file containing a pad name on each line:
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 migrate-etherpad.sh
. Modify at least the configuration settings ETHERPAD_SERVER
and CMD_CLI_SERVER_URL
.
Call this file like this:
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).
I got a redirects.txt
file that looked a bit like this:
Using some sed
magic, I changed it to an nginx config snippet:
I put this file into my etherpad.example.com
nginx config, such that all the users would be redirected accordingly.
CodiMD
Docs