The old fashioned way that websites collected usage data prior to Google Analytics was to examine the web server log file. That typically has the time of the request, the IP address the request came from, the page/file(s) requested, if they were successfully served, and the information the browser claimed about itself. They might, if the browser gave it, have the referrer page that the user came from.
There was at one time some open source scripts that could format that information for you and do things like look up a rough geographical area that the IP address was associated with. I guess those may still be around somewhere as the basic technology and layout of web server log files hasn’t changed in a long, long time.
I don’t know how others deal with log files on their servers but I have mine set to rotate the logs nightly and only keep the last week’s worth. And I gave up trying to analyze my visitors long ago. So all my sites are private and if I get a subpoena I only have the last week worth of data to hand over. Given that my sites have very innocuous things on them I’d be really, really surprised if any authority would ask what my visitors have been.