Prerequisites
- Both Linux machines must be turned on and connected to the same Wi-Fi or local network.
- You need to know the password for the old machine.
Step 1: Find the IP Address of Your Old Device
First, we need to find the network address of the old computer so the new computer knows where to look.
- Open a terminal on your old Linux device.
- Run the following command:
- Look for the word
srcin the output. The IP address immediately following it (usually starting with192.168.or10.) is the address you need. Write this down!
Step 2: Enable SSH on the Old Device
To allow the secure transfer of files, your old computer needs to be able to accept incoming connections.
- On the old device, run this command to install the SSH server:
- Enable it to run immediately:
Step 3: Prepare the New Device
Now, move over to your new Linux device. You need to create a destination folder where all your incoming files will be saved.
For example, if you are transferring development projects, create a Projects folder:
Step 4: Run the Rsync Transfer Command
Now for the magic. On your new device, you will pull the files directly from the old device.
Here is the master command. (Be sure to replace username with the username of your old computer, and 192.168.x.x with the IP address you found in Step 1).
What does this command do?
-a(Archive): The most important flag. It preserves your directory structure, user ownership, file permissions, and modification dates.-v(Verbose): Gives you detailed output of what is happening.-z(Compress): Compresses the file data during the transfer, maximizing your Wi-Fi speed.--info=progress2: Shows a clean, real-time percentage bar of the total transfer progress.--exclude: Tells the system to skip heavy, unnecessary files. In this example, we are skipping Python virtual environments (.venv/) and cache folders, which saves massive amounts of time.
Step 5: Enter Your Password and Watch it Sync!
Once you press Enter, the terminal will ask for the password of your old computer. Type it in (you won't see the characters on the screen as you type, which is normal for Linux), and press Enter again.
Your transfer will instantly begin. If your Wi-Fi connection drops for any reason, don't panic! You can simply press the "Up" arrow on your keyboard and run the exact same command again. Rsync is smart enough to pick up exactly where it left off without duplicating files.
Have you tried this method for your server migrations or local device upgrades? Let us know in the comments below!
BY AZZANI
{# Provenance for articles generated from a source document. Rendered here rather than stored in the body so it stays accurate and cannot be edited away, and so the sealed draft stays purely generated. #}
Discussion 0
No comments yet. Be the first to start the discussion!
Leave a Comment
Comments are reviewed before they appear.
Write a comment