Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
280 views
in Q2A Core by
edited by
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?

1 Answer

0 votes
by

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.

by
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.
by
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.
by
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.
...