How to backup and restore inMyCellar database


Probably the most frequent question I hear from inMyCellar users is: “HELP!! I got a brand new shiny phone, installed inMyCellar and my cellar is now empty!  How do I get it back?”.  I hear your concern, and it pains me that I haven’t had enough free time to complete the uber cloud based backup solution of your dreams (believe me, it IS coming), but I figure it’s about time that I finally document the approved and tested way of doing it in a way that there should be little left to the imagination regarding how to make it happen.

Currently, your entire ‘cellar’ is stored in an on device sqlite database and luckily Google provides an easy way to back that up and restore it on the same device or on another device.

Install adb

First, you need to install the Android Debug Bridge (adb) on a computer that you can connect your Android device to.  ADB is a tool put out by Google for Android developers.  You can read all about the great things it can do and download it here.

Turn into a developer

Now that you have ADB ready to go, the next step is to make sure that ADB can ‘talk’ to your Android device.  This involves turning ‘Developer Options’ on on your Android and setting it up for ‘USB Debugging’.  Don’t worry, you can easily turn these settings off with one click when you’re done, but there are a ton of cool things you can do with them, so you might want to keep it enabled.  Turning on development options and USB debugging is described in detail here.

You can verify everything is working by typing the following at a terminal on your computer:

adb devices

If you see a device identifier listed and no complaints about not being authorized, you’re good to go on to the next step.  If you encounter any issues, refer back to the prior pages to make sure you followed all of the steps and follow any troubleshooting steps for your computer’s operating system.

Back that thing up

The next step is to create a backup of your inMyCellar data.  Make sure the device that has your current inMyCellar data is plugged into your computer and accessible via ADB.  Create a directory on your computer called: inMyCellar navigate to that directory in a terminal and type:

adb backup -f ./data.ab -noapk com.transmutex.inmycellar

Hit ‘enter’ and you should get a prompt on your Android device asking you if you would like to backup your inMyCellar data.  You can set a password at this stage to encrypt your data, but you can skip this step since inMyCellar does not store anything sensitive.

When the backup is complete, you should have a file on your computer in your inMyCellar directory named data.ab.  This is a backup of all of your inMyCellar data.  Now it’s time to put that data on your new Android device.

Restore inMyCellar data

At this time, you can unplug your old Android device and plug in your new device.   Make sure you installed a fresh copy of inMyCellar from the Play store on your new device.  You will then need to make sure that this device is setup for debugging and accessible via adb, so follow the same steps listed above that you did for your old Android device.  Once it’s accessible, run the following command from a terminal in your inMyCellar directory:

adb restore ./data.ab

Once again, you will be prompted on you device, asking if you want to restore the data.  If you setup a password when originally backing up your data, you will need to enter it here.  When this process is complete, you should be able to open up inMyCellar and see all of your data on your new device!  Feel free to reach out with any questions or concerns.