Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

Guide [Guide] Auto Backup Phone's Data to Offsite, Also auto backup apps data

views
     
TSxxboxx
post Mar 14 2021, 10:10 PM, updated 4y ago

The mind is for having ideas, not holding them
*******
Senior Member
5,093 posts

Joined: Oct 2004
From: J@Y B33


This is a mini guide on how to make an automated backup for Android phones to offsite storage. Nowadays our phone is the most important device for almost everyone, and it’s importance also due to the data that it holds. Imagine if your phone is missing or something went wrong and it can’t boot or access all the data in it. All your data is now gone, no matter how important it is.

Google has done a good job to backup/sync the account of the phone, it will backup the contacts, settings, call logs, sms, list of apps, and all data for Google’s app, which I would say is about 50% of the phone data. But all the user installed apps data and settings, plus data in the storage will not be backed up. Some says Google also backup third party app data, but I have never managed to get any third party app data restored when I use Google restore function, it only reinstalled back the app. Some apps save all the data in their own server, such as Lazada or Shopee app. For such apps you can easily access all your data just by simply logging back into the account. Some apps such as WhatsApp can backup everything to local storage and also to Google Drive so you can fully restore everything once you are able to log back into a phone. But that means it will count on your Drive storage limit, if you have plenty of multimedia files the backup size can be huge. Some apps such as Wechat can only backup the chat history and you need to connect it to a computer to do the backup. Some apps such as Musicolet make auto backup to internal storage, so backing up this data to offsite is enough to make sure you can fully restore the app settings. Some apps such as MiXplorer have to manually run the export settings, so it’s not very efficient. Some other apps totally have no way to do backup.

Having lost my data for few times I know why having a good backup solution is important, especially when I rely a lot on my phone. And having the backup to be automated is equally as important because I believe a good backup solution is the one that doesn’t need manual intervention. Doing it manually means after some time I will start to feel lazy to do it and finally just stop doing the backup. In this guide I will use 2 steps for completing the offsite backup, first step is to make auto backup of the user’s apps and it’s data and second step is to auto sync all that important data to offsite storage.

My backup to offsite will be over WiFi on the local network to my Synology DS920+ NAS. There are also apps that can sync data over the internet but since every schedule might transfer a few GBs, that will eat up the data quota very fast. Additionally, all the apps that I will use are free on the Play Store.

Another thing need mentioning is to backup the user app’s data, the phone need to be rooted. Without root, you can only backup the storage to offsite, which is still better than without any backup. With apps such as WhatsApp it also means you can make a full backup using its own backup function to internal storage, then backup it to offsite, very useful if you don’t want to do a full online backup which might be too big for your Google Drive.

First thing I need to do is set up the backup location. If you backup to PC by WiFi connection then you only need to set the folder where to save it, and set folder sharing to the network. If by USB then you just set the folder where to save and don’t need to follow the auto sync guide.

Side note: I feel copying files over USB is slower than by WiFi, especially when some files that have long filenames. Maybe the Android ways to connect it’s storage to PC caused it, or maybe only my phone got this problem. Some files also might not copy to PC due to Windows filename cannot contain certain characters.

For my backup I will save it in my Synology NAS. As a security measure for all the data on my NAS, I create a new user/account just for the app. I also create a new shared folder just for this backup. This way if the app is compromised it will only affect this account and this shared folder, all other data in my NAS will not be affected.

Setting a shared folder in NAS, since only for backup I don’t need this folder to appear in My Network Places. I also hide this shared folder from other users' accounts, and enable Recycle Bin just in case I need to recover the deleted data. Next, I create a new user account and set it to only be able to read and write on the backup shared folder. This is the advantage of using NAS, you can create plenty of user accounts and each account can be limited to only certain functions and folders.
user posted image

I will use 3 apps for doing my backup. Titanium Backup for backing up my apps and data, SMS Backup & Restore for backup of calls and sms, SMBSync2 for syncing the data to NAS.
user posted image

I have been using Titanium Backup for many years so I am familiar with the interface and for it’s free user functions, it is enough for making scheduled backups. But this app hasn't been updated for 2 years and newer types of apps that are using split apks will cause Titanium Backup to not be able to backup properly. Another alternative backup would be Swift Backup, but the caveat is the phone must have a Google account signed in and the data will only be saved to cloud service such as Google Drive or Dropbox or ownCLoud or Nextcloud or any server using custom WebDAV. Though I heard recently it starts allowing saving to phone’s storage, I need to explore more on this. Another backup app that I tried is OAndBackupX, it is a fork of the abandoned oandbackup app. This app is totally free and constantly updated, it also has a nice GUI. But on my testing it doesn’t correctly restore some apps and every time when it run scheduled backup, it will make a full backup of everything again while Titanium Backup can specify to only redo backup for data that has been changed, which makes the backup process much faster. Also these backup apps are unable to access storage/Android/ DATA & OBB folder if using Android 11, which is another issue that makes it unable to make a proper backup. I’ll explain more later.

Using Titanium Backup, I create backups for apps that don't save on their own server. Apps from Google doesn’t need backup as all are saved on their cloud. Apps like Shopee and Lazada that store data on it’s server as well as apps that have online sync don’t need backup. As I would schedule backup to DS920+ everyday it’s better to just do the essential apps so that I can reduce the amount of data and time taken for the whole process.
user posted image

After backup I set schedules to redo backups for modified data. This is also an advantage of Titanium Backup compared to some other backup apps, when just redoing backup for modified data it saves a lot of time. As I’m using the free version it can only choose 2 days for automated backups in a week. You also probably should not purchase the app now as it looks like it has been abandoned and now some people complain that even after purchasing the app it still doesn’t unlock full features.
user posted image

Next I set the schedule on WhatsApp to backup daily. Even without backing up videos it already took 2.1 GB space on my Drive. sweat.gif

I use SMS Backup & Restore to make backup of call logs and sms. The app also can set schedules and upload to cloud service if one needs it. I would probably not need to use this app anymore as: 1.) Google is also doing backup of call logs and sms now, though I don’t know if it can correctly restore everything, and 2.) Other apps for doing backup mostly also have integrated backup for call logs and sms, which is what I should use when replacing Titanium Backup
user posted image

I use SMBSync2 app for transferring data to other devices by using SMB protocol. This protocol is supported by almost all OS. But be careful not to use SMB v1 protocol though as it has some nasty vulnerabilities. When opened you’ll be greeted with this GUI. Not the most modern look and some of its functions not so straightforward for setting it up, but what I like about this app is it is lightweight and has plenty of options to customize, plus it is still being updated.
user posted image

Pressing the + button on the bottom and you can create a new task. It has 4 types of sync mode: 1. Mirror, 2. Copy, 3. Move. 4. Archive. For this backup I’m using Mirror mode, it makes the exact copy of data on the NAS based on the folders that I choose on my phone’s storage. For subsequent sync it will only copy over files that are modified, which is based on size and/or date/time, any files that’s deleted on my phone will also be deleted on NAS when being synced. If you also want to move data from phone to offsite, you can create a new task and choose Move mode, then specify which folder for the data to be moved from your phone. It supports multiple tasks. “Master folder” will be the storage on the phone while “Target folder” will be on NAS. Tick the “Select subdirectories” and press “Directory filter has not been specified”, inside it then press “Directory list” to list out the phone internal storage then choose which folder to sync.
user posted image

Tips: you can also set Master folder as folder in NAS and Target folder as folder in phone storage. This way you can sync files in the specified folder on your NAS to your phone.

Additional info: Earlier I mentioned the issue of unable to access storage/Android/ DATA & OBB folders on Android 11. This is due to Android 11 making Scoped Storage as mandatory, which among other things is restricting app access only to their own folders that’s within these 2 folders. From security POV this is good as now app can’t snoop other apps data but for file manager or backup app this means you can’t copy/backup files in these folders. This also means your backup of the app will not be a full backup. As of now some file managers such as X-plore and MiXplorer have managed to find a workaround (by using API target for Android 10) and are able to access all data on those folders. Google promised to fix it but later on blame Covid-19 for the delay, hopefully Google will come out with the fix this year. This mean SMBSync2 also unfortunately unable to access these folders if the phone is running Android 11, so this is something to take into consideration if you’re using the latest Android version.

Continue on, to set the Target folder on the NAS, press the “Target folder” and press “Storage type”, it will open 5 selections, choose “SMB Server”, the page will change for setting up SMB. Press “Search SMB server” and wait till it finds the NAS then select it. For security, choose the highest SMB protocol. Also tick “Use SMB2 negotiation” and “SMB IPC Signing Enforced”. Add the username and password to get access into NAS. Press the “List Shares'' button to select the shared folder and “List Directories” to select the folder where you want to mirror/copy the data. Press save after all is done.
user posted image

One of the great things about SMBSync2 is that it has a lot of custom settings. For example, if you set static IP for your phone on the router, you can specify for SMBSync2 to run the sync only when it detects the correct IP. If you are in some other place with a different IP, it won’t try to run the task. It also can set if you want to include hidden folders/files, if don’t want the attribute of last modified time on NAS to match the files in the phone, also few more options on how to determine if a file in phone is different from the file in NAS.
user posted image

Now to create scheduled tasks so that it will auto sync at designated time/days. Go to the Schedule tab and press the + button at the bottom. Here, the sync options are very robust. You can even set it to sync every hour if you so wish so. Other options are for sync everyday or specify which days of the week. Also can set to sync by interval and also sync by monthly with option to set it sync on the last day of every month. Also can set if you want the schedule to only run when charging. It also supports multiple different schedules.
user posted image

And that’s it! Now my apps will be auto backup into internal storage and then auto backup to my Synology NAS. It would auto run the backup without me needing to do any manual interruption. I say it again for last time, a good backup is one that is fully automated. cheers.gif

This post has been edited by xxboxx: Mar 14 2021, 10:26 PM

 

Change to:
| Lo-Fi Version
0.0134sec    0.38    5 queries    GZIP Disabled
Time is now: 29th March 2024 - 01:24 PM