User-generated code fragments are stored in
~ / Library / Developer / Xcode / USERDATA / CodeSnippets
And you can simply transfer them to save and restore them. I recommend giving them a meaningful name instead of the generated one.
I wrote a short explanation about this here , and also started collecting useful code snippets that can be shared on github . There are still very few snippets there, so any useful snippets you have to share will be great.