Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+12 votes
3.4k views
in Q2A Core by
Has anyone found a good solution to bulk add questions via upload or import from a CSV, excel, txt or other data file format? I have a list of about 1000 questions I want to pre-populate the site with. Doing this manually would take forever. A plugin, php script, etc... would be most useful.

I'm surprised a bulk question creation tool is not a built in function. Would make it more attractive for developers who want to create large sites on the fly.

If anyone has the programming skills to do this, consider creating a crowd-funding page with needed $ goal to develop this plugin or feature and link to it.

Thanks!
Q2A version: 1.8

6 Answers

+5 votes
by

Hi,

I'm working on a PHP script to import Users, Questions, Answers & Comments.

I had  imported Categories & Sub-Categories directly with a CSV file and PhpMyAdmin. It's a first test very simple to do.

I'll publish my scripts for free but to for a plugin, I have to learn all the functions before this, and it's much more work to do and any $ will be welcome ! (€ for me, I'm french wink)

Regards.

by
Hi,
This is great, thanks.
I tried importing questions from CSV file into mysql which was pretty easy. But there are other DB relationships between the question title and other tables. So I gave up.

Looking forward to what you come up with :)
I will be happy to help beta test.
And can help also help with fund-raising for you if it's working.

Thanks!
by
I also want do this can you provide a link of your code
+1 vote
by
I test this day my first scripts to inject users with the Q2A functions.

It's work fine, with little features I have to extend (changing register date, update state, ...).

To make a massive Q import, it is necessary to have a user who has written them. So you have to create user(s) before and rely them to questions.

Regards & good night (23:37 in France)
by
You want to import only questions?
by
Yes, I only want to import questions. I have about 700 questions in a text file. I can convert it into a CSV also if that works better for importing.
by
The only thing you need are categoryid, user ID, tags, question title, question text (ignoring created time, IP etc). If these are available in a proper format, then you can just call qa_post_create function.
by
Can you post a link to your script? Thanks
0 votes
by
Hi guys. I did my own system to moderate user messages. I can easily do this, but I have to know how q2a database works.

1. when I add a question, the q2a only add a row in questions table?

2. when I add a user, the q2a only add a row in users table?

Thats because q2a works with a lot of logs and statistics and Id like to know how it works before build something. Can someone answer this 2 questions?
by
For adding question, do not directly write to qa_posts table but instead use the create post function. Most of these functions you can find in qa_include/app folder which internally will call the required database functions.
0 votes
by
edited by
I also want do this can you provide a link of plugin code?
by
+1
pupi1985 made a plugin to import questions too. Check his profile for the link
0 votes
by
Hi,
I have written the script for that , just need to put it in a plugin.
+2 votes
by

Hello there, I have successfully created a Plugin to Import Question along with its answers from an XML or Json file. It is fully working on my website https://givemeans.net/

It is just in testing phase, if I get no errors, I shall make it available to download and contribute on my website.

Check link: https://givemeans.net/q2a-bulk-import

by
Awesome! Looking forward to trying it out. Thanks
by
it is fully working on my site and demonstration is given on the given link.
https://givemeans.net/q2a-bulk-import
...