Backup and restore your data

This article explains how to backup and restore your data.

= rsync = A method that works regardless of which UI is installed, is using the tried and tested command-line program rsync.

= Backing up data = Make sure is installed on your phone and PC before you begin and SSH is enabled.

On your PC, create a folder where you want to backup your phone data too. In our example we'll use.

$ mkdir ~/postmarketOS_backup $ rsync -avz --exclude=.cache :/home/ / ~/postmarketOS_backup/

makes sure rsync runs in archive mode,  increases verbosity so you can see the files being transferred, and   compresses the files during transfer to speedup the transferring. makes sure the  directory is skipped, as those files are temporary and do not need backing up.

You can now see all your files from your phone on your PC in

= Restoring data = After making sure your upgraded or new installation is running properly it's time to restore the data you backed up earlier. Make sure is still installed and SSH is still enabled.

From your PC:

$ rsync -avzu ~/postmarketOS_backup/ :/home/ /

The single letter arguments to  are the same with the notable exception of. That arguments makes sure files that are newer on the destination (phone) are skipped. This is mainly needed for cases where processes running on the phone constantly alter files (and are thus newer) like KDE's Baloo.