Creating Backups of Estos ProCall and MetaDirectory

Sadfully Estos ProCall and Estos MetaDirectory have neither an inbuilt backup functionality nor a scheduler to backup automatically.

After searching the web for a solution I found a German article about moving the service from one machine to another: Move Estos from one server to another

It describes the steps how you can create a backup of both applications and what you have to do to restore them on another machine.

The challenge

You will probably tell me that you don’t want to move the installation to another server but the steps to do are the same. It doesn’t matter if you restore on another server or if you do the restore to just repair a crashed installation. In any case you need a valid backup (hopefully before the server crashes) and you have to know how to restore from that backup.

Estos recommends to use a Microsoft SQL server to store journal entries for installations with more than fifty users. The default and for smaller installations usually used option is to store the journal into a MS Access database. So it is easy to copy the MDB file.

If you use MS SQL usually the database admin should care about planning DB backups. Nevertheless I like to know how to do such tasks to be able to either describe the customer’s admin how to do it or to do it myself. I will not cover that in this article. I will probably check how to do it and add a follow up article.

The implementation

So how to do the backup on a daily basis? The steps to go are pretty easy:

  • Check if a service exists to determine if the backup has to run or not
  • Stop the relevant service
  • Copy the relevant folders to the backup path – at best into a folder with a name like the actual day of the week
  • Start the relevant service again

To automate those steps I prefer to have a scheduled script. I prefer Microsoft Powershell because it is available for every supported Windows version and provides all the features I need.

Usually we want to save our installation every day and keep the backups for one week. Additionally we save it once a week and keep the backup longer. Having backups available for one month should be enough but I like to have older backups as well. I already had situations where a customer told me that a problem had been there for six weeks already…

So first let’s have a look how to stop and start the service we need. You can do that with the Powershell commandlet ‘Restart-Service’. In our case you need to split this into two parts to be able to do the file copy in between stopping and starting the service.

To stop and start a service you need to have local administration rights. So let’s go and open an elevated Powershell window.

To stop and start the ProCall service we use the following commands:

# Stop ProCall service
stop-service eucsrv
# Start ProCall service
start-service eucsrv

Looks easy, right? The parameter ‘eucsrv’ is the real name of the ProCall service. You can get all services together with their by entering ‘Get-Service’ into the Powershell box.

Stopping and starting the service is just kind of an exercise. In between we have to copy the directories that contain the config files and the database:

# Create the folder to backup the application to
New-Item -ItemType Directory -Path C:\Backup\ProCall

# Copy the 'Database' and 'Config' diretory to the backup folder
Copy-Item 'C:\Program Files (x86)\ESTOS\UCServer\database' -Recurse -Destination C:\Backup\ProCall
Copy-Item 'C:\Program Files (x86)\ESTOS\UCServer\config' -Recurse -Destination C:\Backup\ProCall

Not that much, right?

Now let’s combine that into a function we can use within the script later:

function procallbackup {
    # Stop ProCall service
    stop-service eucsrv

    # Create the folder to backup the application to
    New-Item -ItemType Directory -Path C:\Backup\ProCall

    # Copy the 'Database' and 'Config' diretory to the backup folder
    Copy-Item 'C:\Program Files (x86)\ESTOS\UCServer\database' -Recurse -Destination C:\Backup\ProCall
    Copy-Item 'C:\Program Files (x86)\ESTOS\UCServer\config' -Recurse -Destination C:\Backup\ProCall

    # Start ProCall service
    start-service eucsrv
}

We can now simply start the backup task by calling the function:

procallbackup

Or to get a more flexible script we just run the function only if the ProCall Service (it’s name is ‘eucsrv’) exists:

if (Get-Service "eucsrv" -ErrorAction SilentlyContinue) {
procallbackup}

Next we have to create a similar function to backup MetaDirectory. It is done the same way:

function metadirbackup {
    # Stop MetaDirectory service
    stop-service emeta3

    # Create the folder to backup the application to
    New-Item -ItemType Directory -Path C:\Backup\MetaDirectory

    # Copy the 'Database' and 'Config' diretory to the backup folder
    Copy-Item 'C:\Program Files (x86)\ESTOS\MetaDirectory 3.5\databases' -Recurse -Destination C:\Backup\MetaDirectory
    Copy-Item 'C:\Program Files (x86)\ESTOS\MetaDirectory 3.5\config' -Recurse -Destination C:\Backup\MetaDirectory

    # Start MetaDirectory service
    start-service emeta3
}

As you can see it is the same for MetaDirectory as for ProCall. The only difference is that we have different directories and different service names.

Now let’s combine those functions into a script and use a variable to create a subfolder for the actual date:

# Get current date to store backups in another folder every day
$date = Get-Date -Format yyyyMMdd

function procallbackup {
    # Stop ProCall service
    stop-service eucsrv

    # Create the folder to backup the application to
    New-Item -ItemType Directory -Path C:\Backup\ProCall\$date

    # Copy the 'Database' and 'Config' diretory to the backup folder
    Copy-Item 'C:\Program Files (x86)\ESTOS\UCServer\database' -Recurse -Destination C:\Backup\ProCall\$date
    Copy-Item 'C:\Program Files (x86)\ESTOS\UCServer\config' -Recurse -Destination C:\Backup\ProCall\$date

    # Start ProCall service
    start-service eucsrv
}

function metadirbackup {
    # Stop MetaDirectory service
    stop-service emeta3

    # Create the folder to backup the application to
    New-Item -ItemType Directory -Path C:\Backup\MetaDirectory\$date

    # Copy the 'Database' and 'Config' diretory to the backup folder
    Copy-Item 'C:\Program Files (x86)\ESTOS\MetaDirectory 3.5\databases' -Recurse -Destination C:\Backup\MetaDirectory\$date
    Copy-Item 'C:\Program Files (x86)\ESTOS\MetaDirectory 3.5\config' -Recurse -Destination C:\Backup\MetaDirectory\$date

    # Start MetaDirectory service
    start-service emeta3
}

if (Get-Service "eucsrv" -ErrorAction SilentlyContinue) {
procallbackup}

if (Get-Service "emeta3" -ErrorAction SilentlyContinue) {
metadirbackup}

Conclusion

This way we are able to create a backup of our Estos ProCall and MetaDirectory with a periodical schedule. Usually I would do that at night when the software is not or only low used.

To ensure that thos backups don’t fill the hard disk until the server isn’t able to work anymore it is recommended to rotate the backups and to keep only a few of them. My recommendation is to keep daily backups for one week, keep weekly backups for one month and to keep monthly backups for at least three months. After a bigger change you can also create an immediate backup and keep it longer. I plan to write another post about folder rotation with powershell.

You should also integrate a check if the services start successfully after doing the backup. I covered this in another post: Controlled restart of multiple services

As always feel free to add your comments or ask questions if you have some.

Recommendation

While working with Microsoft Powershell it is useful to have a reference about the various commandlets with you. Powershell Reference Pro is a handy app for iOS devices containing information about all commandlets you can think of. Besides the usual Windows commandlets you will find information about Exchange, SharePoint, Skype as well as third party commandlets like this for VMWare Power CLI, Amazon Web Services (AWS), Citrix and others.

‎PowerShell Reference (Pro)
‎PowerShell Reference (Pro)

1 thought on “Creating Backups of Estos ProCall and MetaDirectory

  1. Pingback: Backup Estos MetaDirectory 4.0 - Blog: Florian Wilke

Leave a Reply

Your email address will not be published.