First time here? Check out the FAQ!
1

How to export data from Askbot?
 

Hello,

I am wondering if anyone has experience merging, moving or exporting forums from askbot to something else?

Stack exchange seems to be an option, according to some.

What are some other forum options?

How does one proceed to move all this data?

Br /H

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
henriksahlin's avatar
21
henriksahlin
asked 3 years ago
Evgeny's avatar
13.2k
Evgeny
updated 1 year ago

Comments

see more comments

1 Answer

1

You will need to iterate over users, questions, answers and comments.

User records can be accessed from Python code as follows:

from askbot.models import User
users = User.objects.all() # you will need at least the fields: username, email

Questions, comments and answers are accessible via the Post model:

from askbot.models import Post
questions = Post.objects.filter(post_type='question')
answers = Post.objects.filter(post_type='answer')
comments = Post.objects.filter(post_type='comment')

Question id which is part of the url is id of question object (i.e. question.id).

Post text is some_post.text - a markdown source, some_post.html - rendered html of the post.

Question title is question.thread.title

Tags are question.thread.tagnames

Post votes are some_post.vote_up_count and some_post.vote_down_count

This is probably the minimum you need. That is you'll need to create a script iterating over the objects that I've mentioned above and store the result in some file.

Obviously, how to import that data wherever you want to move it depends on the software package you intend to use in the future.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 1 year ago
link

Comments

see more comments