1. Create new site using the web interface with the same extent as the old site, but don't enable the site 2. Add a season corresponding to the one from the old site, but don't enable the season 3. Disable the download and the preprocessing for that new site ### connect to the DB psql -U admin sen4cap ### check the id of the new site select id, name from site; ### disable download of S1, S2 and L8 ### !! change: site_id = ? insert into config(key,site_id,value) values ('downloader.l8.enabled','?','false'); insert into config(key,site_id,value) values ('downloader.s1.enabled','?','false'); insert into config(key,site_id,value) values ('downloader.s2.enabled','?','false'); ### disable preprocessing of S1, S2 and L8 ### !! change: site_id = ? insert into config(key,site_id,value) values ('l8.enabled','?','false'); insert into config(key,site_id,value) values ('s1.enabled','?','false'); insert into config(key,site_id,value) values ('s2.enabled','?','false'); ### exit DB exit 4. Import products from old site to the new site, in the database ### backup 'product' table, in case of any problem pg_dump -d sen4cap -U admin -t product --data-only > product_backup.sql ### connect to the DB psql -U admin sen4cap ### check sites id select id, name from site; ### L2A, L3B, AMP, COHE copy to a csv ### without columns : id, job_id, downloader_history_id ### !! change: site_id = ? \copy (select product_type_id,processor_id,site_id,full_path,created_timestamp,inserted_timestamp,is_archived,archived_timestamp,name,quicklook_image,footprint,geog,satellite_id,orbit_id,orbit_type_id,tiles from product where site_id = ? and product_type_id in (1,3,10,11)) to '/home/s4cuser/products.csv' delimiter ';'; ### exit DB exit ### modify site_id in the exported_csv ### example with old site_id 'X' et new site_id 'Y' : ### sed -i /home/s4cuser/products.csv -e 's/^\([0-9]*;[0-9]*;\)X\(.*\)$/\1Y\2/' ### !! change: old site_id and new site_id, here 3 to 8 ! ! sed -i /home/s4cuser/products.csv -e 's/^\([0-9]*;[0-9]*;\)3\(.*\)$/\18\2/' - - ### check in /home/s4cuser/products.csv if the site_id has been modified (3rd column) vim /home/s4cuser/products.csv ### connect to the DB psql -U admin sen4cap ### copy the data from the csv to the table product, for the new site \copy product(product_type_id,processor_id,site_id,full_path,created_timestamp,inserted_timestamp,is_archived,archived_timestamp,name,quicklook_image,footprint,geog,satellite_id,orbit_id,orbit_type_id,tiles) from '/home/s4cuser/products.csv' delimiter ';'; ### check the copied data ### !! changer : site_id = ? select product_type_id, count(product_type_id) from product where site_id = 8 group by product_type_id;