Page 1 of 2
1
2
LastLast
  1. #1
    The Lightbringer eternalwhitemoon's Avatar
    10+ Year Old Account
    Join Date
    Dec 2009
    Location
    Rezzing. Again.
    Posts
    3,937

    One-Click Addon Backup

    Or, "How not to completely dissolve in a pile of tears and rage the moment an addon crashes and takes your entire UI with it".

    Technical Know-How Required: **---
    Technical Know-How it Sounds Like it Should Require:*****
    (TL;DR: It sounds more complicated than it really is.)


    This is a simplistic method for addon backup that I figured I'd share with you all. It was born from a string of unfortunate UI crashes (and subsequent swearing sessions) on my boyfriend's machine, and I figured there has to be a way to prevent that, or at least, easily recover from it.

    Most of us don't consider backing up our addons until it's too late, which is truly unfortunate, as crashes tend to occur only after we've spent hours painstakingly rearranging our UI. It takes about 10 minutes of (figurative) elbow grease to set up, but saves you countless hours of agony should you experience a complete UI meltdown.

    The point of this is to create a "last known good" backup of your addons in their existing, working state. Therefore, you want to use it when everything is working perfectly.

    Use this when:
    1) You are about to install a new addon
    2) You are about to update an existing addon
    3) You have just spent a long time tweaking your UI and it's perfect right now

    Don't use this when:
    1) You have just installed a new addon and have not yet launched WoW
    2) After updating an existing addon if you have not yet launched WoW
    3) Patch day has just hit and you're not sure yet if every addon feels like cooperating

    How do I do it?

    We will make use of a handy little tool called xcopy, and create a batch file.

    wtf is xcopy?
    By definition, xcopy "copies files and directory trees". It's a command line application (built directly into Windows) which makes it perfect for regular backups. You won't actually need to use the command prompt while making this, but it will run in a command prompt (aka DOS) window when you run it. We're gonna learn how to create a batch file!

    wtf is a batch file?
    A batch file is basically a series of commands that's executed in a command prompt (DOS) window--kind of like a macro for your OS. It's a really old way of doing things, but it's very efficient, and simple to learn.

    OK, now that I know all that technical junk, what do I do next?

    1) Determine where you want to save your backup copies. We will be copying your Interface and WTF folders, as these are what's responsible for holding your addons and their configurations. Personally, I chose an entirely different partition for my backups than where WoW is installed. I'd recommend this setup if your computer is set up with multiple partitions and/or physical drives, as it provides an additional layer of protection in case the entire drive or partition goes bad.

    2) Once you know where you want to put them, create new folders in that location with the name of your choosing. (I chose to keep the names Interface and WTF so that in case a restore is needed, I can easily identify which folder should go where.)

    3) Open up Notepad. This is where you're going to actually write your batch file. Here's what mine looks like:

    Code:
    cd /d S:\WTF
    xcopy "P:\Program Files\World of Warcraft\WTF" /e /y
    cd S:\Interface
    xcopy "P:\Program Files\World of Warcraft\Interface" /e /y
    In my case, because I wanted it on a different drive, I had to use the cd (change directory) command to get it to write to the correct location. If you have just 1 drive, you can simply type:

    xcopy (source folder--WoW's Interface or WTF folder) (destination folder--the one you created in step 2) /e /y

    The /e and /y are called "parameters", and these particular two parameters do the following:

    /e: copies directories and subdirectories, including empty ones (this means all your subfolders will be preserved, which is really important)
    /y: suppresses prompting to confirm you want to overwrite an existing destination file. This parameter is here for the subsequent uses of this batch file, as having to be prompted to overwrite every time gets kind of old after a while.

    Don't forget to have two lines of xcopy: one for Interface and one for WTF. Note that if your source or destination locations contain spaces anywhere in them, you should use quotes for the entire location.

    Examples:
    Single-drive situation
    Code:
    xcopy "C:\Program Files\World of Warcraft\Interface" "C:\Documents and Settings\username\My Documents\Interface" /e /y
    xcopy "C:\Program Files\World of Warcraft\WTF" "C:\Documents and Settings\username\My Documents\WTF" /e /y
    Multiple-drive situation
    Code:
    cd /d "K:\WoW Backups\WTF"
    xcopy "C:\Program Files\World of Warcraft\WTF" /e /y
    cd "K:\WoW Backups\Interface"
    xcopy "C:\Program Files\World of Warcraft\Interface" /e /y
    OK, I have this all in Notepad, but it's not a batch file. How do I make it a batch file?
    The difference between a regular Notepad file and a fancy batch file is all in how you save it. When you've got your code, go to File>Save As. Navigate to where you want to save it (I choose the desktop, personally, because I am lazy), and at the bottom where it says "Save as Type" choose All Files. Then, at the end of your filename, type .bat and save it.

    This may have read a little awkwardly, so here's a picture explaining what I mean:


    If you did it correctly, the icon should look different than the icons you're used to seeing. You should see an icon that looks like this:


    Yay, I created it!...now how do I actually use it?
    This is the easy part. Whenever you want to run it, simply double-click on the file. It will open a command prompt window, you'll see lines of text flying by at Ludicrous Speed, and it will close itself. That's it!

    OMG my UI crashed, burned and died in a horrific heap of malformed code Now what?
    The batch file only created the backups; you have to restore them manually. This is super simple: copy the files from the backed-up location, and simply paste them into your WoW folder. They should overwrite the existing Interface and WTF folders; this is fine.

    If you named your backup folders something different, you would have to rename or delete the original Interface and WTF folders, then rename your backup folders to Interface and WTF, respectively, once you've pasted them into your WoW folder. Launch WoW, and everything should be as it was before something went horribly wrong.

    Please note that this restoration does revert addons to the versions they were running at the last time you ran a backup. This can be really helpful if an addon update was what caused the conflict, but because of this, please be sure to use your batch file regularly. It doesn't do you any good to revert to a version of an addon that's 5 releases old.

    I hope this information was helpful!

  2. #2
    Deleted
    good idea. i think this should be a sticky.

  3. #3
    The Lightbringer eternalwhitemoon's Avatar
    10+ Year Old Account
    Join Date
    Dec 2009
    Location
    Rezzing. Again.
    Posts
    3,937
    Quote Originally Posted by nzall View Post
    good idea. i think this should be a sticky.
    Thanks! I know they have restrictions on how many stickies they have in a given forum, so I wouldn't be surprised or offended if this never makes it there. I'm just hoping it helps a few people avoid the "NOOOO MY UI" scenario. It's a sucky situation to be in.

  4. #4
    Yeah, i've actually lost my UI before and it really really sucked. This will definitely help those people who have no clue on how to back up their addons. Two thumbs up for this post.

  5. #5
    Deleted
    Already got too many stickies as is, but I've added it to the List of UI related tutorials and guides

  6. #6
    The Lightbringer eternalwhitemoon's Avatar
    10+ Year Old Account
    Join Date
    Dec 2009
    Location
    Rezzing. Again.
    Posts
    3,937
    Yay! Thank you Treeston

  7. #7
    Also as an alternative to the file type dropdown and selecting "All Files" typing the filename directly in quotes such as "Backup.bat" will save that correctly with the intended extension.

  8. #8
    Deleted
    Nice guide for those who don't know how to back up their Addons Great Work!

  9. #9
    The Lightbringer eternalwhitemoon's Avatar
    10+ Year Old Account
    Join Date
    Dec 2009
    Location
    Rezzing. Again.
    Posts
    3,937
    Quote Originally Posted by ComputerNerd View Post
    Also as an alternative to the file type dropdown and selecting "All Files" typing the filename directly in quotes such as "Backup.bat" will save that correctly with the intended extension.
    Wow, I can't believe I didn't know that. That's cool. *mentally files away*

    The quotes are incredibly important though, otherwise you end up with Backup.bat.txt, which won't do you any good.

  10. #10
    Deleted
    I actually didn't know the /d switch for cd. Interesting.

  11. #11
    Deleted
    Thank you a ton ^^ that's really helpful

  12. #12
    did you copy this from some where I could of sworn I've seen this. But still its a good post

  13. #13
    The Lightbringer eternalwhitemoon's Avatar
    10+ Year Old Account
    Join Date
    Dec 2009
    Location
    Rezzing. Again.
    Posts
    3,937
    Quote Originally Posted by Acidd06 View Post
    did you copy this from some where I could of sworn I've seen this. But still its a good post
    No?

    If you see this somewhere else, let me know, because I might have a bone to pick with someone.

    Using a batch file to create a backup of your Interface and WTF folders is possibly not a unique idea, I'll give it that, but I can guarantee every line of code, word, and screenshot were lovingly crafted by yours truly.

    To clarify, the point of this is not so much to walk people through the backup process (although it does do that), but to walk people through how to automate the process so that way they're more inclined to actually keep up with it.

    I know personally I did the manual copy/paste thing for a while, and I started slacking on it because I'd have to copy the folders, navigate to the new location, paste it to the new location, click Yes to All, wait...and wait...and so I found I was less likely to actually keep up with it. Double-clicking a batch file, though, is super easy and you're a new height of lazy if you have one that does the above and don't bother to use it. XD


    Quote Originally Posted by Treeston View Post
    I actually didn't know the /d switch for cd. Interesting.
    "Use the /D switch to change current drive in addition to changing current directory for a drive."

    I found that it wouldn't properly switch to the other partition if I didn't have that /d line to begin with. I only needed to specify it the first time I referred to S:, and the second time it didn't matter (note how the second line has the cd command but no /d).
    Last edited by eternalwhitemoon; 2011-04-10 at 11:59 AM.

  14. #14
    Deleted
    It's quite obvious. S: is already your current drive, so another /d switch is no longer necessary.

  15. #15
    The Lightbringer eternalwhitemoon's Avatar
    10+ Year Old Account
    Join Date
    Dec 2009
    Location
    Rezzing. Again.
    Posts
    3,937
    Yeah, I totally DID know that, but I'm awake waaay earlier than normal, so I derped. I realized the stupidity of what I said on the way to work. XD

    Clearly, I need more coffee. Sorry about the derp. I edited out my blunder.

  16. #16
    Deleted
    As far as I know, you should use %USERPROFILE% instead of C:\Documents and Settings\username\ as the former defaults to the current user's profile (C:\Users\username in Vista/7 and higher, C:\Documents and Settings\username in XP).

    The correct paths should look as follows for the single drive case.
    Code:
    xcopy "C:\Program Files\World of Warcraft\Interface" "%USERPROFILE%\My Documents\Interface" /e /y
    xcopy "C:\Program Files\World of Warcraft\WTF" "%USERPROFILE%\My Documents\WTF" /e /y

    It should also be noted that Vista/7 use just Documents instead of My Documents.

    One additional step would probably be to have the both Interface and WTF-folders under a common parent folder to prevent profile directory clutter.

    Just my 2-cents :3

    Edit: Also, on a 64bit Windows, the path to the default WoW install is located under Program Files (x86) instead of Program Files (Might not be 100% sure, but most 32bit programs follow this scheme in my 64bit Win7 install)
    Last edited by mmocd41787d236; 2012-05-16 at 02:29 PM. Reason: Added 64bit stuff...

  17. #17
    Deleted
    I actually think it installs into C:\Users\Public\Games by default nowadays.

  18. #18
    mine:
    Code:
    rmdir /S /Q "G:\WoW UI Backup\WTF"
    cls
    mkdir "G:\WoW UI Backup\WTF"
    cls
    cd /d "G:\WoW UI Backup\WTF"
    cls
    xcopy "D:\Games\World of Warcraft\WTF" /e /y /q
    cls
    rmdir /S /Q "G:\WoW UI Backup\Interface"
    cls
    mkdir "G:\WoW UI Backup\Interface"
    cls
    cd "G:\WoW UI Backup\Interface"
    cls
    xcopy "D:\Games\World of Warcraft\Interface" /e /y /q
    cls
    rmdir /S /Q "G:\WoW UI Backup\Fonts"
    cls
    mkdir "G:\WoW UI Backup\Fonts"
    cls
    cd /d "G:\WoW UI Backup\Fonts"
    cls
    xcopy "D:\Games\World of Warcraft\Fonts" /e /y /q
    cls
    rmdir /S /Q "G:\WoW UI Backup\Sound"
    cls
    mkdir "G:\WoW UI Backup\Sound"
    cls
    cd "G:\WoW UI Backup\Sound"
    cls
    xcopy "D:\Games\World of Warcraft\Sound" /e /y /q
    cls
    del /Q "G:\WoW UI Backup\WoW UI Backup.rar"
    cls
    rar a "G:\WoW UI Backup\WoW UI Backup.rar" "G:\WoW UI Backup"
    cls
    @Exit
    There has to be way to reduce it/make it more straight forward. Also, I'd like to rar the folders directly and not have a "wow UI backup" folder when opening the rar. Makes it easier to restore.

  19. #19
    Deleted
    Mine:
    Code:
    @echo off
    SETLOCAL
    SET file=%DATE:~3,2%%DATE:~0,2%%DATE:~-4%-%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
    cd /D "C:\Program Files\WinRAR"
    rar a -r- D:\wtfbak\wtfbak-%file%.rar "D:\World of Warcraft\WTF\Config.wtf" & rar a D:\wtfbak\wtfbak-%file%.rar "D:\World of Warcraft\WTF\Account\<snip>"
    ENDLOCAL

  20. #20
    Deleted
    This may be classed as a bump, but this method has just saved my entire wow addons folder and all of the saved variables, so thank you very much for this!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •