Export Zinna - Import Mezzanine

Posted by: scoopseven 11 years, 1 month ago

I've looked for a decent django blog platform for quite a while before finding Mezzanine a couple of months ago. I finally switched over my stack to Ubuntu upgraded to Django 1.4 and started running Mezzanine. So far, so good.

If anyone is looking for a quick and dirty migration script to move from Zinnia to Mezzanine, here it is in straight SQL:

# Categories
insert into mezzanine_db.blog_blogcategory (id, site_id, title, slug)
select id, '1', title, slug from zinnia_db.zinnia_category;

# Entries/Posts
insert into mezzanine_db.blog_blogpost (id, site_id, title, slug, description, gen_description, status, publish_date, in_sitemap, content, user_id, allow_comments)
select id, '1', title, slug, excerpt, '1', '2', creation_date, '1', content, '1', '0' from zinnia_db.zinnia_entry;

# Category->Post Relationships
insert into mezzanine_db.blog_blogpost_categories (id, blogpost_id, blogcategory_id)
select id, entry_id, category_id from zinnia_db.zinnia_entry_categories;

As long as you migrate the existing ids, this works perfectly. There's also a gist, in case anyone wants to fork it.

Current rating: 5


Recent Tweets

Recent Posts

Archive

2013
2012
2011
2010
2009
2008
2007
2006

Categories

Authors

Feeds

RSS / Atom