How to Transfer Files From Your Old Laptop
Short answer: The safest way to move to a new laptop is to treat it as a backup-and-restore job: list your documents, code repositories, and settings; copy them to an external drive or through a network or cloud service; verify the copies before resetting the old machine. Start with your code in version control, then move system-specific files like SSH keys and package lists. The goal is a new laptop you can work from on day one.
Start with a checklist, not a cable
Moving files to a new laptop is a backup-and-restore job. Before connecting anything, know what is on the old machine. Make a list of documents, photos, code repositories, configuration files, SSH keys, bookmarks, and local databases. Choose the operating system for the new machine before you start, because it changes which settings are worth saving.
The list is also a chance to delete what you no longer need. Old installers, temp folders, and downloaded files are easy to leave behind. If you do not need a file on the new machine, do not copy it. A smaller transfer is easier to verify and leaves more room on the new drive.
- Documents and photos you want to keep
- Code repositories and uncommitted local changes
- Shell dotfiles, editor settings, and terminal profiles
- SSH keys, GPG keys, and credential files
- Browser bookmarks and saved passwords, or a password manager export
- Local database dumps and container or VM exports
Move code with version control
If your code lives in Git, the safest transfer is a push and clone. Push every branch and stash to a remote, then clone on the new laptop. This moves the full history and forces you to face uncommitted changes. Copy only repositories that never had a remote, and include the .git folder so you do not lose history.
Large repositories can take up significant space. Before you clone a project with years of history, think about how much storage you will need on the new machine. If you only need the current branch, a shallow clone can get you started, but you will not have the full history for debugging or archaeology.
Use an external drive or local network for the big folders
An external SSD or hard drive gives you a single copy you can move between machines. Connect it to the old laptop, copy folders, eject, connect to the new one, and verify before deleting anything. If you do not have an external drive, your home network can do the same job with file sharing or a transfer utility.
Check the ports on both laptops first. The laptop ports guide and USB-C versus Thunderbolt comparison explain the difference. For example, the Apple MacBook Air tech specs list two Thunderbolt 4 (USB-C) ports that support USB4 at up to 40Gb/s, so a modern USB-C drive will connect without an adapter.
Network transfer works well over Wi-Fi, but a wired Ethernet connection is faster and more reliable for very large folders. If both laptops support Wi-Fi 6 or later, the transfer can still be quick enough for daily work files. The laptop Wi-Fi and Bluetooth guide can help you check what your laptops support.
Recreate settings and move credentials carefully
Settings and credentials are the part of a migration that usually breaks. Export editor settings, shell aliases, and package lists instead of copying whole application directories. For secrets such as SSH and GPG keys, copy them only over a trusted channel and set restrictive permissions on the new machine. If you use a password manager, sign in on the new laptop and let it repopulate your logins.
Some tools are easier to reinstall than to transfer. Visual Studio Code's requirements page notes that the editor is a small download with a disk footprint of under 500 MB, so reinstalling it on the new laptop is often simpler than moving its data. For Apple development, Apple's Xcode system requirements page lists the macOS versions each Xcode release supports, so verify the new Mac can run your Xcode version before you retire the old one.
When you recreate settings, keep them in dotfiles or a settings sync feature. That way the same configuration works on any future machine. A script that installs your preferred packages and copies your configuration files is a small project, but it pays off on every subsequent laptop.
Sync with cloud storage for ongoing files
Cloud storage is a convenient middle layer for files you still use regularly. Put your active projects and documents in a folder that syncs to the new laptop, then let the cloud fill in the gaps. This is not a complete backup if you only keep one copy, so still verify that important files are available locally.
For large media files or long-term archives, a cloud sync can be slow on the first run. You can start the sync on the old machine before the new one arrives, or move the biggest folders over a local network or external drive first. The cloud is best for files that change often and need to be available across machines.
Re-create containers and virtual machines
Containers and virtual machines do not travel as single files. The portable part is your Dockerfile, compose file, or provisioner script. Re-create the environment on the new machine, then pull images or build from source. If you have a volume with data you need, export a database dump or copy the named volume folder; that is data, not an image. Treat downloaded layers as disposable. The same is true for a VM disk: copy the files that represent your project state, not the whole virtual disk, unless you know you need it.
Before you move a container setup, check that the new laptop has enough RAM and storage. The laptop specs for containers and VMs guide explains the requirements in more detail. For example, Docker Desktop on Windows has its own installation requirements, and the Docker Docs site is a reliable reference for the exact steps.
Verify before you erase
The only way to know the transfer worked is to verify. Open documents, build a project, run a test, and confirm you can log in to the services you use. Keep the old laptop powered off and untouched for a week after you are comfortable on the new machine. Once you are sure, wipe the old drive using the operating system's own reset tool. The new laptop setup guide can help you configure the machine correctly from the start.
Write down what you verified so you do not miss anything. Check your editor opens with the right extensions, your terminal has your aliases, your Git remotes point to the right URLs, and your local database starts without errors. A short checklist gives you confidence to erase the old drive.
What to pick for your work
| If you | Pick | Buying guide |
|---|---|---|
| You want a general-purpose developer laptop after the move | best-laptops-for-programming | Best Laptop for Programming in 2026: 14 Picks by Specs |
| You build web applications and need a balance of portability and performance | best-laptops-for-web-development | Best Laptops for Web Development in 2026: 14 Picks by Specs |
| You run containers and virtual machines regularly | best-laptops-for-docker-and-virtual-machines | Best Laptops for Docker and Virtual Machines in 2026: 14 Picks |
| You are a computer science student who will carry the laptop to class | best-laptops-for-computer-science-students | Best Laptops for Computer Science Students in 2026 |
Questions
Can I transfer files with a USB cable?
Yes, if both laptops support the right USB standard, but an external drive is often easier. Check the port support on both machines with the laptop ports guide.
Should I copy installed programs or install them fresh?
Install fresh. OS versions and package dependencies differ, and program folders often contain machine-specific paths. For example, Visual Studio Code's requirements page says the editor download is small, so reinstalling is simpler.
How do I move SSH and GPG keys?
Copy the key files over a secure channel, set the correct permissions, and test the connection before deleting the old copy. If you use a password manager, sign in on the new laptop and let it repopulate your logins.
What about Docker images?
Do not copy image layers. Rebuild from your Dockerfile or pull images on the new machine. Copy named volumes or database dumps if they contain data.
Which files should I not copy?
Skip temporary folders, dependency directories, and generated files. You can recreate them with a package manager. If you are unsure about a folder, copy it to an external drive and decide later.
How long should I keep the old laptop?
At least a week after you verify the new machine builds your projects, connects to your services, and lets you sign in to everything you use.
Is it safe to use cloud sync for my SSH keys?
No. Keep private keys out of cloud sync folders and transfer them through a secure channel instead. Your cloud provider may be fine for documents, but credentials deserve tighter handling.
Recent updates
- : First published.