Skip to content

copy data

Karl Tarbet edited this page Dec 26, 2017 · 3 revisions

The HydrometServer program has a --copy-daily argument that is used to copy data from another database. Example usage:

mono HydrometServer.exe --copy-daily=daily_mrso_pc --source="Server=lrgs2;user id=ktarbet;database=timeseries" --compare --
t1=1900-01-01  --t2=2017-12-26  --debug

To create a bulk copy using the above template fro all AgriMet sites use the following query.

select 
'mono HydrometServer.exe --copy-daily='
||tablename||' --source="Server=remotehostname;user id=ktarbet;database=timeseries"'
||' --compare --t1=1900-01-01 ' 
||' --t2=2017-12-20  --debug'  cmd

  from seriescatalog 
  where isfolder=0
  and timeinterval = 'Daily'
  and siteid in (select siteid from sitecatalog where type='agrimet')