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

If you have questions about the platform, click here to ask and please use English.

If you just want to try Q2A, please use the demo, which also grants admin access.

Apr 29: Q2A 1.5.2

Migrating questions from one Q2A instance to another?

+1 vote
I'm using Q2A's userbase-sharing function to run a couple of different Q2A sites, with the same users. I've written a plugin that can migrate a question from one instance of Q2A to another.

However, I am just using raw SQL so it's not indexing the new posts when they're added to the database. Is this actually possible to do? Under site "qa_" I don't think you'd be able to reindex a post on say "qameta_".

Any better solution for this?
asked Oct 1, 2011 in Q2A Core by DisgruntledGoat
edited Oct 2, 2011 by DisgruntledGoat

1 Answer

0 votes

Use the functions in qa-app-posts.php (Q2A 1.4 or later) which provide an easy interface for retrieving and creating posts, and take care of indexing for you.

answered Oct 2, 2011 by gidgreen
The problem is, I'm running migration on my base Q2A instance, so calling those functions will only create posts there and not on the second site, right? Maybe I could switch it to the second site to pull in questions from the first.
Yes, you could do that, but then you have the problem of deleting the posts from the first instance, which is also done most safely via qa-app-posts.php. Your best bet is probably to use a custom MySQL table to manage the process, and have each installation refer to that table as appropriate.
I think I see what you mean I'll see if I can find a decent solution. At the moment I am just doing a manual reindex after migrating a bunch of posts which seems to work fine for now.