1630s, "in a hopeful manner, with grounds of expectation for success," from hopeful + -ly (2). As a replacement for the admittedly awkward it is to be hoped that, attested from 1932 but avoided by careful writers.
c. 1200, "full of hope," from hope (n.) + -ful. From 1560s as "having qualities which excited hope." As a noun, "one on whom hopes are set," from 1720. Often ironic in colloquial use, of willful or incorrigible offspring. Related: Hopefulness.
common adverbial suffix, forming from adjectives adverbs signifying "in a manner denoted by" the adjective, Middle English, from Old English -lice, from Proto-Germanic *-liko- (cognates: Old Frisian -like, Old Saxon -liko, Dutch -lijk, Old High German -licho, German -lich, Old Norse -liga, Gothic -leiko); see -ly (1). Cognate with lich, and identical with like (adj.).
Weekley notes as "curious" that Germanic uses a word essentially meaning "body" for the adverbial formation, while Romanic uses one meaning "mind" (as in French constamment from Latin constanti mente). The modern English form emerged in late Middle English, probably from influence of Old Norse -liga.
Old English þancful "satisfied, grateful," also "thoughtful, ingenious, clever;" see thank + -ful. Related: Thankfully; thankfulness. Thankfully in the sense "thankful to say" is attested by 1966, but deplored by purists (compare hopefully).
<a href="https://www.etymonline.com/word/hopefully">Etymology of hopefully by etymonline</a>
Harper, D. (n.d.). Etymology of hopefully. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/hopefully