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.

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.
Upload to Cloud

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

Download from Cloud

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

Download from Google Fit

Starts synchronization with Google Fit service.

Settings → Privacy → Backup

For more details, please read the Backup section of Privacy settings.

4. 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.

Note Do not use if you plan to reinstall the app, or to clear the app’s data!
If you wish to use manual backup for these purposes, tap the SHARE button on the dialogue, and save the file to a different location, add it to an email, or save it to a cloud service.

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.

6. Backup to Dropbox or Google Drive


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

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.

  • The back up service will create a Sleep as Android folder within the Google Drive storage, and Sleep Cloud Backup folder within the DropBox service.

Google Drive last back up
DropBox last back up

Note If the backup to a cloud service fails, you will see a notification in the notification center. If this happens, please contact support@urbandroid.org.
backup fail

7. 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 One in System Settings → System → Backup (might be hidden under Advanced options) → Back up by Google One - the system will backup to a Google cloud automatically in background, or you can force immediate back up with "Back up now" button.

  2. 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”.

Google One backup

8. 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.

Importing

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 Left ☰ menu → ic help q Support →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 Leftmenu → ic cloud upload Backup > Import data.