How to Migrate a Server to Another Server and Restore Necessary Files in Docker
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 Docker.
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 Docker environment.
Procedure for Docker:
1. Data Backup
-
Bash into the container using the command below on Server 1.
docker exec -it <container name> bash
Note: Replace <container_name> with the actual name of your container.
-
Before copying the data, 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 and 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: application/app_data/reporting/exporthelpers.
- You can remove the puppeteer by the command below:
rm -r puppeteer/
-
-
Navigate to the docker-compose.yml file .
-
In the volumes section, the path for storing data have already been set. You can copy the folder from this specified path.
Note: In case you have not set the path in the Volume section, the files and folders will be placed in the default Docker volume path at this location: /var/lib/docker/volumes/
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
-
You can move the copied folders and files to the path mentioned in the Volume section on Server2. If no path is specified, move them to Docker’s default volume path (/var/lib/docker/volumes/)
-
You can reinstall the removed files by restarting the container. Use the following command to restart the container with the specified container ID:
docker restart <id_web_container id>docker restart 17200a26581f
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.
docker exec -it <id_web_container_id> 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 all the container using the following command:
docker ps docker restart <container ID or container name>
-
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 on Windows
- How to migrate one server to another server without using database on Windows
- 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 Migrate a Server to Another Server and Restore Necessary Files in Kubernetes
- How to Migrate a Server to Another Server and Restore Necessary Files in Windows Server