r/ComputerEngineering • u/[deleted] • Aug 25 '23
[Hardware] Can you (without damaging either) connect two pc's with a double USB-cable?
I want to transfer data from my 'old' computer to my latest. I'm missing an extra keyboard and monitor so.... connecting through USB sounds like a plan to me. I can do it with my phone so why not.....
.... can you tell me why not?
P.s.: Yes I do have an official USB cable with two same plugs. Not sure why though.
A better suggestion would be welcomed. We are talking about 5 Gb of data I guess.
11
u/MahaloMerky Aug 25 '23
You can’t with a USB cable, it just does not work. You can with an Ethernet cable or over the same network connection.
Also if it’s 5GB, just use a flash drive or something it will be a lot easier.
5
u/EschersEnigma Aug 26 '23
I mean, there is plenty of easily-executed COM server/client code out there which would enable this, given a bridging USB cable specifically. It's absolutely 100% not the ideal or appropriate solution, but it does technically work.
6
u/Techmoji Aug 25 '23
A thumb drive would probably do the trick.
Also you can connect both computers to your router or switch for network sharing. Also you can hook them directly up to eachother with Ethernet.
1
u/Skycandy_ Aug 26 '23
It would do nothing, because unlike your phone the usb controllers on PCs arent programed to allow for file sharing like that Use one drive its free for like 2-300 gb and just pick and choose data, its lossless iirc.
Or take out the hard drive and then buy a sata to usb cdongle and use it as a usb stick.(fyi if the drive in the pc is 3.5 in then you're gonna need a dongle that supports that)
1
u/gHx4 Aug 25 '23
The easiest way is with a USB flash drive.
There are some ways to transfer files using an ethernet cable (CAT 5e or CAT 6), which depend on how the PC's network card behaves. As long as you can configure it as both a DHCP client or server, it works fine. Set up one of the PCs as an sftp server, then use an sftp client program on the other. Or you can connect using SSH to transfer a file with SCP. Lots of options if you can use an ethernet cable.
But you can't use a USB cable to connect two computers (outside of using very specific hardware and software).
1
u/bigger-hammer Aug 26 '23
> can you tell me why not?
Because a USB connection requires a host and a device - normally the host is a PC and the device is whatever you're connecting to it. A host can't communicate with another host and a device can't talk to another device. The protocol is that the host controls the communication - it sends data out and it requests data back, a device can't just send a message. So the host is always in control. Two hosts would want to control each other and 2 devices never talk.
There is an important exception to this rule. Some devices can be both host and device (but not at the same time). Most phones can do this - when they are connected to your PC, the phone behaves as a device but, if you connect the phone to a printer for example, it becomes a host and the printer is the device. Note that the rule is still that a USB connection is between a host and device, it is just that the phone decides which to be when the connection is first established.
Just to round up this USB description, there is a 3rd class which is a Hub. A hub connects multiple devices to one host. You can't connect multiple hosts with a hub and the devices can only talk to the host (not to each other).
Moving data between PCs is a job for a USB stick (which is a USB device by the way) or a network connection.
3
u/Alacard Aug 26 '23
Not sure why people are telling you a "Computer to Computer USB Transfer" isn't a thing when it certainly is. There is even a WikiHow article, so not sure what's going on here.
If you paid me at a shop, I would take your old computer's hard drive out & secure it in your new computer. This solves several issues:
Physically secures the previous drive's data
Nothing is missing
Fastest to be "done" with "moving" data
The old machine can be donated/sold/trashed.
That being said, the vast majority of people would just purchase a 20$ usb thumb drive to move the data from one computer on to another. This works nearly all the time and is the simplest method.