def migrate_posts_to_articles():
    from django.core.files import base
    from articles.models import Article, Image
    from blog.models import Post

    for p in Post.objects.all():
        a = Article()

        a.author = p.author
        a.body = p.body
        a.enable_comments = p.enable_comments
        a.pubdate = p.pubdate
        a.reviewed = p.reviewed
        a.title = p.title

        a.save()

        if p.status:
            a.status = 'p'
        else:
            a.status = 'd'

        for pi in p.image_set.all():
            ai = Image()

            ai.article = a
            ai.image = base.ContentFile(pi.image.read())
            ai.reviewed = pi.reviewed
            ai.shortuuid = pi.shortuuid
            ai.status = pi.status
            ai.thumbnail = pi.thumbnail
            ai.title = pi.title

            ai.save()

@@ -30,47 +30,8 @@
 ():%0A
-    from django.core.files import base%0A
     
@@ -69,15 +69,8 @@
 icle
-, Image
 %0A   
@@ -125,32 +125,162 @@
 .objects.all():%0A
+        try:%0A            Article.objects.get(shortuuid=p.shortuuid)%0A            continue%0A        except Article.DoesNotExist:%0A    
         a = Arti
@@ -281,25 +281,28 @@
 = Article()%0A
-%0A
+    
         a.au
@@ -325,16 +325,20 @@
         
+ 
+   
 a.body =
@@ -345,16 +345,88 @@
  p.body%0A
+            a.changed = p.changed%0A            a.created = p.created%0A    
         
@@ -463,16 +463,59 @@
 omments%0A
+            a.kind = Article.KIND_BLOG%0A    
         
@@ -536,16 +536,20 @@
 pubdate%0A
+    
         
@@ -584,197 +584,645 @@
     
-a.title = p.title%0A%0A        a.save()%0A%0A        if p.status:%0A            a.status = 'p'%0A        else:%0A            a.status = 'd'%0A%0A        for pi in p.image_set.all():%0A            ai = 
+    a.shortuuid = p.shortuuid%0A            a.slug = p.slug%0A            a.status = Article.STATUS_PUBLISHED if p.status else Article.STATUS_DRAFT%0A            a.title = p.title%0A            a.uuid = p.uuid%0A            a.save()%0A%0A%0Adef migrate_post_images_to_article_images():%0A    from django.core.files import base%0A    from articles.models import Article, Image as ArticleImage%0A    from blog.models import Post, Image as PostImage%0A%0A    for pi in PostImage.objects.all():%0A        try:%0A            a = Article.objects.get(%0A                kind=Article.KIND_BLOG, shortuuid=pi.post.shortuuid)%0A            try:%0A                ai = Article
 Image()%0A
 %0A   
@@ -1217,17 +1217,20 @@
 Image()%0A
-%0A
+    
         
@@ -1248,16 +1248,100 @@
 cle = a%0A
+                ai.changed = pi.changed%0A                ai.created = pi.created%0A    
         
@@ -1401,16 +1401,20 @@
         
+ 
+   
 ai.revie
@@ -1423,32 +1423,62 @@
 d = pi.reviewed%0A
+                ai.save()%0A    
             ai.s
@@ -1509,24 +1509,28 @@
             
+  
+  
 ai.status = 
@@ -1539,16 +1539,20 @@
 .status%0A
+    
         
@@ -1591,24 +1591,28 @@
             
+  
+  
 ai.title = p
@@ -1619,16 +1619,49 @@
 i.title%0A
+                ai.uuid = pi.uuid
 %0A       
@@ -1653,30 +1653,34 @@
 pi.uuid%0A            
+    
 ai.save()%0A
@@ -1659,28 +1659,143 @@
 d%0A                ai.save()%0A
+            except IOError, e:%0A                print e%0A        except Article.DoesNotExist, e:%0A            print e%0A

Update post -> article migration script, include all fields