Fix a corrupt WSL database
1. |
First WE NEED TO MAKE a BACKUP of the databaseGo to the WebSolarLog/database directory on your server/host Stop WSL; Move the original database; |
|
---|---|---|
2. |
Lets do it!Assuming that you are still in the WebSolarLog/database/ directory, run the following commands; We first run the following integrity command to make sure the database needs some repairs. On the SQLite prompt you run: If the result is OK, the database is not corrupted and needs no further actions. you can quit SQLite by : restore the old database; If you have error messages you could proceed to Next Steps. |
|
3. |
Export Data to plaintext fileTo export the WebSolarLog data to an plaintext sql file, run the following commands: echo .dump | sqlite3 wsl_backup.sdb > wsl_plaintext.sql Now we have a plaintext file with readable SQL data/commands. You could read the file;
nano wsl_plaintext.sql
|
|
4. |
Create a new WSL databaseNow we have a plaintext file with the data, we need to create a new database To create a new WSL database, just run the following command: cat wsl_plaintext.sql | sqlite3 wsl.sdb This command creates a new WSL database with the original data from the corrupt database. |
|
5. |
We are Ready!If there are no errors, then we could start WSL; WebSolarLog/scripts/wsl.sh start |
For further support, please visite our support group;
https://groups.google.com/forum/#!forum/websolarlog