Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How can I migrate my OSQA into a Question2Answer site?

+5 votes
asked Mar 20, 2012 in Q2A Core by anonymous
I'd like to transfer my 500+ questions already asked on my OSQA website and all it's users etc onto a Question2Answer website. How would I go about doing this, I already have a dump file of all the content but what would I need to change to make the dump structure compatible with Question2Answer's database strucuture so it would work properly? I hope someone can help me.
commented Mar 22, 2012 by Scott
What database does OSQA use? (e.g. MySQL)
commented Mar 22, 2012 by Noahqw
It uses MYSQL.
commented Jun 1, 2013 by James Spittal
I know it's been about a year - but any progress on this? I'm keen to see if anyone has made any progress in this regard.

2 Answers

+3 votes
answered Mar 22, 2012 by Krzysztof Kielce
edited Mar 22, 2012 by Krzysztof Kielce

I think you need to:
1. Create sql dump file of your osqa database.
2. Write a script or Q2A plugin that convert data from osqa dump file into Q2A .sql dump file structure.
(If you decide to make a script, please share with the community).

Or do the conversion manually, line by line.

None the less, before doing this, you must check if you can retrieve all necessary data from your OSQA database.
Then you can use my backup plugin (https://github.com/KrzysztofKielce/q2a-backup) to import the data (only full restore available).
Tip: you can do the backup of some existing Q2A instance to lookup how .sql file should look like.


commented Mar 22, 2012 by Noahqw
It sounds like I might be stuck programming a python script that will convert my OSQA DB structure into a Q2A friendly structure. This will take some time. I'll let you guys know how it goes. If I do decide to do this I'll probably just take all the questions and import them into the website anonymously. Anyways, thanks for the info!
0 votes
answered Jun 1, 2013 by James Spittal
edited Jun 2, 2013 by James Spittal

So far I've been successful in creating a PHP script that loops through the OSQA 'User.xml' library and adds table entries into qa_users, qa_userprofile and qa_userpoints tables.

Seems to work pretty good so far, but the main issue right now is the difference in password hashing/salting algorithms. My workaround is to reset everyone's password to 'password' (or another string that you choose.)

Script is available here: http://www.question2answer.org/qa/24213/migrating-osqa-xml-backup-to-new-q2a-installation


commented Sep 16, 2013 by James Spittal
Can I ask why you're trying to export the DB if it doesn't contain any real users?
commented Sep 16, 2013 by Alvaro A Fernandez
I was referring myself to the only 2 users my Q2A site have. The OSQA has abouth 25 users, and about 50 questions (not an awful lot)