作者: Jakub Rusinowski · 最后更新: 2026年7月10日
You can move Ollama to a new computer by copying one folder — `~/.ollama/models` — instead of re-downloading 50 GB+ of models over your internet connection. The same trick works for LM Studio, and thi
You can move Ollama to a new computer by copying one folder — ~/.ollama/models — instead of re-downloading 50 GB+ of models over your internet connection. The same trick works for LM Studio, and this guide covers the exact folder locations on Mac, Windows, and Linux, plus how to carry over your custom Modelfiles and chat history.
Last Updated: July 2026
Everything hinges on knowing where the model files actually live:
| App | OS | Default model location |
|---|---|---|
| Ollama | macOS | ~/.ollama/models |
| Ollama | Linux | /usr/share/ollama/.ollama/models (service install) or ~/.ollama/models |
| Ollama | Windows | C:\Users\youruser\.ollama\models |
| LM Studio | macOS / Linux | ~/.lmstudio/models (older versions: ~/.cache/lm-studio/models) |
| LM Studio | Windows | C:\Users\youruser\.lmstudio\models |
Inside Ollama's models folder you'll see two subdirectories, and you need both:
blobs/ — the actual model weights, stored as content-addressed files (this is the 50 GB part)manifests/ — small JSON files that tell Ollama which blobs make up which model tagCopying blobs without manifests gives you orphaned data Ollama can't see; manifests without blobs gives you a model list that fails on load. Always move the whole models directory.
On the old machine:
ollama list # what you have
du -sh ~/.ollama/models # how big it is (macOS/Linux)
On Windows PowerShell:
ollama list
"{0:N1} GB" -f ((Get-ChildItem "$env:USERPROFILE\.ollama\models" -Recurse | Measure-Object -Property Length -Sum).Sum / 1GB)
This is also the moment to prune: ollama rm [model] anything you haven't used in months. No point moving 30 GB of models you abandoned. If you're unsure which quant sizes are worth keeping for the new machine's VRAM, check the GGUF quant guide.
Quit Ollama on both machines first (system tray → Quit, or sudo systemctl stop ollama on Linux) so no blob is written mid-copy.
Over the network (same LAN, Mac/Linux):
# From the old machine — resumable, shows progress
rsync -avh --progress ~/.ollama/models/ user@new-machine:~/.ollama/models/
Via external drive: copy ~/.ollama/models to the drive, then into the same path on the new machine. On a typical USB 3 SSD this moves 50 GB in ~10 minutes — compare that to hours of re-downloading on a normal connection.
Windows (robocopy is resumable and verifies):
robocopy "C:\Users\old\.ollama\models" "D:\ollama-backup\models" /E /Z /ETA
# then on the new PC, reverse it into C:\Users\<you>\.ollama\models
Cross-platform note: blobs and manifests are identical across macOS, Windows, and Linux — a models folder copied from a Mac works on a Windows PC unchanged. Only the path differs.
Install Ollama fresh from ollama.com/download (the app itself is small — you're only avoiding the *model* downloads), place the copied folder, start Ollama, then:
ollama list # should show your full library instantly
ollama run llama3.1 # loads from local blobs, no download bar
If ollama list comes up empty, the folder is in the wrong place for that OS (check the table above) — or on Linux, the service runs as the ollama user and can't read files owned by you:
sudo chown -R ollama:ollama /usr/share/ollama/.ollama/models
If the new machine has a small system drive, don't copy into the default path at all — set the OLLAMA_MODELS environment variable to somewhere roomier and put the folder there:
# macOS/Linux (persist in your shell profile or systemd unit)
export OLLAMA_MODELS=/mnt/bigdisk/ollama-models
# Windows: System Properties → Environment Variables →
# add OLLAMA_MODELS = D:\ollama-models, then restart Ollama
This is also the cleanest long-term setup: your models live on a data drive that survives OS reinstalls, and future "migrations" become a non-event.
Custom models (personas you built with ollama create) travel automatically with the models folder — they're just another manifest + blobs. But it's smart to also export their recipes as plain text, so you can rebuild or tweak them later:
ollama show email-assistant --modelfile > email-assistant.Modelfile
Chat history: Ollama's CLI keeps only a prompt history file (~/.ollama/history). If you chat through a UI, the history lives with that UI, not with Ollama — for Open WebUI in Docker, back up the open-webui volume; for LM Studio, conversations are JSON files in ~/.lmstudio/conversations (copy that folder alongside the models).
LM Studio models: same procedure — quit the app, copy the models folder from the table above into the new machine's path. LM Studio indexes the folder on next launch. If you keep GGUFs in a custom directory, set it under My Models → change models directory.
On a 100 Mbps connection, 50 GB takes about 70 minutes of download if nothing hiccups; a USB 3 SSD does it in ~10. On slow, metered, or capped connections it's not even close. Copying also preserves custom models that don't exist in the registry at all.
Yes. GGUF blobs are platform-independent — the same files run on macOS, Windows, and Linux. Copy the whole models folder and Ollama on any OS reads it.
It works read-only in practice but isn't supported — two Ollama instances writing (pulling/removing models) into the same folder can corrupt manifests. A safer pattern: keep one machine as the model host and let others talk to it over the network — see Personal AI Home Server.
Yes. Updating or reinstalling the Ollama app never touches the models folder. Deleting ~/.ollama (or the Windows equivalent) is the only way to lose models — which is exactly why it's also your one-folder backup target.