In case of database damage, it can be restored from previous database backup. It is required to have valid database copy. To restore the database:
1. Make sure, that the database is stopped:
/etc/init.d/XoperoServer.sh stop
2. Change the name of XoperoServer.sh:
Go to: /etc/init.d/ directory
enter command: mv XoperoServer.sh XoperoServer.sh1
3. Before the next step, you need to check status of the service - (this command should return no processes):
ps aux | grep opero-mono
If the mono service is running, use the command: kill [port where the service is running] eg. kill 14692.
4. Run the PostgreSQL database instance without Xopero applications:
/etc/init.d/XoperoServer.sh1 postgres_start
5. Verify, that the database is started - (Only one result should be returned):
#ps aux | grep 'postgres' | grep 'Xopero'
6. Log in to the PostgreSQL:
/etc/init.d/XoperoServer.sh1 psql
7. Check if the database is empty:
SELECT count(id) FROM public.files opero21;
Exit: [Ctrl] + [z]
Check, if you can find opero21 on the list. If so, you have to verify, if it's a empty database (created automatically during qpkg package installation) or it's a proper database (in this case the database is propably not damaged). The easiest way to verify it is by using above commands. Empty database should return 0.
If the output is different than 0, the database is not empty and it is necessary to check its content before proceeding. If the output is 0, you can delete empty database by using command:
Go to: /share/CACHEDEV1_DATA/.qpkg/Xopero/postgres95
and enter the command: ./exec.sh dropdb -U postgres -p 5433 opero21
8. Creating an empty database:
$createdb -U postgres -p 5433 opero21
9. Import of the database dump:
./exec.sh psql -U postgres -p 5433 -f {dump localization} opero21
e.g. ./exec.sh psql -U postgres -p 5433 -f /share/CACHEDEV1_DATA/dump.sql opero21
10. Change the name of XoperoServer.sh1:
Go to: /etc/init.d/ directory
enter command: mv XoperoServer.sh1 XoperoServer.sh
11. Start the application:
/etc/init.d/XoperoServer.sh start
Comments
0 comments
Please sign in to leave a comment.