Merging Databases

pk
Posts: 2
Joined: Fri Jun 08, 2001 8:58 am

Merging Databases

Post by pk »

Hi,

I have two seperate Webinator databases say db1 and db2. Can I merge them into one common database ?

Thanks,

Robert
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

Merging Databases

Post by Kai »

You'd need to select the data from one database and insert it into the other. You'll need to write a short Vortex script to do this. First drop the search indexes on the destination database, to improve insert speed, with gw -unindex. Then write a script like this:

<DB=/path/to/src/db>
<SQL ROW "select * from html">
<DB=/path/to/dest/db>
<SQL NOVARS "insert into html values($id, $New, $Visited, $Dlsecs, $Depth, $Url, $Title, $Body, $Meta)"></SQL>
</SQL>

to copy the html table over. Use a similar method to copy the refs table as well. Then re-index the destination database with gw -index. Note that depending on your license (Webinator vs. Texis) you may hit insertion limits depending on the database size.