Backup

1. What it does

Make sure to never lose your data with either local manual backup or automated cloud backup.

2. Where to find it

  • Leftmenu → Backup

  • Settings → Services → Cloud backup

3. Options

Left ☰ menu → Backup
Export data

Exports all your sleep records, noises and preferences to ZIP files located on your phone at /sdcard/sleep-data/. Use for local backup or for your own analysis of sleep tracking data. The command also zips up the CSVs and offers to share.

Upload to Cloud

Starts synchronization set in Settings → Services → Cloud backup and uploads data from phone to cloud.

Import data

Starts import of data from /sdcard/sleep-data/sleep-export.zip (local backup).

Note If you already have existing sleep records in Sleep, import will not overwrite them. It will just import new records that are present in the import file.
Download from Cloud

Starts synchronization set in Settings → Services → Cloud backup and downloads data from cloud to app.

Settings → Privacy → Backup
SleepCloud

See SleepCloud backup

Cloud backup

Main switch for cloud backup. If disabled, no cloud backup will take place.

Local storage backup

If disabled, Sleep will not be doing daily local backup.

Restore settings

Restore app’s settings from locally saved prefs.xml file. See local backup for details.

4. Guide

4.1. Local backup

Backs up: Sleep records, Settings, Noise recordings, Noise recordings metadata, Active alarms
Does not back up: Inactive alarms

Your data are being backed up on a daily basis to /sdcard/sleep-data/ folder on your phone. You can also start local backup manually using Leftmenu → Backup → Export data.

What is backed up in this folder:

/rec folder

Contains all your recorded noise files.

noise.json

Noise metadata

prefs.xml

Settings

sleep-export.csv

Latest sleep data

sleep-export.backup.csv

Sleep data from the previous backup

ZIP file

all the above (except /rec folder) are zipped up here for easy sharing

You can also open the CSV file on your computer (e.g. in Excel) for your own analysis of the sleep tracking data. The structure of the CSV file is documented here.

The backup zip file can be used for migrating your Sleep settings and tracking history to a new phone - see our detailed guide.

Backs up: Sleep records, Settings, Active alarms, Noise recordings metadata
Does not back up: Noise recordings, Inactive alarms

Recommended backup service. It stores data in our own cloud designed for Sleep as Android. It has several unique features not present in other backup methods.

4.2.1. Prerequisites

  • You need SleepCloud Backup add-on installed on your phone.

  • In order to use SleepCloud, you need to have a valid Google account and grant us a permission to use this account when connecting to the cloud.

4.2.2. Setting up

  1. Go to Sleep → Settings → Privacy → SleepCloud and connect SleepCloud.

4.2.3. Features

  • Free SleepCloud service automatically initiates back up once a week.

  • The paid PRO version automatically initiates backup when some relevant change happens (a new graph was added, an old graph was edited, etc.). You can force backup using Leftmenu → Backup → Upload to Cloud

  • You can view and modify your data online, by visiting SleepCloud.

  • Unlike other services, it does a full synchronization of records including deleting/updating of existing records. This makes it the most suitable service to synchronize data among multiple devices.

  • It uses optimized communication protocols, so it consumes least data of all services.

  • Synchronizes all of your settings (including active alarms), so if you get a new phone, just install SleepCloud backup and all your settings will be downloaded along with the records. It works in an inobtrusive way, so if you’ve changed any of the settings on the new phone already, they won’t get overwritten.

4.3. Backup to Dropbox or Google Drive


Backs up: Sleep records
Does not back up: Settings, Noise recordings metadata, Noise recordings, Alarms

To automatically backup your data to Dropbox or Google Drive:
. Install SleepCloud Backup add-on.
. Go to Sleep → Settings → Services → Cloud backup and connect either Google Drive or Dropbox.

  • Free SleepCloud service automatically initiates back up once a week.

  • The paid PRO version automatically initiates backup when some relevant change happens (a new graph was added, an old graph was edited, etc.). You can force backup using Leftmenu → Backup → Upload to Cloud.

4.4. Backup using Google provided backup cloud

Backs up: Sleep records, Settings, Alarms, Noise recordings metadata
Does not back up: Noise recordings

Most Android phones support Google provided backup. This is an optional feature and it must be explicitly enabled by the user.

Note We recommend using other methods, preferably SleepCloud, to backup your sleep records, as we have no direct control over initiation of Google backup so it may not work in all cases. This method is NOT meant to be used for synchronization of data or settings across phones.
  1. Enable Backup to Google Drive in System Settings → System → Backup (might be hidden under Advanced options) → Back up to Google Drive - our application will backup your graphs and your alarms to a Google cloud (automatically in background; you do not need to do anything).

  2. Enable Automatic restore option in System Settings → System → Backup (might be hidden under Advanced options) → App data - when you install a new installation of Sleep as Android on a phone where the Automatic restore option is enabled, all data will be automatically imported. You’ll get your sleep records and your alarm settings restored.

  3. In case you have developer tools available, you can force Google backup and restore to get reliable results. To force the backup, you can run “adb backup -f sleep-backup.bk com.urbandroid.sleep” when the old device is connected and to upload the backup to a new device run “adb restore sleep-backup.bk”.

4.5. Import data from email, Google Drive, Dropbox

If you tap on the CSV or ZIP file that was exported from Sleep (anywhere - in your email attachment, Drive, Dropbox, file manager), the system will offer to open it with Sleep as Android. This will import the included sleep records.

FAQ

Alarms play at max volume

  • Most probably your Backup alarm went off after regular alarm did not wake you up. Backup alarm is triggered when there is no interaction (no snooze, no dismiss) for more than 20 minutes.

  • Make sure you are using volume strong enough in Settings → Alarms → Ringtone, or enable Gentle Volume increase in Settings → Alarms → Gentle volume increase

  • Try vibrations (Settings → Alarms → Vibrate).

Send us your log using Leftmenu → ic bug Report a bug

I have a new phone, and I would like to transfer all the data I collected so far

There are five possible ways to transfer your data to a new devices:

1. Google backup

Normally we use Google’s backup function, if enabled in System settings → Privacy.
After installing Sleep as Android on the new device, you will get all your settings, alarms and other data. This assumes you install with a fast network connection enabled.

2. Import / export in the app - manually

You an also do a manual export/import process:

  1. Go to the Leftmenu → ic cloud upload Backup → Export, and make sure the dialog says "successful".

  2. Copy the directory /sdcard/sleep-data to your new phone’s SD card.

  3. Install Sleep as Android on the new phone and immediately go to Leftmenu → ic cloud upload Backup → Import.

    Note If you don’t import immediately, the app will replace your sleep-export.zip file after the next sleep record is created. The old sleep-export.zip file will be renamed to sleep-export.backup.zip. See solution.

3. Import / export in the app - sending the backup file with email

For even easier migrating to a new phone, you can use your email.

  1. Go to the Leftmenu → ic cloud upload Backup → Export.

  2. When a dialogue "Successful backup to your local storage" appears, choose "Share" button.

  3. Now, you can choose your email client, and the backup zip file is attached to the body of a new email.

  4. Send it to yourself.

  5. Open the email client on your new phone, open the email, and tap on the attachment.

  6. You will be asked which data you wish to import - select all types of data you wish to import, and submit.

4. Import / export in the app - sharing the file with Google Drive

Another easy way of migrating to a new device is Google Drive sharing.

  1. Got to the Leftmenu → ic cloud upload Backup → Export.

  2. When a dialogue "Successful backup to your local storage" appears, choose "Share" button.

  3. Choose Google Drive, and confirm.

  4. Then open Google Drive on your other device, and select the backup file.

  5. You will be asked which data you wish to import - select all types of data you wish to import, and submit.

5. Sleep Cloud

Third option is to use some of the Cloud Backup methods from the SleepCloud Add-on. Please, see more about Backup.

Manual backup - cannot import data on my new phone

If you moved a sleep-export.zip file to your new phone and did not import the file before the app created a new sleep record, the app has replaced your sleep-export.zip. The old sleep-export.zip file was renamed to sleep-export.backup.zip.

To restore the old data:

  1. Delete the sleep-export.zip file.

  2. Rename sleep-export.backup.zip to sleep-export.zip.

In Sleep, do Left menu > ic cloud upload Backup > Import data.