Hey guys. So I updated my addons the other day, and I'm not sure how it happened but all my settings got blown away. I lost all my weak auras, zperl window sizing/positiong, etc. It was a major pain in the ass that took me nearly a week to recover from fully. I decided that I didn't want to deal with that again.
Enter my backup/restore batch files. I have these sitting on my desktop and anytime I'm about to experiment with a new addon, or update or whatever I just click the backup batch and boom, everything is copied for me. In the event I screw something up, a full restore of settings is just another double click away. I thought some of you might find this useful. I have developed these on Windows 7. They should work on windows 7 or newer. I'm not sure if some of the batch features they utilize are available on XP, but you can try. PM me or message me in game if they don't and I can help you make one that will.
Installation: 1) First off create a new text file on your desktop (right click, new, text document), type the name as:
"
WOW Backup.bat"
(without the quotes!) Then press enter. Windows should now prompt you about changing the file type, select yes. If you didn't see the prompt you need step 1a, otherwise go to step 2).
1a) You didn't see the prompt because windows is hiding the file extension from you. To make windows show you the extension go to Control Panel, Folder Options. On the dialog that pops up select the View tab. Look for a setting called 'Hide extensions for known file types', and uncheck it. Now click Apply, then OK. Now if you look at the file on your desktop again the name should be "WOW Backup.bat.txt". Click it once to select, then press F2 to edit the name. Delete the ".txt" off the end of the name, then press enter. Select Yes when windows asks if you are sure you want to change the file type.
2) Right click your new batch file and select Edit. This should open the file in windows notepad.
3) Copy all the text from the first code block in this post titled 'Backup Code'
4) Paste the code text into notepad.
5) Edit this line (ONLY IF NECESSARY):
SET WOW_ACCOUNT_PATH="C:\Program Files (x86)\World of Warcraft\WTF\Account"Such that the path in quotes points to the location of your World of Warcraft folder on your PC. This is only necessary if you have custom install location, the path I have here is the default.
6) Save and close the file, you're done! (Click the X at the top right to close the window, when prompted choose Save).
7) To install the restore batch file. Follow the same instructions as above with 2 differences. First, in step 1 name the file "
WOW Restore.bat". Second, in step 3 copy the code from the second code block in this post titled '
Restore Code'.
To run simply double click the batch file and off it goes. It will print out a listing of every file it copies/restores, and the window remains open when it finishes so that you can see what it did. If you don't want the window to remain open you can delete the last line 'Pause > nul'.
Backup Code:Code:
@ECHO OFF
SETLOCAL
REM // Edit this path to reflect the location of your WOW folder on your local PC
SET WOW_ACCOUNT_PATH="C:\Program Files (x86)\World of Warcraft\_retail_\WTF\Account"
REM // change the working directory to the wow account folder
CD /D %WOW_ACCOUNT_PATH%
REM // Loop through all the folders in the wow account directory. Find each folder named
REM // "SavedVariables", then copy all the lua files in it to make a backup.
FOR /F "delims=" %%i IN ('DIR /B /S /AD') DO (
IF "%%~nxi" == "SavedVariables" (
ECHO Backing up files from: %%i
ECHO.
XCOPY "%%i\*.lua" "%%i\backup\*.lua" /V /C /I /H /R /Y
ECHO.
ECHO.
)
)
ECHO Backup complete! Press any key to continue...
PAUSE > nul
Restore Code:Code:
@ECHO OFF
SETLOCAL
REM // Edit this path to reflect the location of your WOW folder on your local PC
SET WOW_ACCOUNT_PATH="C:\Program Files (x86)\World of Warcraft\_retail_\WTF\Account"
REM // change the working directory to the wow account folder
CD /D %WOW_ACCOUNT_PATH%
REM // Loop through all the folders in the wow account directory. Find each folder named
REM // "SavedVariables", then copy all the lua file from its backup directory, up one
REM // level into the savedvariables directory.
FOR /F "delims=" %%i IN ('DIR /B /S /AD') DO (
IF "%%~nxi" == "SavedVariables" (
ECHO Restoring files to: %%i
ECHO.
XCOPY "%%i\backup\*.lua" "%%i\*.lua" /V /C /I /H /R /Y
ECHO.
ECHO.
)
)
ECHO Restore complete! Press any key to continue...
PAUSE > nul
Notes: I have added comments directly in the batch script to explain what is going on. Hit me up if you have any questions or suggestions.
I kept these as 2 separate files as I thought that might be easier for some people to use.
How it works. Inside of all of your 'SavedVariables' folders (one for your account, and one for each toon) it creates a new folder called 'backup', and then copies all the lua settings files into that folder. Restore does the opposite, copying from the 'backup' folder into the 'SavedVariables' folder.
EDITED 03/19/2017: I learned a better way to do this using for loops in the batch code, so its now much shorter/simpler and will automatically handle multiple realms.
EDITED 12/14/2018: Updated the path to include the new _retail_ subfolder that Blizzard added. Also removed the need to edit the account name, it will back up all accounts on the machine. Now you need only edit the Wow path if your install isn't in the default location.