It is currently Fri Dec 13, 2019 10:13 pm



Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Sun Apr 17, 2016 6:12 pm 
User avatar

Peon
Joined: Wed Aug 26, 2009 9:27 pm
Posts: 95
Images: 3
Location: Austin TX
Toons: Arctodus

Offline

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.


Last edited by Rags on Fri Dec 14, 2018 2:14 pm, edited 6 times in total.
Top
 Profile  
 
PostPosted: Sun Apr 17, 2016 6:17 pm 
User avatar

Officer
Joined: Fri Apr 06, 2007 11:01 pm
Posts: 13286
Images: 259
Location: Murica
Toons: Kaligaran

Offline

This is awesome!

Thank you Arc. Making this a sticky.

Image


ImageImageImage
Image

"WoW is all free candy and cookies and cute little pets...and then Kali yelling for hours. Same as it ever was, but with more crazy orcs." - Spirulina 3/15/15
Top
 Profile  
 
PostPosted: Sun Apr 17, 2016 7:04 pm 
User avatar

Symblog
Joined: Tue Dec 04, 2007 4:57 pm
Posts: 1243
Images: 40
Location: Ontario, Canada
Toons: Symbah

Offline

I wonder how much time it would take to make this into a utility that you can edit these paths in a gui


Image

Image
Top
 Profile  
 
PostPosted: Tue Apr 19, 2016 7:18 pm 
User avatar

Peon
Joined: Wed Aug 26, 2009 9:27 pm
Posts: 95
Images: 3
Location: Austin TX
Toons: Arctodus

Offline

For my part this is one and done. I'm not going to make changes to these paths for a long time so having a GUI wasn't something I considered spending effort against.

If you want to though, by all means have at it.
Top
 Profile  
 
PostPosted: Wed Jul 27, 2016 11:10 pm 
User avatar

Officer
Joined: Fri Apr 06, 2007 11:01 pm
Posts: 13286
Images: 259
Location: Murica
Toons: Kaligaran

Offline

Bumping this thread.

At least 2 people I know were burned during the huge addon update frenzy from pre-patch. They lost everything (weak auras included).

All you have to do is setup these scripts once. Then you never need to touch them again (unless you add more characters that you want to back up).


Just remember to run the backup periodically. Especially before a big content patch that changes everything.


ImageImageImage
Image

"WoW is all free candy and cookies and cute little pets...and then Kali yelling for hours. Same as it ever was, but with more crazy orcs." - Spirulina 3/15/15
Top
 Profile  
 
PostPosted: Sun Mar 19, 2017 3:55 am 
User avatar

Peon
Joined: Wed Aug 26, 2009 9:27 pm
Posts: 95
Images: 3
Location: Austin TX
Toons: Arctodus

Offline

Replying to tag this back as new again. I have edited the original post with a newer version of the batch which is simpler and easier to setup.

As always I'm happy to help if needed. Probably easiest to hit me up in game with a whisper or a mail.
Top
 Profile  
 
PostPosted: Tue Jul 17, 2018 12:51 pm 
User avatar

Peon
Joined: Wed Nov 12, 2008 12:39 am
Posts: 30
Images: 3
Offline

I took this script one (small) step further and have it run every time I open WoW. That way any changes made get saved when I close the game and have backups in case I mess something up in my UI that day.

Since this runs every time I run WoW, I edited Arc's script to auto-exit instead of staying open. Save a new copy of the script called wowbackup-autoexit.bat, then edit it and change the lines at the very end to:

Code:
    ECHO Backup complete! Press any key to continue...
rem    PAUSE > nul
    exit


After that's saved, make another .bat in your WoW folder called whatever you want. I used "WoW Launcher.bat".

Code:
start "C:\Gaming\World of Warcraft\" "C:\Gaming\World of Warcraft\wowbackup-autoexit.bat"
start "C:\Gaming\World of Warcraft\" "C:\Gaming\World of Warcraft\Wow-64.exe"


Now you can make a shortcut on your desktop to WoW Launcher, and change the icon of the shortcut to WoW's icon, and you're all set. Addons backed up every time you run WoW.


Image
Top
 Profile  
 
PostPosted: Tue Jul 17, 2018 1:58 pm 
User avatar

Symblog
Joined: Tue Dec 04, 2007 4:57 pm
Posts: 1243
Images: 40
Location: Ontario, Canada
Toons: Symbah

Offline

Tet have you had any problems with wows cheat detection stopping wow from running. Other backup services I've seen ran when wow was closed as that's when action bar / macros get synced to wows end

Phone auto corrected tet to yet


Image

Image
Top
 Profile  
 
PostPosted: Sun Jul 22, 2018 1:36 pm 
User avatar

Officer
Joined: Fri Apr 06, 2007 11:01 pm
Posts: 13286
Images: 259
Location: Murica
Toons: Kaligaran

Offline

Symba wrote:
Tet have you had any problems with wows cheat detection stopping wow from running. Other backup services I've seen ran when wow was closed as that's when action bar / macros get synced to wows end

Phone auto corrected tet to yet


This isn't a backup service that Arc wrote (at least not in that way) this simply does folder/file copies.

I've been using his setup for years.


ImageImageImage
Image

"WoW is all free candy and cookies and cute little pets...and then Kali yelling for hours. Same as it ever was, but with more crazy orcs." - Spirulina 3/15/15
Top
 Profile  
 
PostPosted: Fri Dec 14, 2018 3:00 pm 
User avatar

Peon
Joined: Wed Aug 26, 2009 9:27 pm
Posts: 95
Images: 3
Location: Austin TX
Toons: Arctodus

Offline

Replying just to tag the post for 12/14, because the edit doesn't refresh it on the main board index.
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 4 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron

World of Warcraft phpBB template "WoWMoonclaw" created in 2005 by Maëvah (ex-Moonclaw) - wowcr.net : World of Warcraft styles & videos
© World of Warcraft and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries. wowcr.net is in no way associated with Blizzard Entertainment.
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.025s | 18 Queries | GZIP : Off ]