Project

General

Profile

Helper Scripts » History » Revision 6

Revision 5 (Enis Nuredini, 23.08.2023 10:48) → Revision 6/15 (Enis Nuredini, 23.08.2023 10:48)

h1. Helper Scripts 

 h2. Backup project folder and both DBs 

 *tear_down_project.py*   
 Functionality: Creating backup file from project folder and databases (data and typo3). Transfering files to /scratch/tmp/365/. Comprimising all files in one tar. Deleting all created files during this process (except the summary tar file). 

 Requirement: User should have ssh keys for the affected server hosts. 

 Configuration: In the top of the script the project and database host can be written. Path to the ssh keys is set as default. 

 

 h2. Transfer specific records from DB1 to DB2 

 *table_groupmember_reference_transfer.py* *table_groupmember_reference_transfer*  
 Functionality: User given argument will be searched in configured column (default: reference) from table (default: GroupMember). All found records are transfered from source DB to target DB. If record with given argument exists on target DB then UPDATE statement is executed, otherwise INSERT statement. 

 Requirement: Table structure from source and target DB must be identical. Date and datetime defaults, if nothing given in source record needs to be NULL, otherwise mysql outputs an error. 

 Configuration: DB-users, hostnames and affected table or column can be set inside the script.