Scripts
A collection of scripts relevant to the AppServer
migrate-xmpp-to-appserver.py
This script migrates all the notifications from the old XMPP server to the new AppServer.
Requirements
- Running HSQLDB instance holding data from XMPP server (Please stop the XMPP server before proceeding)
- Running instance of Management portal to query any missing properties
- Running instance of AppServer to add the data using REST endpoints.
- Libraries required by the script are written to requirements.txt
Usage
- Install the dependencies using pip. It is recommended to use a virtual environment.
pip install -r requirements.txt
- Run the script with
--helpor-hto display the help and usage options.➜ python3 migrate-xmpp-to-appserver.py --helpusage: migrate-xmpp-to-appserver.py [-h][--hsqldb-connection-url HSQLDB_CONNECTION_URL][--hsqldb-properties HSQLDB_PROPERTIES][--hsqldb-driver-path HSQLDB_DRIVER_PATH][--managementportal-base-url MANAGEMENTPORTAL_BASE_URL][--managementportal-user MANAGEMENTPORTAL_USER][--managementportal-password MANAGEMENTPORTAL_PASSWORD][--appserver-base-url APPSERVER_BASE_URL][--appserver-enable-auth APPSERVER_ENABLE_AUTH][--appserver-client-id APPSERVER_CLIENT_ID][--appserver-client-secret APPSERVER_CLIENT_SECRET][--project-mapping-file PROJECT_MAPPING_FILE]Provide the values for various configs.optional arguments:-h, --help show this help message and exit--hsqldb-connection-url HSQLDB_CONNECTION_URLThe JDBC connection URL for HSQLDB (default:jdbc:hsqldb:hsql://localhost:9001/status)--hsqldb-properties HSQLDB_PROPERTIESHSQLDB connection properties as a dict. (default:{'user': 'SA', 'password': ''})--hsqldb-driver-path HSQLDB_DRIVER_PATHHSQLDB JDBC driver Jar file path. (default:./hsqldb.jar)--managementportal-base-url MANAGEMENTPORTAL_BASE_URLBase URL where the Management Portal is exposed.(default: http://localhost:8081)--managementportal-user MANAGEMENTPORTAL_USERThe user to authorise with using password grant code.(default: admin)--managementportal-password MANAGEMENTPORTAL_PASSWORDThe password for the user to authorise with usingpassword grant code. (default: admin)--managementportal-client-id MANAGEMENTPORTAL_CLIENT_IDThe client id of Management Portal frontend client for authorising with password grant code.(default: ManagementPortalapp)--managementportal-client-secret MANAGEMENTPORTAL_CLIENT_SECRETThe client secret of Management Portal frontend client for authorising with password grant code.(default: )--appserver-base-url APPSERVER_BASE_URLBase URL where the Appserver is exposed. (default:http://localhost:8080)--appserver-enable-auth APPSERVER_ENABLE_AUTHWhether to enable authorization for the appserverclient. (default: False)--appserver-client-id APPSERVER_CLIENT_IDThe client_id of the oauth client with access tores_AppServer resource and client_credentials grantcode. (default: radar_appserver_client)--appserver-client-secret APPSERVER_CLIENT_SECRETThe client_secret of the oauth client with access tores_AppServer resource and client_credentials grantcode. (default: )--project-mapping-file PROJECT_MAPPING_FILEPath to the json file containing project mapping totimezone and language. (default:./project_mapping.json) - Run the script by customising the options specified above according to your needs.