forewarned is forearmed!
read everything that you can; on here, kellymom, BfN etc, get the numbers for your local NCT breastfeeding counsellors or the NCT helpline, BfN, LaLecheLeague etc, find out if your hospital is "Baby Friendly" and who the infant feeding co-ordinator is and where the local drop in support groups are.
I'd also suggest babymooning as much as possible in the first week or so. I had an elective with DD and was in a side room for three days; I think being able to just have her right next to me for those few days, with no outside influence or the need to be up and about and entertaining visitors really helped get things off to a flying start. Lots of skin to skin as well especially if you are finding things tough.
I think, based on my own experience, that having had a bad time last time around, you will be more in tune to what is happening this time round and more likely to succeed as a result.
I gave up at about 6 weeks with DS1, constant pain, badly cracked nipples, everyone said latch was fine etc etc. when I was pregnant with DD I found MN and hung around on the BFing boards pretty much all through my pregnancy and when she was born I was determined to get it right. It wasn't easy, but knowing that there was support here (and in RL at a local baby cafe and supportive HVs and MWs) and knowing that problems are soooooo common and that they can be got through, I did and went on to feed her until she was 10 months, only stopping because I was pregnant again and my supply dipped, it was bloody sore, made me feel horribly ill and she went off it.
DS2 is nearly a year and we're still going strong
good Luck