screen-scraper is telling me that it can't connect to its database or that the database is corrupted. How do I fix this?
When screen-scraper gives this message it generally indicates one of two things. The first possibility is that some other software, such as an anti-virus or firewall application is disallowing screen-scraper from opening sockets between local processes. The second possibility is that the main screen-scraper database has become corrupted. This might happen if your computer crashes while screen-scraper is running, for example. Fortunately, as of version 2.8 screen-scraper will automatically back up your database periodically. Even if your database has become corrupted, it's likely you haven't lost much work.
If the error is caused by the first problem the solution is to update your anti-virus/firewall application to allow screen-scraper to open local sockets. Generally the application will prompt you to allow this. Note that just after you see this message, even if you indicate that screen-scraper should be allowed to open sockets, you'll still likely need to manually kill screen-scraper's database process, then start screen-scraper again. You can kill screen-scraper's database process by ending any java.exe, javaw.exe, screen-scraper.exe, server.exe, java, or javaw processes running on your machine that might correspond to screen-scraper. You can kill processes on Windows using the Windows Taks Manager. Be sure to view processes from all users.
Before attempting to restore from a backed up database be aware that the database structure could change between versions. For example, if you were to take a database that was backed up under version 5.0, and attempt to restore it to a screen-scraper instance that is at 5.5 or higher you'd encounter problems. As a general rule, you can only restore a database backup within the version you're at (i.e., a 5.0 backup database can only be restored to a 5.0 instance of screen-scraper).
To fix a case where your database has become corrupted, read on. In the directory where screen-scraper is installed (e.g., "C:\Program Files\screen-scraper professional edition"), you'll find the following directory path: "resource/db/backup". This "backup" folder should contain a series of folders with dates and times, each of which will contain a backup of your database. You'll use these to restore your database, by following the steps below:
- Ensure that screen-scraper is not running. This would include the workbench, server, and any command line instances you might have running.
- Kill any java.exe, javaw.exe, screen-scraper.exe, server.exe, java, or javaw processes running on your machine that might correspond to screen-scraper. It's possible that the screen-scraper database process could still be alive, which would lock the database files. You can kill processes on Windows using the Windows Taks Manager. Be sure to view processes from all users.
- Delete your existing database files. These are located in "resource/db", and all begin with "ss".
- Copy the database files from the most recent backup folder into the "resource/db" folder. For example, you might copy all of the files beginning with "ss" from "resource/db/backup/September 8, 2006 09.23.31 AM" into "resource/db".
- Try launching screen-scraper. If everything is normal, you're done. If you get the same "Database Corrupted" message, go back to step 1.