none
Does Restore-ASDatabase overwite database if it exists? RRS feed

  • Question

  • I am writing a script to restore a backup from a database/cube onto the server.

    Restore-ASDatabase -Server $Server -RestoreFile $File -Name $Cube -Security:CopyAll -AllowOverwrite -ErrorAction Stop | out-null 

    i want to make sure, will this command REALLY overwrite a cube if it already exists? because if it doesnt, and it just copies over an existing cube, then i will have to drop/delete the cube first.

    i want to make sure -AllowOverwrite will actually do its job, because ive seen bugs with the latest SSAS 2017 version and i dont want this to be a hidden issue as well that i'd end up encountering later.

    the bug ive seen and reported to MS dev team is that SkipMembership apparently doesnt work in 2017 cube version.

    Wednesday, June 26, 2019 3:24 PM

Answers

  • Hi casaster,

    If you have existing one, when execute query without "allowoverwrite", it will prompt error.  When you add "allowoverwrite" it will work successfully

    You could test on your environment, before you test, you need to backup at first(if you won't want to lost original data or you don't trust this)

    Best Regards,
    Zoe Zhi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 27, 2019 2:39 AM

All replies

  • If you do not trust it, test on a dev or qa server first.

    Thats what I do

    Wednesday, June 26, 2019 5:54 PM
  • Hi casaster,

    If you have existing one, when execute query without "allowoverwrite", it will prompt error.  When you add "allowoverwrite" it will work successfully

    You could test on your environment, before you test, you need to backup at first(if you won't want to lost original data or you don't trust this)

    Best Regards,
    Zoe Zhi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 27, 2019 2:39 AM
  • Good Answer.
    Thursday, June 27, 2019 5:33 AM