Rafał Pitoń 8 years ago
parent
commit
bb6d203cea

+ 5 - 1
docs/upgrading_from_05.rst

@@ -5,6 +5,10 @@ Upgrading from Misago 0.5
 Misago 0.6 comes with special utility that allows those upgrading from Misago 0.5 to move their data to new site. This utility, named ``datamover``, provides set of management commands allowing you to move data over.
 
 
+.. note::
+   If you are already familiar with migration process, Misago comes with special ``runmigration`` command that calls all required commands for you.
+
+
 Preparing for move
 ==================
 
@@ -106,7 +110,7 @@ To enable this feature you'll need to insert new url in your forum's ``urls.py``
         url(r'^', include('misago.datamover.urls')),
         url(r'^', include('misago.urls', namespace='misago')),
 
-This will make Misago redirect users from old urls to new ones, altrough it'll wont preserve the meaning:
+Now build redirects index running ``buildmovesindex`` command. This will make Misago redirect users from old urls to new ones, altrough it'll wont preserve the meaning:
 
 - All links to forum will redirect to category's start page
 - All links to different profile pages of user profile will redirect to user's profile start page

+ 35 - 0
misago/datamover/management/commands/runmigration.py

@@ -0,0 +1,35 @@
+from django.core.management import call_command
+
+from ..base import BaseCommand
+
+
+MOVE_COMMANDS = (
+    'movesettings',
+    'moveusers',
+    'movecategories',
+    'movethreads',
+    'buildmovesindex',
+    'invalidatebans',
+    'populateonlinetracker',
+    'synchronizeusers',
+    'synchronizethreads',
+    'synchronizecategories',
+    'rebuildpostssearch',
+)
+
+
+class Command(BaseCommand):
+    help = (
+        "Executes complete migration from Misago 0.5 together with cleanups."
+    )
+
+    def handle(self, *args, **options):
+        self.stdout.write("Running complete migration...")
+
+        self.start_timer()
+
+        for command_to_call in MOVE_COMMANDS:
+            call_command(command_to_call)
+
+        summary = "Migration was completed in %s" % self.stop_timer()
+        self.stdout.write(self.style.SUCCESS(summary))

+ 4 - 0
misago/datamover/markup/quotes.py

@@ -17,8 +17,12 @@ def convert_quotes_to_bbcode(post):
                 quote.append(line[1:].lstrip())
             else:
                 clean_lines.append('')
+
                 if quote_author:
                     clean_lines.append('[quote="%s"]' % quote_author)
+                else:
+                    clean_lines.append('[quote]')
+
                 clean_lines += quote
                 clean_lines.append('[/quote]')
                 clean_lines.append('')