movethreads.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. from misago.datamover import attachments, markup, polls, threads
  2. from misago.datamover.management.base import BaseCommand
  3. class Command(BaseCommand):
  4. help = "Moves threads and posts from Misago 0.5"
  5. def handle(self, *args, **options):
  6. self.stdout.write("Moving threads from Misago 0.5:")
  7. self.start_timer()
  8. threads.move_threads(self.stdout, self.style)
  9. self.stdout.write(self.style.SUCCESS("Moved threads in %s" % self.stop_timer()))
  10. self.start_timer()
  11. threads.move_posts()
  12. self.stdout.write(self.style.SUCCESS("Moved posts in %s" % self.stop_timer()))
  13. self.start_timer()
  14. threads.move_mentions()
  15. self.stdout.write(self.style.SUCCESS("Moved mentions in %s" % self.stop_timer()))
  16. self.start_timer()
  17. threads.move_edits()
  18. self.stdout.write(self.style.SUCCESS("Moved edits histories in %s" % self.stop_timer()))
  19. self.start_timer()
  20. threads.move_likes()
  21. self.stdout.write(self.style.SUCCESS("Moved likes in %s" % self.stop_timer()))
  22. self.start_timer()
  23. attachments.move_attachments(self.stdout, self.style)
  24. self.stdout.write(self.style.SUCCESS("Moved attachments in %s" % self.stop_timer()))
  25. self.start_timer()
  26. polls.move_polls()
  27. self.stdout.write(self.style.SUCCESS("Moved polls in %s" % self.stop_timer()))
  28. self.start_timer()
  29. threads.move_participants()
  30. self.stdout.write(
  31. self.style.SUCCESS("Moved threads participants in %s" % self.stop_timer())
  32. )
  33. self.start_timer()
  34. threads.clean_private_threads(self.stdout, self.style)
  35. self.stdout.write(self.style.SUCCESS("Cleaned private threads in %s" % self.stop_timer()))
  36. self.start_timer()
  37. markup.clean_posts()
  38. self.stdout.write(self.style.SUCCESS("Cleaned markup in %s" % self.stop_timer()))