ef-labs / stash-hook-mirror

An Atlassian Stash repository hook for mirroring to one or more remote git repositories.
MIT License
77 stars 58 forks source link

How to do massive url edit? #61

Closed lGuillaume124 closed 6 years ago

lGuillaume124 commented 6 years ago

Hello,

I'm using the hook on hundreds of repositories on my Bitbucket instance. They all mirror to the same destination. Unfortunately I have to change the mirror URL and I'm trying to find a way to edit all of the configurations at the same time. Is it possible ?

adrianluisgonzalez commented 6 years ago

Yes, but you'll need to do it at a database level. The repository hook settings are stored using the com.atlassian.bitbucket.setting.Settings object.

The following SQL commands should find the relevant settings in the sta_shared_lob table:

select l.* 
  from sta_repo_hook h 
  join sta_shared_lob l 
    on h.lob_id = l.id 
  where h.hook_key = 'com.englishtown.stash-hook-mirror:mirror-repository-hook';

Hope this helps

lGuillaume124 commented 6 years ago

Awesome! Thank you very much!