Thread Tools Display Modes
12-01-14, 05:22 AM   #1
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
SavedVariables .bkp files?

Hi,
just something I thought I'd finally ask. Does anyone know about the logic of the .bkp backup files in SavedVariables? Last time I checked some of them (which was some time ago) the data was very old. Is it backed up when the addon version changes, or the WoW client updates or something, or just a big mystery?
__________________
Grab your sword and fight the Horde!
  Reply With Quote
12-01-14, 08:32 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
The first time you load an addon, AddonName.lua is created. The next time you load the addon, AddonName.lua is renamed AddonName.bak, and a new AddonName.lua is created. After that, as far as I've ever noticed, the .bak file is never updated again, and subsequent changes only affect the .lua file. Maybe they meant the system to be more useful -- eg. it would be useful to have the .bak file always contain the last saved version, so in case you screwed something up in-game but reloaded the UI before realizing, you could get your last good settings back -- but as it is it seems like just a waste of disk space.

Edit: If you delete all the .bak files then WoW will copy the .lua file to .bak and make a new .lua file, but that's not really useful as a backup strategy, since if you're running some process to copy/delete the .bak files you might as well just copy the .lua files instead.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
12-01-14, 08:42 AM   #3
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
I'm not sure if anyone knows the exact logic behind it, but they are occasionally updated—not enough to be useful, however.

Last edited by Talyrius : 12-01-14 at 08:50 AM.
  Reply With Quote
12-01-14, 11:54 AM   #4
Tonyleila
A Molten Giant
 
Tonyleila's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 758
For me .bak file always updates to the last version of the saved vabs if the original saved vabs are corrupted and get resettet.
__________________
Author of: LeilaUI and Aurora: Missing Textures
__________________
  Reply With Quote
12-02-14, 08:51 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I've been able to use the .bak files in the past to recover data.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
12-02-14, 09:52 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
They do contain old data, but it's very old. For example, my saved variables file for BagBrother (the helper addon that stores bag/bank contents for Bagnon) was last updated December 1st (yesterday, which is when I last logged into the game), but its corresponding .bak file hasn't been updated since October 10th, even though obviously the data has changed many times between then and now.

If something happened to corrupt that Lua file, I'd be better off just starting from scratch, rather than restoring to a 2-month-old backup whose data is no longer remotely correct.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » SavedVariables .bkp files?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off