3

The Django CMS app Aldryn blog is deprecated since 2015, and replaced by Aldryn newsblog.

What is the optimal way to update from aldryn-blog to aldryn-newsblog (Django 1.6.11 compatible)? The ultimate goal is to be able to update our Django system from 1.6.1x to 1.7.y

  • How can aldryn-blog entries be migrated to aldryn-newsblog?
  • How can aldryn-newsblog leads be made HTML compatible?
  • What is the best succession of updates to go from Django 1.6.x to Django 1.7.y and migrating from aldryn-blog to aldryn-newsblog?

Details of our current setup

requirements.txt:

--extra-index-url https://divio:wlkdjeorijlerf@pkg.divio.ch/simple/
--extra-index-url https://devpi.divio.ch/divio/all/+simple/
aldryn-apphooks-config==0.2.7
aldryn-blog==0.4.6
aldryn-boilerplates==0.7.4
aldryn-categories==1.0.2
aldryn-common==0.1.4
aldryn-faq==1.0.5
aldryn-gallery==0.2.1
aldryn-newsblog==1.2.1
aldryn-people==1.2.0
aldryn-reversion==1.0.8
aldryn-search==0.2.11
aldryn-translation-tools==0.2.1
argparse==1.2.1
cmsplugin-plaintext-djangocms3==0.2.1
dill==0.2.4
Django==1.6.11
django-admin-sortable==2.0.15
django-admin-sortable2==0.6.3
django-appconf==1.0.2
django-appdata==0.1.5
django-ckeditor==4.4.7
django-classy-tags==0.7.2
django-cms==3.0.15
django-countries==3.3
django-crispy-forms==1.5.1
django-filer==1.2.0
django-haystack==2.4.1
django-hvad==1.5.0
django-meta==0.3.1
django-meta-mixin==0.2.1
django-mptt==0.6.1
django-parler==1.6.2
django-phonenumber-field==1.1.0
django-polymorphic==0.8.1
django-reversion==1.8.4
django-sekizai==0.9.0
Django-Select2==4.3.1
django-sortedm2m==1.0.2
django-spurl==0.6.4
django-standard-form==1.1.4
django-taggit==0.11.2
django-treebeard==4.0
djangocms-admin-style==1.1.0
djangocms-column==1.4
djangocms-file==0.0.2
djangocms-flash==0.0.3
djangocms-googlemap==0.1.0
djangocms-inherit==0.0.2
djangocms-installer==0.5.4
djangocms-link==1.4.0
djangocms-picture==0.0.4
djangocms-snippet==1.5
djangocms-style==1.4
djangocms-teaser==0.0.2
djangocms-text-ckeditor==2.3.0
djangocms-video==0.0.2
factory-boy==2.5.2
fake-factory==0.5.3
html5lib==0.9999999
lockfile==0.10.2
mock==1.3.0
pandas==0.16.2
phonenumbers==7.3.1
phonenumberslite==7.3.1
Pillow==2.5.3
psycopg2==2.6.1
pytz==2014.7
six==1.10.0
South==1.0.2
wsgiref==0.1.2

Are the Aldryn blog templates overridden in your project?

Yes, but only superficially. Currently, we did already delete Aldryn blog templates, but can revert this step. If needed to answer my Q, I'd happily make these templates available.

Are there custom extensions to Aldryn blog on your project?

No.

Are the blog articles currently searchable? (haystack)

django-haystack is installed, but we are not currently using this functionality.

Are you using any of the plugins provided by Aldryn blog? Like Authors or Tags?

Aldryn blog posts are tagged and have authors, but we are not using the Tags or BlogAuthors Plugins' extra functionalities.

Thank you!

Community
  • 1
  • 1
elke
  • 1,220
  • 2
  • 12
  • 24

1 Answers1

4

here's my answers to some of your questions:

How can aldryn-newsblog leads be made HTML compatible?

Yes, Aldryn newsblog uses djangocms-text-ckeditor's HTMLField

How can aldryn-blog entries be migrated to aldryn-newsblog?

Very carefully :) Kidding...

First of, the only way to do this migration is to stay on 1.6 during the whole process. Meaning, don't upgrade to Django >= 1.7 until this migration is fully done.

That said, in order to provide you with as much info as possible, please post exact versions for the following packages (or pip freeze):

  • Django
  • django CMS
  • django taggit
  • Aldryn Blog
  • Aldryn News & Blog (is it already installed?)
  • Aldryn Categories (is it already installed?)
  • django-hvad
  • djangocms-text-ckeditor

Also, here's some questions:

Are the Aldryn blog templates overridden in your project?

Are there custom extensions to Aldryn blog on your project?

Are the blog articles currently searchable? (haystack)

EDIT v1

The way I do these kinds of migrations is to write multiple django management commands, usually one "main" command that will call the others.

By doing this I can iterate faster locally and when ready (after lots of testing) run the command directly on prod (after upgrading necessary dependencies).

I highly recommend using stellar for quick database snapshots during local development of the migration. Allows you to snapshot and restore db instantly and is quite easy to setup.

Here's a sample of such main command:

from django.core.management import call_command, CommandError
from django.core.management.base import NoArgsCommand
from django.db import connection

from south.db import db

from cms.models import Page


class Command(NoArgsCommand):
    can_import_settings = True

    def handle_noargs(self, **options):
        self.stdout.write("Running migrations.\n")

        # Migrate newsblog up to 0013
        call_command('migrate', 'aldryn_newsblog', '0013')

        # Now fake migration 0014 because we don't want the default
        # app config since we'll create it in a later step
        call_command('migrate', 'aldryn_newsblog', '0014', fake=True)
        # Now migrate all the way to 0027 because we need to fake 0028
        call_command('migrate', 'aldryn_newsblog', '0027')
        # This migration has unfortunate side effects when Aldryn blog
        # is installed in the system.
        # It's ok to fake it because is just a data migration
        call_command('migrate', 'aldryn_newsblog', '0028', fake=True)
        # Move to 0035 because we need to fake 0036
        call_command('migrate', 'aldryn_newsblog', '0035')
        # Because we're not using default apphook config, fake 0036
        call_command('migrate', 'aldryn_newsblog', '0036', fake=True)

        # Proceed with all migrations
        call_command('migrate')

        self.stdout.write('Setting up blog page.\n')
        call_command('setup_blog_page')

        self.stdout.write('Migrating Aldryn Blog to Aldryn News & Blog.\n')
        call_command('migrate_blog_to_newsblog')

Now, you need the setup_blog_page and migrate_blog_to_newsblog commands. Before providing them I have another question:

Are you using any of the plugins provided by Aldryn blog? Like Authors or Tags?

Paulo
  • 6,982
  • 7
  • 42
  • 56