Re: Recombining a split database

Alexander Barkov <[email protected]>
Newsgroups gmane.comp.web.mnogosearch.general
Message-ID <[email protected]>

On 11/02/2011 10:44 PM, Jeff Taylor wrote:
> When I first set up mnogosearch I had a page list of around 5 million
> entries, however after some reconsiderations I have gotten that number
> back down to a more manageable 700K. Because of this, I would like to
> know if there is a way I can recombine my three databases back into a
> single database, without having to re-index the entire set of pages again?

This scenario this should work:

1. Backup your data, for the case if something goes wrong

2. Find maximum URL id in the first database:

SELECT max(rec_id)+1 FROM url;

Suppose it returns 10000000.

3. Update URL id in the second database for 3 tables:

UPDATE url SET rec_id=rec_id + 10000000;
UPDATE urlinfo SET url_id=url_id + 10000000;
UPDATE bdicti SET url_id=url_id + 10000000;

Instead of 10000000 use the real number returned at the previous step.

4. Dump these three tables in the second database into a file.
Only data, without CREATE TABLE statements!
In case of MySQL it will be:

mysqldump --no-create-info db2 url urlinfo bdict >dump.sql

5. Load the dump into the first database.
In case of MySQL it will be:

mysql db1 < dump.sql

It should work without failures, because at step #3 we made IDs unique.

6. Fix indexer.conf and search.htm: removed the second DBAddr command.

7. Recreate search index:

indexer -Eblob


>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.