I had a similar issue. My solution was to go to the wp-config.php file and change the host, database, username etc.
For example, when I was working locally, my database was “localhost” but now it is one that I set up through my hosting service.
Hope that helps!