<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Scripting Backups and Restores from Command Line in Vault Forum</title>
    <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/10875558#M36849</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/272792"&gt;@tahdesign1&lt;/a&gt;&amp;nbsp;I know this is a really old post, but did you ever come up with a method to handle this?&lt;BR /&gt;&lt;BR /&gt;I also want to automate with a recurring task.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jan 2022 22:10:09 GMT</pubDate>
    <dc:creator>andrewdroth</dc:creator>
    <dc:date>2022-01-12T22:10:09Z</dc:date>
    <item>
      <title>Scripting Backups and Restores from Command Line</title>
      <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6545659#M36840</link>
      <description>&lt;P&gt;I am writing some scripts to lighten the load of my weekly backup testing.&lt;/P&gt;&lt;P&gt;My weekly full backup is developed through the ADMS console and then scheduled through Task Scheduler.&lt;/P&gt;&lt;P&gt;That being said the folder name ends up being VaultBackup_Date_Time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So since the Date_Time part changes every week, I am thinking that the restore script &lt;SPAN&gt;-B&lt;/SPAN&gt;&lt;EM&gt;folder &lt;/EM&gt;&lt;SPAN&gt;command&amp;nbsp;&lt;/SPAN&gt;would have to be altered every week to match which would negate the advantage of scripting the task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you look at the script file running the backup it is just stating the upper level folder I have pointed it to but it then makes a sub folder for the backup with the name &lt;SPAN&gt;VaultBackup_Date_Time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So when writing a script for the restore you would use&amp;nbsp;&lt;SPAN&gt;-B&lt;/SPAN&gt;&lt;EM&gt;folder &lt;/EM&gt;command to point at the folder that contains a backup. So if I pointed this to the upper level folder would it just restore the first &lt;SPAN&gt;VaultBackup_Date_Time folder that it ran into?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to make sure I move out the previous weeks sub folder but there have been times (on vacation) that I have not so ended up with two &lt;SPAN&gt;VaultBackup_Date_Time folders. So not sure what would happen in that situation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could answer a lot of these questions by just trial and error since I have a test environment but am hoping to cut my time short if someone here is also scripting out some of these tasks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 21:22:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6545659#M36840</guid>
      <dc:creator>tahdesign1</dc:creator>
      <dc:date>2016-09-06T21:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Backups and Restores from Command Line</title>
      <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6549526#M36841</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately the path given to 'restore' does need to be complete (including the relevant VaultBackup_Date_Time directory). I'm not sure how other people handle determining the path for automated restore purposes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 13:09:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6549526#M36841</guid>
      <dc:creator>paul.gunn</dc:creator>
      <dc:date>2016-09-08T13:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Backups and Restores from Command Line</title>
      <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6549817#M36842</link>
      <description>&lt;P&gt;Well that's disheartening in the view of scripting this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am a little confused then on the -Bfolder&amp;nbsp;command that is used in both backup and restore scripts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please refer to you help pages on this to see my confusion&lt;/P&gt;&lt;P&gt;&lt;A href="https://knowledge.autodesk.com/support/vault-products/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/Vault/files/GUID-7FD9DAD8-0104-46FA-BCE7-11259FAB4235-htm.html" target="_blank"&gt;Autodesk Vault Command Line Server Console&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you look at the examples under backup and restore they both show the&amp;nbsp;&lt;SPAN&gt;-Bfolder command being point to a folder named&amp;nbsp;C:\Backup.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now by&amp;nbsp;examining&amp;nbsp;my files and what you have stated, we know that the backup process uses that folder and then adds a sub folder named&amp;nbsp;VaultBackup_Date_Time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is fine in scripting the backup process since we know it will just add the VaultBackup_Date_Time to the stated folder in the script.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, no where in the help does it indicate that the backup process is going to add the VaultBackup_Date_Time folder which in my opinion negates to&amp;nbsp;usefulness&amp;nbsp;of even&amp;nbsp;scripting&amp;nbsp;the restore process.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 14:47:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6549817#M36842</guid>
      <dc:creator>tahdesign1</dc:creator>
      <dc:date>2016-09-08T14:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Backups and Restores from Command Line</title>
      <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6549898#M36843</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm sorry for any confusion regarding the documentation - I agree that it does not spell out the exact behavior. The command line functionality has been like this for many years, so I'm not completely&amp;nbsp;sure the original reasons for this decision. I suspect that having 'backup' specify the parent directory (with&amp;nbsp;the actual backup directory automatically being&amp;nbsp;created) may simplify backup scripts - in that they don't need to manage creation of unique subdirectories per backup. I would not argue that this does complicate automated restore scenarios&amp;nbsp;however.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 15:14:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6549898#M36843</guid>
      <dc:creator>paul.gunn</dc:creator>
      <dc:date>2016-09-08T15:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Backups and Restores from Command Line</title>
      <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6549953#M36844</link>
      <description>&lt;P&gt;Unless some wild card calls can be added in the restore script to make the -B look at a directory that is&amp;nbsp;&lt;SPAN&gt;C:\Backup\VaultBackup_%%_%%, where it accepts whatever is there for %%.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Just to&amp;nbsp;clarify&amp;nbsp;what I am trying to do&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Production ADMS does a full backup on Friday night.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Backup is copied from Production Vault to Test Vault on Saturday night (this is already scripted and tested)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Test Vault restores Friday nights backup (Sunday night)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;So then&amp;nbsp;when I come in Monday morning I only have to examine the log to see that Fridays backup has been verify.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 15:24:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6549953#M36844</guid>
      <dc:creator>tahdesign1</dc:creator>
      <dc:date>2016-09-08T15:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Backups and Restores from Command Line</title>
      <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6550022#M36845</link>
      <description>&lt;P&gt;This stack overflow post has some ideas about working with wildcards that you might find useful.&amp;nbsp;It seems like either the 'change directory' or 'for do' strategy might be useful here&amp;nbsp;. &amp;nbsp;It does make the valid point though that if you do have multiple matching subdirectories (e.g. multiple vault backups) then things mightn't go so well:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://stackoverflow.com/questions/8609028/copying-files-with-wildcards-in-the-path" target="_blank"&gt;http://stackoverflow.com/questions/8609028/copying-files-with-wildcards-in-the-path&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another alternative might be a scripting language like python that has more capabilities. e.g. to find the most recent subdirectory. That might be more involved but would likely be more robust if you did accidentally end up with multiple backups in the parent directory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 15:43:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6550022#M36845</guid>
      <dc:creator>paul.gunn</dc:creator>
      <dc:date>2016-09-08T15:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Backups and Restores from Command Line</title>
      <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6550248#M36846</link>
      <description>&lt;P&gt;No Python per Irvin in this post&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://forums.autodesk.com/t5/vault-general-discussion/vault-and-python/td-p/6533907" target="_blank"&gt;http://forums.autodesk.com/t5/vault-general-discussion/vault-and-python/td-p/6533907&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 16:48:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6550248#M36846</guid>
      <dc:creator>tahdesign1</dc:creator>
      <dc:date>2016-09-08T16:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Backups and Restores from Command Line</title>
      <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6550294#M36847</link>
      <description>&lt;P&gt;To clarify, you might be able to use Python outside of Vault to do somethings but customizing the UI isn't tested with Python.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 17:01:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6550294#M36847</guid>
      <dc:creator>ihayesjr</dc:creator>
      <dc:date>2016-09-08T17:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Backups and Restores from Command Line</title>
      <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6550322#M36848</link>
      <description>&lt;P&gt;Thanks for clarifying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this is all getting to involved for the purpose of scripting a simple recurring task.&lt;/P&gt;&lt;P&gt;Obviously the backups, full or incremented, are scripted&amp;nbsp;and the ADMS console actually produces those for you.&lt;/P&gt;&lt;P&gt;I guess the test restore will just have to stay a manual task.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 17:07:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/6550322#M36848</guid>
      <dc:creator>tahdesign1</dc:creator>
      <dc:date>2016-09-08T17:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Backups and Restores from Command Line</title>
      <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/10875558#M36849</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/272792"&gt;@tahdesign1&lt;/a&gt;&amp;nbsp;I know this is a really old post, but did you ever come up with a method to handle this?&lt;BR /&gt;&lt;BR /&gt;I also want to automate with a recurring task.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 22:10:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/10875558#M36849</guid>
      <dc:creator>andrewdroth</dc:creator>
      <dc:date>2022-01-12T22:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Backups and Restores from Command Line</title>
      <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/10876059#M36850</link>
      <description>&lt;P&gt;I recommend you switch to Powershell instead of the old DOS batch file as your script language.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$backupFolder = 'E:\_VAULTBACKUP'
$logFolder = 'E:\_RESTORELOG'

$dateString = (Get-Date).ToString('yyyy_MM_dd_hh_mm_ss')
$restoreLog = Join-Path $logFolder "VaultRestore_$dateString.log"

$AdmsConsole = 'C:\Program Files\Autodesk\Vault Server 2021\ADMS Console\Connectivity.ADMSConsole.exe'

# Vault user name and password
$vaultUser = 'administrator'
$vaultPassword = ''

# Find the latest backup folder by folder creation time
$latestBackupFolder = Get-ChildItem $backupFolder -Filter VaultBackup* | Sort-Object CreationTime -Descending | Select-Object -First 1

$arguments = "-Orestore -B$($latestBackupFolder.FullName) -VU$vaultUser -VP$vaultPassword -S -L$restoreLog"

&amp;amp; $AdmsConsole $arguments.Split(' ') | Out-Null&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 03:24:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/10876059#M36850</guid>
      <dc:creator>smilinger</dc:creator>
      <dc:date>2022-01-13T03:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Backups and Restores from Command Line</title>
      <link>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/10879440#M36851</link>
      <description>&lt;P&gt;To get rid of the date and time suffix you do like this. After the backup is run rename the folder&amp;nbsp;VaultBackup_2022_01_12_16_04_45 to Vaultbackup with this command:&lt;BR /&gt;&lt;BR /&gt;Move D:\Backupfolder\VaultBackup_* D:\Backupfolder\Vaultbackup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do a robocopy /mir of that renamed folder to the testrestore server&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Run the restore command on the restore server&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jan 2022 10:20:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-forum/scripting-backups-and-restores-from-command-line/m-p/10879440#M36851</guid>
      <dc:creator>GunnarNilsson</dc:creator>
      <dc:date>2022-01-14T10:20:47Z</dc:date>
    </item>
  </channel>
</rss>

