...
Get the latest backup from lab2.ikartab.se (target of the daily auto backup) to local computer
Code Block language bash #replace <username> with your usernamne ssh -p 13738 <username>@lab2.ikartan.se cd /opt/backups/database ls exit #Now, you can select the backup to use #copy the file scp -P 13738 <username>@lab2.ikartan.se:/opt/backups/database/2023-10-10_01-00-05-sive.backup C:\opt\Ikartan
Start Dbeaver and read in the backup file into a database.
Start Dbeaver
Connect to test.ikartan.se
Right click on “Databases” and select new database
Enter a name e.g. siv_new (must be a name that not exist)
Right click on the new database e.g. siv_new and select tools/restore
Browse for the backup e.g. C:\opt\Ikartan\2023-10-10_01-00-05-sive.backup
Press Start button and the restore begins
Log in to test.ikartan.se and stop Weave and Geoserver to release all connection to the present database we will replace
Code Block #Seco clieent must be running ssh -i C:/Users/sven-/.ssh/id_ed25519 b30502@10.202.8.12 Enter passphrase for key 'C:/Users/sven-/.ssh/id_ed25519':<your locla password for the ssh file> b30502@viamap-ikartan-test02:~$ #stop weave service sudo systemctl stop weave.service #stop Geoserver sudo systemctl stop geoserver.service
Use Dbeaver to rename databases
Code Block language sql -- Problem of database that is still connected! Try this-. SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity
Right click on the present database e.g. sive and select rename
Enter another name e.g. sive_23-10-01
Click Persist when the SQL command is shown
Now right click on the newly restored database e.g. siv_new and select rename
Rename this database to the same name as as the previous database
Start Geoserver and Weave
Code Block sudo systemctl start geoserver.service sudo systemctl start weave.service
...