{"id":1252,"date":"2010-01-13T03:20:18","date_gmt":"2010-01-13T02:20:18","guid":{"rendered":"http:\/\/www.devco.net\/?p=1252"},"modified":"2010-06-27T19:19:27","modified_gmt":"2010-06-27T18:19:27","slug":"backing_up_google_code_projects","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2010\/01\/13\/backing_up_google_code_projects.php","title":{"rendered":"Backing up Google Code projects"},"content":{"rendered":"

Google Code does not provide it’s own usable export methods for projects so we need to make do on our own, there seems no sane way to back up the tickets but for SVN which includes the wiki you can use svnsync.<\/p>\n

Here’s a little script to automate this, just give it a PREFIX<\/em> of your choice and a list of projects in the PROJECTS<\/em> variable, cron it and it will happily keep your repos in sync.<\/p>\n

It outputs its actions to STDOUT so you should add some redirect or redirect it from cron.<\/p>\n

<\/p>\n

\r\n#!\/bin\/bash\r\n\r\nPROJECTS=( your project list )\r\nPREFIX=\"\/path\/to\/backups\"\r\n\r\n[ -d ${PREFIX} ] || mkdir -p ${PREFIX}\r\n\r\ncd ${PREFIX}\r\n\r\nfor prj in ${PROJECTS[@]}\r\ndo\r\n    if [ ! -d ${PREFIX}\/${prj}\/conf ]; then\r\n        svnadmin create ${prj}\r\n\r\n        ln -s \/bin\/true ${PREFIX}\/${prj}\/hooks\/pre-revprop-change\r\n\r\n        svnsync init file:\/\/\/${PREFIX}\/${prj} http:\/\/${prj}.googlecode.com\/svn\r\n    fi\r\n\r\n    svnsync sync file:\/\/\/${PREFIX}\/${prj}\r\ndone\r\n<\/pre>\n

<\/code><\/p>\n

I stongly suggest you backup even your cloud hosted data.<\/p>\n","protected":false},"excerpt":{"rendered":"

Google Code does not provide it’s own usable export methods for projects so we need to make do on our own, there seems no sane way to back up the tickets but for SVN which includes the wiki you can use svnsync. Here’s a little script to automate this, just give it a PREFIX of […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","footnotes":""},"categories":[7],"tags":[121,15],"_links":{"self":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/1252"}],"collection":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/comments?post=1252"}],"version-history":[{"count":4,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/1252\/revisions"}],"predecessor-version":[{"id":1521,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/1252\/revisions\/1521"}],"wp:attachment":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/media?parent=1252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/categories?post=1252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/tags?post=1252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}