Apr. 9th, 2017

Let's say you decided to leave LiveJournal and to migrate to Dreamwidth. You do a full import of your journal to DW and everything looks fine and dandy, but there is one problem: if your LJ posts linked to each other, the import process would not adjust such links, and they still would point to livejournal.com. Clearly unacceptable! I wrote a quick and dirty script to fix that. Details below.

1) Get the ljdump.py script, put it in a directory.

2) In the same directory create a config file, ljdump.config:
<xml>
  <server>https://www.dreamwidth.org</server>
  <username>bluedrag</username>
  <password>password</password>
  <journal>bluedrag</journal>
</xml>
(substitute bluedrag with your own journal name, and password with your password).

3) Still in the same directory, run ljdump.py . It will create a subdirectory with the name of your journal and a full backup of all entries and comments. My script relies on the presence of that backup and the config file (ljdump.config).

4) Save my script to a file (fix_links.py) and run it in the same directory. It will go over your entries (but not comments) and will try to change all links to your livejournal posts (and tags) to the corresponding Dreamwidth links. It will ask before writing every entry back (but if you feel especially bold you can comment out the raw_input line).

Disclaimers: No warranties, and only tested on my journal. But it worked, and I feel great about the result.

Hasta la vista, LJ!

The script (big chunks borrowed from ljdump):

Read more... )
Tags:
Систематизирую свои заметки о маяках. У каждого маяка должен быть один пост в журнале, объединяющий все остальные посвящённые этому маяку заметки.

Маяк Грейвза, охраняющий северные подступы к Бостонской бухте:

Tags:

June 2025

S M T W T F S
123456 7
891011121314
15161718192021
22232425262728
2930     

Expand Cut Tags

No cut tags

Style Credit