This tutorial will provide a quick guide how to backup your data and delete old date like calls, calls failed and chats from database in Linux
Note |
---|
Please notice that you can do this at your own risk and we do not take responsibility for any damage caused by incorrect use of scripts or managing database !!! |
Info |
---|
If you have any issues following the below tutorial we can delete the date for you and you can contact our sales for such additional support service. |
1. Make full backup of all databases
...
To create the backup use the commands below one by one in the console:
Note |
---|
Please make sure that after every backup the echo command will return 0 (backup is valid) The echo command can return 3 results: 0 for Success |
Code Block |
---|
mysqldump -u root --databases api > /home/20240207/api.sql echo $? mysqldump -u root --databases bi > /home/20240207/bi.sql echo $? mysqldump -u root --databases storage > /home/20240207/storage.sql echo $? mysqldump -u root --databases invoices > /home/20240207/invoices.sql echo $? mysqldump -u root --databases voipswitch > /home/20240207/voipswitch_full.sql echo $? mysqldump -u root --databases core > /home/20240207/core.sql echo $? |
Info |
---|
If you just want to clean the calls/callsfailed data only voipswitch and bi databases have to be backed up, but we always advice to make full backup |
Code Block |
---|
echo $? |
To check the backup progress you can use a second instance of SSH and check MySQL status:
...
2. Delete data from voipswitch database
Infonote |
---|
Before deleting any data from database always make sure that you have a valid backup!!! If you delete the data without backup the data is lost and can not be recovered!!! |
Info |
---|
Please notice that deleting data from database can take few minutes or few hours. All depends how big is your current database. |
...