I recently found out about the Battle of Diamond Rock in 1805 and it is IMO one of the most unique naval battles in the Age of Sail. Anyways, in this illustration it shows the HMS Centaur and what seems to be a few other rowboats hauling up a cannon by Diamond Rock's summit by hauling it up to the summit while it's suspended by a cable lashed to the base of a ship's mainmast.
Did crewmembers have to get up on top of the summit from a safer and more gently sloping point to first throw the cable down so it could be lashed to the mainmast's base? Were the rowboats in the picture there for extra support? What did they attach the cable on the summit to? (a boulder, tree?).
I've never heard of this method of fortifying a place during the Age of Sail, and I'm not sure if this event is only unique to Diamond Rock.
I can't site any specific examples, so I may get deleted, but anyways... The 24 pounders that HMS Centaur were packing on its upper deck weigh 2500 kg each (the truck it sits on another 400 kg) and throw its shot ~2 miles at sea level, although at that range it wouldn't be expected to penetrate the hull of anything more than a sloop. Typically effective penetrating range would be at ~1 mile or less. However, if you were on land and maybe 50-60 ft above sea level in a fort you could throw your shot maybe another mile. Now add a few hundred feet of cliff and you've maybe gained yourself another mile of range. Thats more than enough to cover a harbour/anchorage and a good part of its approach.
While again the cannon shot loses a lot of its velocity well before your new 3 mile range and wouldn't penetrate a 3rd rates hull, now you're 200' up and that shot is coming down. Naval vessels back in the 18th and 19th centuries were heavily planked against shot coming from a broadside. Not from plunging fire. Oh and by the way you can plink away at that frigate for 2 miles more than it can return any effective fire, meanwhile your're turning its upper decks (and crew) into swiss cheese and so much splinter hamburger.
So when your enemy finally gets within range to return fire (under two miles) they discover they can't - they can't elevate the guns high enough, even with unshipping the back wheels off the trucks. Aaaand if they do that, they can only fire each gun once because when it fires it will dig a nice groove in the deck and now it can't be run "in" to swab, brush and reload (remember these are all muzzle loaders) ... because two of the wheels are missing.
Even if the gun crews on that frigate manage to overcome all these problems, they'll probably miss - they're bobbing up and down on a floating vessel. You're on solid ground, your accuracy is amazing and you hit almost every shot assuming your gun captain is up to snuff.
So you can see how having cannons up high on land is a big deal. See various famous harbour fortresses like Citadel Hill/Fort George in Halifax. - never really attacked because everyone knew to do so would end very very badly.
As far as how they get the cannons up there, like you said landing them on a beach would be the easiest way. Problem is the wheels on naval gun trucks were small (space, weight) and practical given they're designed to run guns in and out on a hard surface like a wooden deck or a stone fort battlement. And these cannon were heavy, never designed for portability; once its in its place on deck, it was unlikely to ever be moved from its position. Field artillery of the time was much lighter (and thus much smaller shot/caliber or less range) and had bigger carriages with those big spoked wheels. Oh and they have a team of 4 horses to drag it around. You're 4,000 miles and 3 months from home and you didn't have room to pack a gun carriage team in the hold. So you'll have to use able seaman and marine power to lug that behemoth from the beach to the top of the cliff. Much easier to rig some rope, block and tackle and haul it straight up the cliff face.
The ship's boats with the additional lines would be there to keep the gun steady on its journey; the ship is bobbing up and down, the wind catches the gun (2,500 kgs!), the last thing you want is a swell or gust of wind to give a burst of slack, then sudden tautness (or any other type of undamped oscillation) in the lines to rip the rope out of the hands of the men hauling it up.
Its not any kind of historical citation, being a dramaticized adaptation of a fictional account and all, but if we're talking about hauling naval cannon up cliffs, they do it in episode 6 of A&E's Horatio Hornblower series. which if you haven't seen it is quite good (based off CS Forrester's book series of the same name.)