Back pain can ruin activities that are supposed to take your mind off things, especially in the summer. While some movement can be good for your upper body, there's no guarantee that your back won't act up while you're on a hike. To handle this, you may need to prepare yourself beforehand and be ready to act if a potential symptom proves serious.
One of the big issues with hiking is, of course, the backpack. Serious travelers will likely have a lot to bring with them, and if you're one of those people you'll need a strong back to take on that heavy load.
A LiveStrong article on the subject recommends carrying a backpack around as practice before the hike itself, adding your gear to it slowly instead of starting with all of it on at once. The source also advises exercising the gluteus muscles and legs to build up enough strength.
Just because you aren't backpacking doesn't mean you shouldn't stretch beforehand, though. There may not be anything physically on your back when trail running, but this exercise can also put your body through some intense paces. As with the backpack strategy though, working gradually may help you get used to this exercise more easily.
Before you embark on any strenuous activity, you may want to consult a chiropractor for advice on how to keep in good shape. Above all, it's important to pay attention to your aches and pains, and avoid putting yourself through more than you can handle at once. Remember, you're more likely to enjoy the activity anyway if you're not putting yourself into agony while doing it.