If you're talking about an aluminum iMac, getting to the HDD involves removing the built in display monitor to be able to get behind it. YouTube seems to have several video walk-throughs that show the process (including this one; the link is to the first part). Additionally, a quick search turned up a site with written, step by step instructions. The process seems too complex to provide here.
If you're comfortable with this level of complexity in hardware repair, then the video or text walk throughs should help you. I suspect, all things considered, if you're not confident enough to perform the upgrade yourself just by looking at videos of others who have done it, then this probably falls into the class of "take your iMac to your local Mac service centre and get them to do it": yes, it will cost you money, but they can also guarantee their workmanship...
Approach this in either of two ways, depending on the size of your old drive and your new drive. The second is quite involved and requires a lot of technical know how.
Method one:
Buy a new drive with an enclosure. Replace the failing drive with the new one. Put your old drive in the enclosure, install Mac OS X on the fresh drive and transfer your data from the old drive.
However that is not what you requested.
Method two:
The second method is to use the dd command and ssh via terminal. The two machines will need to be on the same network, and will need to be able to see each other.
I've looked up both your machines on everymac.com and will assume that your dying drive is 500GB and the new one has 1TB.
You will need more than 600GB of free space on the new machine for this to work and you need to know what you are doing.
You need to download and burn a copy of any selfbooting Linux distribution (I have tested this with an old copy of Ubuntu 12.04 I have lying around).
Once you have the disk burned you need to boot your dying machine with the DVD/CD you just created by holding the alt key while your machine reboots, then selecting the media in your DVD drive to boot from.
You will need to set up your old iMac on your network, I would use cables rather than wifi (because there is less to go wrong and it is easier).
Make sure both your old and new machines can "see" each other via ping.
On your mac open System Preferences>Network>Ethernet
.
Configure the IPs:
I used the IP 10.10.0.1 and subnet mask of 255.255.0.0, on the "Linux" mac I used 10.10.0.2 with the same subnet mask. From the command line on either machine you should be able to ping 10.10.0.1 and 10.10.0.2 before you proceed to the next step.
Enable remote login on your new machine.
Find the partition on your old mac you want to copy via Linux command line. This is most probably going to be /dev/sda
You will need to be root on your "Linux" machine so do sudo -s
From your old machine (Linux) issue the command (via the shell):
dd if=/dev/sda | gzip -1 - | ssh user@hostname dd of=image.gz
This assumes that the drive on your old machine you want to copy is called /dev/sda
, you will need to replace user with your username on your new machine, and hostname is the IP address of your new machine.
The command will take a long time as it copies your old disk perfectly to a new image on your working iMac.
Once you have replaced the old disk on the failing machine you can restore the image by booting Linux again and issuing the following command:
ssh user@hostname dd if=image.gz | gunzip -1 - | dd of=/dev/sda
This will take the created image and put it on your new harddrive.
Best Answer
It's garbage to say that no reseller would touch it. I think you will find that any repair outlet, authorised or not, would gladly take your dollars in exchange for some service.
Having said that, they will charge, and while it's not a particularly easy Mac to repair, if you have basic screwdriver skills and the nerve to do it, you can fix this up youself just fine. I have the a similar machine, and did it myself.
You'll need to take a look at the guides on iFixit to know exactly what you need to do to replace the hard drive (and yes, it does sound like a hard drive fault to me also). The scariest bit is removing the glass and screen, as you'll need various tools such as suction cups etc (all explained in the guides).
While you are fixing it up, the single most useful upgrade you can do to give this elder statesman a shot in the arm is install an SSD instead of a regular HD. Trust me, it will be like a whole new machine!