Posts for the month of November 2006
The new blog is ready!
So I have now competed moving all my stuff from the bblog engine to trac.
To inaugurate the new blog, my notes on how I did it:
- By hand, slowly copied and tagged every entry. Made sure the page name was the proper date (ignored timestamp) from the old system.
- Wrote a script to fool trac into thinking the pages were actually written on that date (see below).
- In the directory with
trac.db
database:apachectl stop
sqlite3 trac.db '.dump wiki' > wiki_in.txt
./trac_blog_datefix.pl < wiki_in.txt > wiki_out.txt
sqlite3 trac.db 'drop table wiki'
sqlite3 trac.db < wiki_out.txt
apachectl start
The script:
#!/usr/bin/perl -w use Date::Parse; while (<>) { if ($_ !~ /insert into/i) { print; next; } if (m|(\d{4}/\d{1,2}/\d{1,2})/|ios) { print STDERR "Found date of $1: "; my $time1 = str2time($1); print STDERR $time1, "\n"; # Now replace the current timestamp with a newone. my $str = $_; $str =~ s/\d{10}\.?\d{0,2}/$time1/; print $str; } else { # Standard wiki page (non-blog) print; } }