89

I need to migrate from one Mac to another, and want Sublime Text 2 on a new computer to have all the same configuration/plugins I have installed on the old one.

Is there some folder(s) I could just copy and restore on another one to replicate everything?

earlyadopter
  • 1,537
  • 4
  • 16
  • 21
  • 1
    Looks like here is enough info to do that: http://opensourcehacker.com/2012/05/24/sync-and-back-up-sublime-text-settings-and-plug-ins-using-dropbox-on-linux-and-osx/ – earlyadopter Jul 06 '12 at 16:59

4 Answers4

205

I just set up a good solution for this, it requires dropbox. I am currently using this to sync plugins and settings across ~5 different sublime installs on windows, linux, osx, and a few vm's.

  • Step 1: use PackageControl to manage all your plugins, its awesome.

  • Step 2: Add a "Sublime" directory to your root drop-box directory (I replicated the full directory structure for the hell of it, {DropBox}/Sublime/Packages/User). Make sure sublime is closed, and move the contents of {SublimeRoot}/Packages/User in to the dropbox directory you just made. Delete {SublimeRoot}/Packages/User, and replace it with a symlink that points to {DropBox}/Sublime/Packages/User.

Use this same process on every computer where you use sublime, it accomplishes 2 things.

  • 1) The contents of your User/ directory are synced, so all your custom settings are the same across machines.

  • 2) Every time PackageControl starts up, it checks the Package Control.sublime-settings in your User/ directory. If if finds a plugin that should be installed according to the settings, but isn't actually installed, it automatically installs it, no questions asked.

Setting up another computer with this solution simply requires sublime and package control to be installed, then just delete the {SublimeRoot}/Packages/User/ directory and point it to the copy in dropbox with a symbolic link. Next time you fire up sublime, package control will automatically install all your plugins.

Creating the symbolic links: execute from the {Sublime}/Packages directory

  • Windows: mklink /D .\User C:\Users\[username]\Dropbox\Sublime\Packages\User
  • Linux/OSX: ln -s {DropboxRoot}/Sublime/Packages/User ./User
dusan
  • 9,104
  • 3
  • 35
  • 55
jdc0589
  • 6,972
  • 5
  • 36
  • 39
  • 8
    I also did the same thing but with google drive. *mklink /D User g:\GoogleDrive\"Google Drive"\sublimetext* – styks Nov 28 '12 at 02:46
  • 1
    This is really awesome! But I found my user settings in C:\Users\[username]\AppData\Roaming\Sublime Text 2\Packages\User (Windows 7 Ultimate SP1) – ed1nh0 Oct 05 '12 at 12:17
  • If you get an error loading a package: 1) don't forget to install package control on the new computer with sublime, and 2) you may have to wait - check the console with ctrl-` to see messages scrolling by about installing stuff. You may have to re-start Sublime after the new packages are installed. – Ivan -Oats- Storck Jan 22 '13 at 22:09
  • Whern I run sublime in console(ctrl-`) I get this error: ```IOError: [Errno 2] No such file or directory: u'/Users/mac/Library/Application Support/Sublime Text 2/Packages/User/Package Control.last-run' Unable to write settings file: /Users/mac/Library/Application Support/Sublime Text 2/Packages/User/Fetch.sublime-settings``` no packages are reinstalled, any help? – kumo99 Feb 05 '13 at 14:13
  • 2
    @crstamps2, yes it does. the core sublime application files live in a totally different location in the file system. – jdc0589 Apr 02 '13 at 21:08
  • I guess the only problem would be if you manually install packages from github. ST3 user here, so need to checkout some new branches for ST3 compatibility. I just symlink the whole Packages directory, which is obviously not fool-proof either. – KG - Jun 03 '13 at 18:16
  • Can all the settings and files I used in ST2 be ported to ST3, as well? – timetofly Jul 08 '13 at 18:08
  • I just tried doing the same from ST2 -> ST3, and so far it seems to be working just fine; haven't gotten any errors yet. Just make sure you first install Package Control for ST3. – timetofly Jul 08 '13 at 18:25
  • 11
    {SublimeRoot} on OSX is ~/Library/Application Support/Sublime Text 2 – Magne Aug 19 '13 at 12:05
  • This is awesome - i had exactly this in mind before i googled for 'backup sublime text 2 user' :D – Michahell Jun 13 '14 at 15:59
  • 1
    I create a `.config` folder in `~/Dropbox` and link my linux `~/.config` folders to the Dropbox copy. On Mac/Windows I just link to the `~/Dropbox/.config/sublime-text-2` or `.../sublime-text-2/Packages/User`, whatever works for that OS's implementation of sublime. This picks up other packages and settings besides just User. Plus other gnome-like apps that use `~/.config` are kept synced as well. – hobs Jul 01 '14 at 17:17
19

Add directory ~/Library/Application Support/Sublime Text 2/Packages to git repository. For example bitbucket. So you can commit after any changes with plugins and settings. If something failes with sublime text2 you can easy rollback.

Maxim Yefremov
  • 13,671
  • 27
  • 117
  • 166
9

BACKUP SUBLIME TEXT

  1. Copy files from C:\Users\[userName]\AppData\Roaming\Sublime Text 2\
    The file location can be found by using - Open Sublime Text -> Browse Packages
  2. Close Sublime Text
  3. Backup all the folder from Sublime Text 2 Folder
    a. Sublime Text 2/Installed Packages
    b. Sublime Text 2/Packages
    c. Sublime Text 2/Pristine Packages
    d. Sublime Text 2/Settings

NEW INSTALLATION

  • Now replace all the backup files in new installation C:\Users\[NewUserName]\AppData\Roaming\Sublime Text 2\
  • The file location can be found by using - Open Sublime Text -> Browse Packages
  • Close Sublime Text
  • If you get error unable to save work-space
    1. Create a new Project
    2. Save Project
    3. Exit
    4. Restart Sublime Text
Ryan B
  • 3,364
  • 21
  • 35
Amol
  • 145
  • 3
  • 9
0

All you need to do is copy the following files from the old MacOs computer:

~/Library/Application Support/Sublime Text 3/Packages/User/Package Control.sublime-settings ~/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings

Also make sure you find the old email with the license you purchased, and make note of the disabled packages, as those may not be disabled when you restart the app with the new config.

Then on the new MacOs:

  1. install the ST3
  2. install PackageControl
  3. Copy the files over to ~/Library/Application Support/Sublime Text 3/Packages/User/
  4. Restart the application
  5. NOTE: You may have to restart it a few times, it can be buggy until the config reinstalls all the packages from the .sublime-settings files.

You don't need all the settings packages in the User directory, those will automatically be reinstalled on restart. I guess it wouldn't hurt to grab them all, but usually new Mac == new settings. The "Package Control.sublime-settings" will automatically install all the packages listed in it.

I am about to migrate Macs, I will update this when that is completed to verify it works!

dustbuster
  • 79,958
  • 7
  • 21
  • 41