You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

How to do a blog backup:

1.) Make sure you have Apache Ant and a Subversion client installed and its bin directory added to your system classpath.

2.) We'll be using the "blogbackup" example in the Blogapps project (based originally on the source code from the RSS and Atom in Action book) to do a Roller backup. Do an SVN checkout of the examples:

svn co https://svn.java.net/svn/blogapps~svn/trunk/examples/java blogutils

3.) In src/org/blogapps/blogbackup/blogbackup.java, place in the following line at line #43. It will skip any blog entries in draft status (i.e., those that haven't been published yet), avoiding an NPE two lines later in the code. (There's a JIRA item pending to make this change to the SVN trunk.)

BlogEntry entry = (BlogEntry)entries.next();
Date pubDate = entry.getPublicationDate();
if (pubDate == null) continue; <-- add this line
SimpleDateFormat format8 = new SimpleDateFormat("yyyyMMdd-HHmm");
String dateString = format8.format(pubDate);

4.) cd back to blogutils/blogbackup, read and follow the README.html to run the backup. The README will tell you to modify the blogbackup/dist/config.properties file to point to your blog. For reference, if you're hosted on JRoller, configuration similar to the below will apply:

download_dir=./saved
blog_apitype=metaweblog
blog_username=bobsmith <--- use your Roller login ID
blog_password=xxxxxxxxxxx
blog_id=bobsmith <--- for a URL like http://www.jroller.com/bobsmith (frequently same as username).
blog_url=http://www.jroller.com/roller-services/xmlrpc
max_entries=1000

Note: This process saves blog entry text only (in the ./saved folder as configured above, one HTML file per blog entry). Attachments (PNGs, GIFs) and any Roller CSS/template customizations will need to be backed up manually.

  • No labels