In this paper, we present AdaptSens: a reliable data collection and storage system for solar-powered sensor networks. Unlike battery-operated devices, solar-powered systems have a less predictable energy supply and their ability to harvest energy depends on past spending, thereby creating incentives for adaptive matching of energy supply and demand. Our storage system is novel in its layered architecture and its incremental layer activation mechanism. AdaptSens provides a set of functions, in separate layers, such as sensory data collection, replication (to prevent failure-induced data loss), and storage balancing (to prevent depletion-induced data loss). The mechanism utilizes surplus energy when available by activating more layers, and resorts to progressively more energy-efficient (partial hibernation) modes when energy is scarce. Best reliability is achieved when all layers are active but meaningful intermediate modes allow different degrees of energy conservation. The efficacy of AdaptSens in trading off reliability for energy is tested on both an outdoor system and an indoor testbed. Evaluation results show that AdaptSens minimizes the sum of all data losses when combining the energy, storage and node failure factors.