I'll share our story since it is similar in some ways. When we got our first townhouse we knew it wasn't going to be the forever place, and we had a 5-year plan in place to save and upgrade to a nicer area. We started putting our downpayment savings into a mix of intermediate and short-term bond funds. I still think it was the right decision (conservative) on where to put money that we felt we would need relatively soon.
In the interim we had the crazy stock market run-up in the 2009+ timeframe and we missed out on substantial gains by having that money not in the market. However, the market could have easily gone down or done nothing in that time frame, so that has no bearing on whether it was a good decision or not.
Looking back on it though, I think we should have spent more time thinking about our goal. The 5-year plan sounded like a good rule of thumb, but really, there was nothing really pushing us to keep to that timetable. What we are doing now is that we want to eventually buy some place, but we have all of our money in the stock market. The reasoning is thus: we don't HAVE to move any time barring our landlords doing something uncharacteristic for them. Even if we did get booted out, that is not a reason to buy but merely find another place to live. If we don't HAVE to buy on a timeline, then we are free to buy when a) we find a good place for us and b) the market has not dumped. Your risk appetite might be very different, and that is fine. I'd encourage you to put a lot of thought into your goal and your timeline to make sure they are appropriate, and then figure out what place to park your money accordingly.