Issue
A streamlined and automated method is needed to move Enterprise Server (ES) backup files when the program is installed on the D:- drive and program data is stored on the C:- drive.
Product Line
EcoStruxure Building Operation
Environment
Building Operation Enterprise Server
Cause
There may be operational or storage-related reasons to move or archive backup files. Installing the program on the D:- drive while retaining data on the C:- drive offers several benefits.
Benefits of Separating Installation and Data Drives
✅ Storage Optimization
The D:- drive often has more available space, allowing larger installations without impacting system drive capacity.
✅ Performance Improvement
Separating installations from data can improve performance, especially if the D:- drive is a faster SSD.
✅ Simplified Backup and Recovery
Storing data on the C:- drive simplifies backup and restore processes, avoiding the need to include the entire program installation.
✅ Improved File Organization
This separation leads to a more structured file system, making application and data management easier.
Resolution
It is recommended to initially save backups in the default ProgramData
folder on the C: drive and then move them to the D:- drive using a scheduled PowerShell script.
PowerShell Script Example
# Set variables
$Now = Get-Date
$Days = 5
$TargetFolder = "C:\\ProgramData\\Schneider Electric EcoStruxure\\Building Operation X.x\\Enterprise Server\\db_backup\\LocalBackup"
$Extension = "*.xbk" # Backup file extension
$LastWrite = $Now.AddDays(-$Days)
$BackupLocation = "D:\\BackupArchive" # Destination folder for old backups
# Ensure destination folder exists
if (!(Test-Path -Path $BackupLocation)) {
New-Item -ItemType Directory -Path $BackupLocation | Out-Null
}
# Move files older than $Days to the backup location
Get-ChildItem -Path $TargetFolder -Filter $Extension -Recurse |
Where-Object { $_.LastWriteTime -le $LastWrite } |
Move-Item -Destination $BackupLocation -Force
💡 Tip: You can enhance this script with features like file compression, logging, or automatic cleanup of obsolete backups.
Automation Recommendation
Use Windows Task Scheduler to automate the script execution.
📘 How to schedule PowerShell scripts