{"action":"opened","issue":{"url":"https://api.github.com/repos/jbenet/go-ipfs/issues/537","labels_url":"https://api.github.com/repos/jbenet/go-ipfs/issues/537/labels{/name}","comments_url":"https://api.github.com/repos/jbenet/go-ipfs/issues/537/comments","events_url":"https://api.github.com/repos/jbenet/go-ipfs/issues/537/events","html_url":"https://github.com/jbenet/go-ipfs/issues/537","id":53983056,"number":537,"title":"local repo format migrations","user":{"login":"jbenet","id":138401,"avatar_url":"https://avatars.githubusercontent.com/u/138401?v=3","gravatar_id":"","url":"https://api.github.com/users/jbenet","html_url":"https://github.com/jbenet","followers_url":"https://api.github.com/users/jbenet/followers","following_url":"https://api.github.com/users/jbenet/following{/other_user}","gists_url":"https://api.github.com/users/jbenet/gists{/gist_id}","starred_url":"https://api.github.com/users/jbenet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbenet/subscriptions","organizations_url":"https://api.github.com/users/jbenet/orgs","repos_url":"https://api.github.com/users/jbenet/repos","events_url":"https://api.github.com/users/jbenet/events{/privacy}","received_events_url":"https://api.github.com/users/jbenet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-11T06:07:21Z","updated_at":"2015-01-11T06:07:21Z","closed_at":null,"body":"though this should rarely happen, sometimes we'll need to change formats of the repository files; this includes config key changes, and data inside leveldb. we should never break people's objects, so that means we need to handle these upgrades with great care. \r\n\r\nWe probably should use something like a repo-version with migrations. one possible way to do this is: we have a single repo version, every time we make format change we increment the repo version, and add a tool `repo_migrate_<old>2<new>` that performs the update. We should then be able to apply each script in sequence.\r\n\r\nIt would be easiest to write these in go, given much of the formatting will have to do with datastore keys or protobufs. things that would make this easier:\r\n\r\n- a datastore tool (cli tool to manipulate arbitrary datastores)\r\n- a repo tool (standalone tool that understands config, datastore, blockstore, + merkledag) and can manipulate them.\r\n\r\n"}}