Windows to Linux server migration
To execute DerScanner server migration from Windows to Linux:
On Windows_host:
-
End or wait for all active scans to complete.
-
In the home directory on Windows_host, open the pg_dump file in PowerShell and execute:
C:derscanner\\3rd-party\\PostgreSQL\\13\\bin\\pg_dump -E UTF-8 -f
C:derscanner\\db_dump.sql -U backend backend -
If password is requested, enter the password during connection to DB (located in Environment Variables > System variables > hibernate.connection.password).
-
Transfer the following files and folders to Linux_host:
- C:derscanner\db_dump.sql
- C:derscanner\files\b
- C:derscanner\files\s
On Linux_host:
-
Install the DerScanner system.
-
Copy files and folders from Windows_host to Linux_host for migration to a convenient directory.
-
Stop the web application:
sudo docker stop backend
-
Delete the new deployment database:
sudo docker exec app-db dropdb -p 5432 -h localhost -U backend --maintenance-db=postgres -f -e backend
-
Create an empty database:
sudo docker exec app-db createdb -p 5432 -h localhost -U backend backend
-
Go to the directory with files for migration (db_dump.sql, /b, /s) and migrate the files from the dump:
sudo cat db_dump.sql | sudo docker exec -i app-db psql -p 5432 -h localhost -U backend -d backend
-
Copy the b and s directories:
sudo cp -r s/ /opt/derscanner/app/services/backend/files
sudo cp -r b/ /opt/derscanner/app/services/backend/files -
Restart the APP application service:
sudo systemctl restart derscanner-app.service