At the start of season 5, in the episode As Long As We’re Together, the Ingalls family, along with the Garvey family, decide to move to Winoka where Mary was teaching at the blind school. Both families were struggling financially in Walnut Grove, and they hoped their lives would be more successful in Winoka.
Only a few episodes later, in There’s No Place Like Home, both families decide to return to Walnut Grove, although they discover that the town is even worse off than it was when they left.
Note, this is for the TV version of the Ingalls family, not the “real life” version.