Forum Discussion

bunyaminkoc's avatar
3 years ago

enterprise vault elastic search index snapshot automatic backup script

Hello,

we set up a new enterprise vault 14.2 and we create a new indexsnapshot disk but we can not create a script that automatic indexsnapshot.

we take indexsnapshot backup manually , how can we automate that.

Thank you

  • Hi MikeK-GT,

    I used a .bat file with the following in it and it worked without issue.  You will need to replace the path if needed along with the correct SiteId for your environment.  You should then be able to run this as the Vault Service Account in Windows Scheduler.  

    C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {New-EVIndexSnapshot -SiteId "REPLACEME8A185D71384F250D1d10000evserver1" -Confirm:$False}"

    Regards,

    Patrick 

  • Hello All

    we solved that problem, we can take snapshot automatically by script.

    we are using that command when we set Backup mode

     

    cd "C:\Windows\SysWOW64\WindowsPowerShell\v1.0"

    .\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Set-VaultStoreBackupMode -Name FFFFF -EVServerName YYYYY -EVObjectType Site}"

    .\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Set-VaultStoreBackupMode -Name VSG -EVServerName YYYYY -EVObjectType VaultStoreGroup}"

    .\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Set-VaultStoreBackupMode -Name Journal15Store -EVServerName YYYYY -EVObjectType VaultStore}"

    .\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Set-VaultStoreBackupMode -Name Mail15Store -EVServerName YYYYY -EVObjectType VaultStore}"

    .\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\evshell.psc1" -command "& {New-EvIndexsnapshot -EVServerName YYYYY.FFFF.com.tr -confirm:$false}"

    del "T:\Enterprise Vault Stores\Journal15Store Ptn6\IgnoreArchiveBitTrigger.old"

    del "N:\Enterprise Vault Stores\MailStore 15Ptn111\IgnoreArchiveBitTrigger.old"

  • Hi there,

    could you please elaborate on this a bit more? 

    You can build a script using New-EVIndexSnapshot to create new snapshots. To get rid of older ones you can make use of the cmdlets Remove-EVIndexSnapshot and something like Get-EVIndexSnapshot -Latest:$false.

    Unfortunately there is no built in automatism as of now but having this discussed with Veritas, it might come in a later release.

     

    Regards

    Marc

  • Hi there,

    Actually ve take indexsnapshot manually , no issue about that. Sometimes we run that command ( New-EVIndexSnapshot) but we need that command run on a script.

    Example,

    04:00 before backup mode and 08:00 after backup mode.

    Between before and after mode we backup sql (05:00) and we need to take indexsnapshot at 06:00, but we can do it manually.

    we need to automate that with a script , and script has to run on a scheduled time

    • Marcde's avatar
      Marcde
      Moderator

      well, you could build a script and let your backup solution execute it or simply create a task in task scheduler that runs at a specific time and executes a script for snapshot creation. 

      The first one is what I'd recommend if possible but the second option should work as well. 

      Regards

      Marc

  • Yes,  you are right but we dont know how to create a script about indexsnapshot. Is there any sample about that

  • Not very helpful. Trying also to setup a script to automate snapshots. new-indexsnapshot will not run in powershell only in EV Management Shell. How do you run a script from EVMS? 

  • Hi,

    You should be able to use a similar process as documented in https://www.veritas.com/content/support/en_US/doc/122198020-122198024-0/v35699192-122198024

    The Transform-Backup.ps1 will generate the scripts required to run a backup by calling EVMS.  You can just modify the command in the brackets as needed.  

    powershell -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Set-VaultStoreBackupMode -Name FSAVaultStoreVNX -EVServerName EVServer -EVObjectType VaultStore}"

    The 32-bit PowerShell must be used as the EVMS in not registered for use with 64-bit. 

    Regards,

    Patrick 

      • plaudone1's avatar
        plaudone1
        Level 6

        Hi MikeK-GT,

        I used a .bat file with the following in it and it worked without issue.  You will need to replace the path if needed along with the correct SiteId for your environment.  You should then be able to run this as the Vault Service Account in Windows Scheduler.  

        C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {New-EVIndexSnapshot -SiteId "REPLACEME8A185D71384F250D1d10000evserver1" -Confirm:$False}"

        Regards,

        Patrick 

    • plaudone1's avatar
      plaudone1
      Level 6

      The syntax looks correct.  The New-EVIndexSnapshot portion works in EVMS?  

      I have tried to reproduce that error in the lab and I am not having any issues with the syntax.  

      If I change the ending portion of the SiteId it returns "No such host is known"  

      With an incorrect beginning it returns "The specified Site ID is not valid." 

       

       

      • MikeK-GT's avatar
        MikeK-GT
        Level 4

        Maybe an issue with my lab server running out of memory, I'll run it tomorrow live. Thanks for your help.

  • Hello All

    we solved that problem, we can take snapshot automatically by script.

    we are using that command when we set Backup mode

     

    cd "C:\Windows\SysWOW64\WindowsPowerShell\v1.0"

    .\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Set-VaultStoreBackupMode -Name FFFFF -EVServerName YYYYY -EVObjectType Site}"

    .\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Set-VaultStoreBackupMode -Name VSG -EVServerName YYYYY -EVObjectType VaultStoreGroup}"

    .\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Set-VaultStoreBackupMode -Name Journal15Store -EVServerName YYYYY -EVObjectType VaultStore}"

    .\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Set-VaultStoreBackupMode -Name Mail15Store -EVServerName YYYYY -EVObjectType VaultStore}"

    .\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\evshell.psc1" -command "& {New-EvIndexsnapshot -EVServerName YYYYY.FFFF.com.tr -confirm:$false}"

    del "T:\Enterprise Vault Stores\Journal15Store Ptn6\IgnoreArchiveBitTrigger.old"

    del "N:\Enterprise Vault Stores\MailStore 15Ptn111\IgnoreArchiveBitTrigger.old"