How to extract and restore necessary files in Kubernetes
Introduction
This article provides a guide on how to identify and remove unnecessary files, how to reinstall the deleted files, and details about the backup and restore processes in Kubernetes.
Prerequisites:
Ensure you have the necessary permissions to access the Bold Reports deployment location and associated databases. This includes read, write, and delete access for both the file system and database operations within the Kubernetes environment.
Procedure for Kubernetes(K8’s):
1. Data Backup
-
Bash into the container using the command below on Server 1.
kubectl exec -it <pod name> -n bold-services -- bash
Note: Replace <pod_name> with the actual name of your pod.`
-
Navigate to the app_data folder. This folder contains critical application data.
cd ../../app_data/
-
Before zipping the app_data folder, you can delete unnecessary files to save space. These files can be reinstalled later.
-
The files below are unnecessary :
- Optional Client Libraries
- These libraries are required for specific functionalities within the Bold Reports server. Bold Reports supports Oracle, PostgreSQL, and MySQL databases, enabling connections to their respective SQL database variants.
- Navigate to the app_data folder as shown in the following screenshot.
- Enter the below command to remove the optional libraries:
rm -r optional-libs/
- Puppeteer:
- In Bold Reports, Puppeteer is used for tasks such as exporting data visualization items. Chromium packages are necessary to achieve image and PDF export functionalities in reports, schedules from Bold Reports. Without these packages, the image and PDF export options in reports and schedules will no longer be available.
- You can find the files at the following location: app_data/reporting/exporthelpers.
- You can remove the puppeteer by the command below:
rm -r puppeteer/
- Optional Client Libraries
-
After removing those unnecessary files, navigate to the app_data directory. Zip the app_data folder using the following command, where app_data.zip is the file name and app_data is the folder name.
zip -r app_data.zip app_data/
-
Exit the container and run the following command:
kubectl cp < bold-services pod name>:/application/app_data.zip /<backup folder name>/<backup file name> -n bold-services
e.g
kubectl cp reports-web-deployment-5bdd7bb-x9j16:/application/app_data.zip /test/app_data.zip -n bold-services
2. Backup Database
You need to take a backup of all the databases used in Bold Reports applications. Please follow the steps below to backup the databases:
-
Use pgAdmin to connect to the PostgreSql Server on Server1.
-
Expand Databases and select the database(s) used by your Bold Reports applications.
-
Right-click on the database and select Backup.
-
In the Back Up Database window, select the browse option for the file name.
-
Select the folder and enter a file name that matches the database name with a .sql extension, then proceed by clicking Create.
-
Click Backup to complete the backup process.
3. Restore
-
Restore the zipped files on Server 2 using the following command:
kubectl cp <source_path> <destination_pod_name>:<destination_path> -n <namespace>
e.g
kubectl cp "/test/app_data.zip" reports-web-deployment-5bdd7bb-x9j16:/application/app_data/ -n bold-services
-
Unzip the zipped folder (app_data.zip) inside the app_data directory using the following command, and replace the existing folders and files in the app_data directory with those from the unzipped folder.
unzip app_data.zip
-
You can reinstall the removed files by restarting the container. Follow the command below to restart the container:
kubectl rollout restart deploy id-web-deployment -n bold-services
4. Restore PostgreSQL Database Using pgAdmin
- Open pgAdmin and connect to the database on Server-2.
- Select Databases, then right-click and choose Restore Database.
- In the Restore Database window, select the browse option in the file name field.
- Select the backup file you want to restore, then click “Select.”
- Click Restore to initiate the restoration process.
Update database connection string in Bold Reports
-
Bash into the container using the command.
kubectl exec -n bold-services -it <id web pod name> -- bash
-
We need to update the database connection string in the config.xml file located at application/app_data/configuration.
-
Create a new folder named app_data/configuration in the utility, as shown in the screenshot below.
-
Copy the config.xml and privatekeys.dat files from application/app_data/configuration and paste them under utilities/adminutils-1865244183/app_data/configuration.
-
Navigate to the utility directory in the command prompt and run the following command:
Syncfusion.Server.Commands.Utility.dll dbconfig -servername “localhost” -databasename “BoldReportsMasterDatabase” -u “Admin” -p “Admin@12345” -iswindowsauthentication false -sslenabled false -port “25060”
Command details:
Servername – Server hostname/IP
Database name - database name (IDP)
u – server username
p – server password
iswindowsauthentication – Is windows authentication required (this is optional)
sslenabled – Is encrypted connection required (this is optional)
-
Once it runs successfully, copy the config.xml and privatekeys.dat files from adminutils-1865244183\app_data\configuration in the utility folder and replace them in application/app_data/configuration on Server2.
-
Check and update Ip address or localhost port in the config.xml file and product.json under application/app_data/configuration on Server-2.
-
Restart the entire deployment using the following command:
kubectl rollout restart deploy -n bold-services
-
Go to site listing page of UMS application.
-
Go to settings and change the site url with your domain name like below
-
Now, your report sites will launch with your existing data.
See Also
- How to migrate one sever to another server using SQL database
- How to migrate one server to another server without using database
- How to migrate Bold Report Server with database in Azure App Service
- How to migrate EC2 instance windows server with postgresql
- How to migrate from one syncfusion single tenant server to Bold reports multiple tenant server in azure blob storage
- How to extract and restore necessary files in Docker
- How to Extract and Restore Necessary Files on a Bold Reports Windows Server