Introduction: Backup JW Library Data
The Faithful and Discreet Slave have given us a great tool with JW Library but if we need to install it on another machine for whatever reason it largely requires a re-download of all the books and media which can be tedious.
This guide will describe the process of backing up and restoring the information using Windows 10.
Step 1: Viewing Hidden Files
By default Windows hides protected and system files from users because it something goes wrong with them then they will break a lot. However, the files we need to backup are hidden and thus need to be revealed first.
Open an Explorer window by holding down the Windows key (either side of the spacebar) and pressing e.
At the top of the window you'll see View, click that to reveal a dropdown window.
You'll notice that Hidden items is unticked. Tick this box and that's it, you should now see the hidden items.
To see if it's worked you should now see a slightly duller folder called Program Data. Don't worry about this folder it'll just show if it worked.
Go into the Users folder.
Step 2: Finding the Location
In the Users directory you'll see a list of profiles. In my case the one I'm after is the one labelled Loweded. This is my username. Go into the folder that correlates with your username.
Here you'll see a lot of familiar folders like Music and Videos etc. Inside both of those folders are respective JW Library folders. These will need to be backed up as these contain the music and videos you've downloaded in app respectively. However, for now the folder we need to concentrate on is AppData.
We now need to go into the Local folder.
You should now see a folder called Packages so go into that one.
Inside this folder there will be called something like:
Now, note that it will not be called this exactly as the name after the dot is tied in with your Windows Store account. The important bit is the WatchtowerBibleandTractSo part. Go into this folder.
Backup the LocalState folder which contains all the database and publication files you have downloaded.
Step 3: Scripting It All
The easiest way to perform a backup of these files is to create a batch file. This is a simple notepad document with a .bat file extension.
Hold down the Windows key and press r.
In the run box that shows up type notepad.
Go back to the Explorer window and click in the address bar. You should see all the text highlighted blue. Copy this text by holding down CTRL and pressing c.
Go back to the Notepad window and type the following:
To get the bit after cd simply hold down CTRL and press v.
Obviously yours will look slightly different as the profile name will not be Loweded and the WatchtowerBibleandTractSo.45909CDBADF3C_5rz59y55nfz3e will be tied into your Windows Store account details but the rest will be the same.
Now type the following into Notepad:
xcopy localstate e:\JWLibrary\LocalState\ /E/Y
I need to explain this first before you run the file. It's very important you understand what's going on beforehand.
The cd part changes the directory to the one we specified. In the old days before Windows existed we had to type into the DOS prompt and this is how we entered a folder. Think of it as a text version of going into the folders like we did before in Windows.
xcopy is a copy command that provides a lot more functionality than the copy command. The part directly after xcopy is the source folder in this case localstate. After that is the location we want to copy the files to. It's best to use a USB key for backing up because it allows you to move between different machines which is the whole point of this guide in the first place. e:\ refers to the drive letter of your USB key. It often follows the next letter in the chain so it could be d:\, e:\, f:\... depending on how many other devices you've got connected.
Now don't worry too much if the directory JWLibrary doesn't exist because xcopy will actually create it anyway.
The last two commands are called switches and in this example are /E/Y. /E will copy everything in the source directory including recursive directories (files and folders within folders). This is important because the app needs the files and folders in their respective locations. /Y forces the copy even if the directories exist. This is more important when you run the script again and again after you've made changes in the JW Library app. Otherwise every time you run the script you'd have to press the y key on every single file and folder and that's time not well spent.
Now type the following into Notepad
This takes us back to our profile directory. Now we type in:
xcopy Music\JWLibrary E:\JWLibrary\Music\JWLibrary\ /E/Y
xcopy Videos\JWLibrary E:\JWLibrary\Videos\JWLibrary\ /E/Y
This will back up the music and video directories as well.
So you're script should look something like this but with your details in it:
xcopy localstate e:\JWLibrary\LocalState\ /E/Y xcopy C:\Users\Loweded\Music\JWLibrary e:\JWLibrary\Music\JWLibrary\ /E/Y xcopy C:\Users\Loweded\Videos\JWLibrary e:\JWLibrary\Videos\JWLibrary\ /E/Y
Now save the file as:
Please note that you will need to put quotation marks around the name and change the filetype to All Files in order to save the file as a batch file.
to a directory of your choosing... many like to save to the desktop for easy access.
When you open this file you'll see a black command prompt window open up and a whole lot of text scrolling. This is the copying process and this window will close when it's all finished so you'll know when the process is done when it doesn't show anymore. Of course if it fails for some reason it will also close so the only true way to know is that on your USB key there will be the appropriate files.
Step 4: Restoring
The restore will be a rather manual process because creating a script is as easy as what we've just done but in reverse but the issue comes from the username and the path of the JWLibrary files on the new machine.
Basically just follow the process of finding the JWLibrary files at the start of this guide and drag and drop the files from your USB key into this location. This is AFTER you've installed JWLibrary from the Windows Store of course and ran JWLibrary once in order to create all the necessary locations.
Step 5: Contact Me
If for whatever reason it's not working then feel free to post to me either on Twitter at @lowededwookie