Brave is an open source web browser software built on Chromium that can run on many operating systems (Windows, macOS, Linux, Android, iOS). Brave, which is being developed by Brave Software, aims to be a privacy-focused browser, and in this way, it can block online advertisements and various scripts that can track users without the need for an external plugin.
While using Brave, for some reason, you may need to move the shortcuts, quick access links or previous session information you created on the browser to a different computer or user session.
In this article, we will cover how to backup Brave web browser session. The Linux distribution we will use for this job will be Ubuntu 22.04. Let's start.
How to backup Brave web browser session?
After Brave installation, Brave files are created in 2 different directories under the user home directory by the system:
foc@ubuntu22:~$ find . -iname "BraveSoftware"
./.config/BraveSoftware
./.cache/BraveSoftware
As the file names suggest, one of the files stores the configuration information, and the other stores the cache files. One thing to note is that file ownerships and file permissions should be protected during backup or migration.
Permissions and ownership for config file:
foc@ubuntu22:~$ ls -la .config/BraveSoftware/
drwx------ 27 foc foc 4096 Kas 15 08:34 Brave-Browser
Permissions and ownership for cache file:
foc@ubuntu22:~$ ls -la .cache/BraveSoftware
drwx------ 3 foc foc 4096 Kas 15 08:02 Brave-Browser
Taking backup
Let's back up the .config directory first:
foc@ubuntu22:~$ cd ~/.config/
Compress the BraveSoftware directory with the tar command:
foc@ubuntu22:~/.config$ tar -zcvf BraveSoftware_config.tar.gz BraveSoftware
BraveSoftware/
BraveSoftware/Brave-Browser/
BraveSoftware/Brave-Browser/CertificateRevocation/
...
File successfully compressed:
foc@ubuntu22:~/.config$ ls -la BraveSoftware_config.tar.gz
-rw-rw-r-- 1 foc foc 46503203 Kas 15 09:20 BraveSoftware_config.tar.gz
Then move the compressed file to the home directory and change to the home directory:
foc@ubuntu22:~/.config$ mv BraveSoftware_config.tar.gz ~ foc@ubuntu22:~/.config$ cd ~
You can see the file contents without opening it as follows:
foc@ubuntu22:~$ tar -tf BraveSoftware_config.tar.gz
BraveSoftware/
BraveSoftware/Brave-Browser/
BraveSoftware/Brave-Browser/CertificateRevocation/
BraveSoftware/Brave-Browser/CertificateRevocation/7702/
...
Now back up your .cache directory:
foc@ubuntu22:~/.cache$ cd ~/.cache
The .cache
directory also contains the BraveSoftware directory. Compress with the tar command:
foc@ubuntu22:~/.cache$ tar -zcvf BraveSoftware_cache.tar.gz BraveSoftware
BraveSoftware/
BraveSoftware/Brave-Browser/
BraveSoftware/Brave-Browser/Default/
BraveSoftware/Brave-Browser/Default/Cache/
...
The BraveSoftware directory was also successfully compressed:
foc@ubuntu22:~/.cache$ ls -la BraveSoftware_cache.tar.gz
-rw-rw-r-- 1 foc foc 3465176 Kas 15 11:45 BraveSoftware_cache.tar.gz
Move the compressed file to the home directory, and view it with the tar command:
foc@ubuntu22:~/.cache$ mv BraveSoftware_cache.tar.gz ~ foc@ubuntu22:~/.cache$ cd ~
foc@ubuntu22:~$ tar -tf BraveSoftware_cache.tar.gz
BraveSoftware/
BraveSoftware/Brave-Browser/
BraveSoftware/Brave-Browser/Default/
BraveSoftware/Brave-Browser/Default/Cache/
...
Move these files from the user's home directory to the new user's home directory. Then proceed to the restore step.
Restoring the backup
To restore from backup, navigate to the new user's .config
directory:
faruk@ubuntu22:~$ cd ~/.config/
First back up the previous data:
faruk@ubuntu22:~/.config$ mv BraveSoftware BraveSoftware-old
Then move the compressed files here:
faruk@ubuntu22:~/.config$ cp ~/BraveSoftware_cache.tar.gz .
Uncompress the file compressed with the tar command in this directory with the tar
command:
faruk@ubuntu22:~/.config$ tar -xzvf BraveSoftware_cache.tar.gz
In this case, you have 3 BraveSoftware files. Old configs, new config and compressed file.:
faruk@ubuntu22:~/.config$ ls BraveSoftware*
BraveSoftware_cache.tar.gz
BraveSoftware
BraveSoftware-old
Compressed file and old backup file are up to you, you can delete it if you want.
Now restore the .cache
backup:
faruk@ubuntu22:~/.config$ cd ~/.cache/
Backup the old Brave Software directory, move the compressed file to the .cache
:
faruk@ubuntu22:~/.cache$ mv BraveSoftware BraveSoftware-old faruk@ubuntu22:~/.cache$ cp ~/BraveSoftware_cache.tar.gz .
Extract the file with the tar
command:
faruk@ubuntu22:~/.cache$ tar -xzvf BraveSoftware_cache.tar.gz
When the backup finishes restoring, launch Brave browser to start using your old settings.
Summary
In this article, we have backed up the Brave web browser session. You can also store your backups in a different location. This media can be portable disk, ftp or cloud media. You have an archive when you need to use it again later.
You can get help with the problems you encounter on the Brave community page.
References
Linux, how to restore Brave bookmarks, settings and passwords from backup of /home/user/
Backup Bookmarks and AutoFormFill data on Linux system