|
klerindias Novice
Joined: 23 Jan 2010 Posts: 37
|
Posted: Sat May 17, 2014 8:31 pm
Howto copy databases with zones |
Hi,
below showing howto
copy zones from one database to 2nd database with other zones
so we will have all zones in one database.
First you need program:
1.http://www.codeproject.com/Articles/220018/SQLite-Compare-Utility
and
2.http://sourceforge.net/projects/sqlitebrowser/
Then you need load this two databases, and mark show differences only in program 1.
In colour blue you will have showed all tables with diffrences.
In my case it was:
drawtbl
exittbl
favtbl
metatbl
notetbl
objecttbl
zonetbl
and
verstbl
Next open program 2.
Then you need choose one of databases and find all columns with names below and add constant huge index to one database.
Better add same indexes to smaller database.
To all indexes:
drawID
zoneID
exitID
exitIDTo
fromID
toID
metaID
noteID
objID
for example:
UPDATE zonetbl SET zoneId = zoneId + 200000
adding number must be higher than highest index in bigger database
in my case 200 000 was enough big.
and do this in program 2 in tab 'execute sql'
for all indexes in all tables without table verstbl.
When you add indexes to all columns in all tables then
you change values in table: verstbl
find in program 1 differences between data in columns in this table and choose always bigger values or change to bigger value from 2nd database.
Then
in program 1.
Open each different table (click on icon on left column)
and
select all data in smaller database and click on arrow to copy to bigger database
it will copy all selected values(rows).
Refresh compare to see if all rows are copied, if yes do next table.
After you do it for all differing tables,
you got one database with all zones from two databases.
Someone with better knowledge of sql, could write script to automate this process.
Have fun. |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Mon May 19, 2014 5:32 am Re: Howto copy databases with zones |
klerindias wrote: |
Someone with better knowledge of sql, could write script to automate this process.
Have fun. |
It's already been done, and is available in the zmud downloads section. For cmud maps, you'll also need the mapconvert utility to convert your mapper database to the old zmud format, and convert the merged database back to the cmud format. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|