Export / import workspace config or backup #8182
Replies: 26 comments 12 replies
|
yes - this seems like an excellent idea! |
|
YESS! I have been looking for this for a long time, it would really be helpful to have that! |
|
Yes, this is needed. I know there is a work around to backup entire profiles, but I doubt this is what this is all about. I don't care to lose browser data and cache, even stored passwords, you shouldn't use your browser as password manager anyways. It's all about the workspaces and tab containers, the icons and names I picked for them. It is about all the settings you can make in Firefox itself, it is about all the changes I made in Why is there no easy way, I hope this will happen somehow. Maybe someone can share at least a manual way to do this. |
|
RE: the mods also need export feature in a user friendly way like saved to a file for user to easily copy paste and import. Ideally might as well solve all settings problem at once maybe like a export all in one zip with: and just put it into a zip and then zen browser can unzip and reimport those one by one. |
|
It would be fantastic if we could copy-to and apply-from the clipboard parts of the browser state. It could be done incrementally, for example, first only the workspaces: zen:
workspaces:
- name: Default
pins: []
tabs: []And the endgame could look like something like this: zen:
config: {}
extensions: []
mods: []
bookmarks: []
history: []
essentials: [] # or globalPins
workspaces:
- name: Default
pins: []
tabs: [] |
|
+1 |
This comment was marked as spam.
This comment was marked as spam.
|
wish it will be implemented at some point |
|
Why hasn't this been implemented yet? Every time I install it or re-install it, I lose my setup. And there's just no way of sharing all of the settings between machines. This is really annoying. For example I just want from a local installation on Linux to the Flatpak version of Zen. And guess what? There's just no way of taking over the settings from the old installation to the new one. Not through import, not by moving configurations from the old config directory to the new, nothing. So I am starting at 0 again even though the configuration was placed where it should be. The software just doesn't use it. Insane. Have to reinstall all mods, open all of the tabs in my 3 workspaces... Why do we have new features if those can't be shared between installations? |
|
@mr-cheffy @zen-browser-auto |
|
Like syncing? |
|
Sync to mozilla account? Is it safe to implement? Aren't we have workspace sync, or add one more things to sync the folders, pinned tabs and essentials? |
|
I created this tool: zen-export. I don't know JS well so I unfortunately had to rely on AI (local Ollama), but from poking around the Browser Console I was able to find where most the tabs and folder data lives and use specific functions to have it format everything correctly. |
|
Just installed Zen on my work mac after having been a very happy Zen user on Fedora for the last couple of months. Want to show my support for this idea. I am not looking forward to setting up all the workspaces a second time, let alone on every machine individually. Please consider this and thanks for this great project! |
|
A very good idea indeed. I would wish for Zen Sync service since Mozilla's sync still unable to save favicons with bookmarks in 2025 (facepalm). |
|
Zen Browser is such a great tool and such a breath of fresh air, but then I switch back to my desktop and none of the setup/tabs etc have synced across. It's a clean slate. Becomes a huge impediment for committing to switching over. Sync maybe a dream too big, but at least the option to export out a setup (and have that auto backup every day), then an option to pull that export into a new install on another device. |
|
+1 |
|
yep same here, had to get rid of my profile and there was no way to export all pinned tabs etc before doing so |
|
thanks for @thebitstick , i add some script to export/import single folder in thebitstick/zen-export#3. Usage for zen-export/zen-importWhat it isThe zen-export.js and zen-import.js scripts provide a way to export and restore folder data in Zen Browser. How to use
You can also use the zen-import.js script, which defines a function |
|
I have been working on creating a repo for my dotfiles. I noticed .zen in my home dir, so I copied that and deleted the existing one. when I started zen it wanted to go through the setup again. I deleted .zen from my home dir and then copied the backup I made in place and everything came right back in zen. The trick now is finding the specific dotfiles needed to backup. |
|
+1 |
|
is there no config file that we can just copy and replace in the files of the new machine to get the same workspace settings? |
|
Just a guess here: would it be easy enough for Zen to just treat pinned tabs as more bookmarks for the purpose of export/import? Workspaces could then also just be bookmark folders under a special "workspaces" folder in the bookmark export. I don't know the Firefox code well enough to say but conceptually pinned tabs play a very similar role as bookmarks and the bookmark manager already has a couple of special folders for Bookmarks Toolbar and Bookmarks Menu. Seems to make sense that Workspaces could just be another entry there and sync that folder with whatever Zen is doing with the sqlite dbs and such. |
|
I went ahead and tried to tackle it in the least exciting way possible. I grabbed the zen folder from my macOS and from my Linux machine. I patched the profiles.ini and installs.ini to let both installations point to the same profile, which I also renamed. This step didn't cause any problems so far. Then I wrote a little script to export and import my profile including those two files. I also made sure to exclude the Do not run this, it is for demonstration purposes only, it will corrupt your browser configuration, see below! # zen profile import/export
zep() {
if [ $# -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "Usage: zep [-h, --help] [-e, --export, -i, --import] file" >&2
echo "Imports or exports all Zen browser profiles, excluding storage." >&2
echo '' >&2
return 129
fi
local osfam="$OSFAM"
if [ -z "$osfam" ]; then
osfam="$(uname -o | tr ' ' '_' | tr '/' '_')"
fi
local zendir=""
if [ "$osfam" = "Darwin" ]; then
if pgrep -f '/Zen\.app/Contents/MacOS/zen' >/dev/null 2>&1; then
echo "Zen Browser is still running. Please close it first." >&2
return 2
fi
zendir="$HOME/Library/Application Support/zen"
elif [ "$osfam" = "GNU_Linux" ]; then
zendir="$HOME/.var/app/app.zen_browser.zen/.zen"
if pgrep -x zen >/dev/null 2>&1 || \
pgrep -x zen-bin >/dev/null 2>&1 || \
pgrep -x zen-browser >/dev/null 2>&1; then
echo "Zen Browser is still running. Please close it first." >&2
return 2
fi
fi
if [ -z "$zendir" ]; then
echo "Unsupported OS: $osfam" >&2
return 1
fi
if [ "$1" = "-e" ] || [ "$1" = "--export" ]; then
shift
printf "Exporting '%s' to file '%s'...\n" "$zendir" "$1"
tar -C "$zendir" \
--exclude 'Profiles/*/storage' \
--exclude 'Profiles/*/storage/*' \
-cf "$1" Profiles installs.ini profiles.ini
elif [ "$1" = "-i" ] || [ "$1" = "--import" ]; then
shift
mkdir -p "$zendir/.zep"
printf "Removing old backups from '%s'...\n" "$zendir/.zep/Profiles"
rm -rf "$zendir/.zep/Profiles"
printf "Backing up old profiles to '%s'...\n" "$zendir/.zep/Profiles"
mv "$zendir/Profiles" "$zendir/.zep/Profiles"
printf "Importing file '%s' into '%s'...\n" "$1" "$zendir"
tar -xf "$1" -C "$zendir" Profiles installs.ini profiles.ini
printf "Restoring storage from old profiles...\n"
for profile in "$zendir/.zep/Profiles"/*; do
mv "$profile/storage" "$zendir/Profiles/$(basename "$profile")/storage"
done
fi
}Why does this not work? Well I went ahead (after backing up my files ofc), and exported on macOS and stored the tar file in my SyncThing to sync it. Next I booted into Linux, wait for the sync to complete and imported it. To my surprise, everything worked. Then I exported on Linux, synced and booted back into macOS. I tried to import my profiles back into my macOS instance, this did not work. While the browser starts, it stopped loading any extensions. All my keybindings that were mapped with ctrl+whatever were now cmd+whatever. When I fixed my keybindings cmd+q would trigger my ctrl+q binding, it was a mess. There is probably more that is broke. In summary: My little function here "could" work, if you try to sync between the same OS on two machines using SyncThing, but I learned the hard way that you cannot mix those files between macOS and Linux, which is a bummer. It really looked too good to be true. I want my pinned tabs, I want my normal tabs, I want my browser settings, I want my browser extensions and its settings. I want my full |
|
After the window sync PR merge: folders, tabs, spaces, etc etc are now stored into a zen-session.jsonlz4 file, which can be used for backing up and restoring all zen's sidebar UI! |
|
You can also just back up your browser profile and restore it elsewhere. Follow the firefox instructions: https://support.mozilla.org/en-US/kb/back-and-restore-information-firefox-profiles |
Uh oh!
There was an error while loading. Please reload this page.
Zen has been one of the project I love the most these past months, and I love what it stands for. But I've been multiple times in the situation of a reset / migration where I had to manually transfer or remember every workspace, every tab i have set up.
In my opinion, this is fastidious. I tried through the discussions and issues to see something similar to this request but did not found what I was looking for.
What I am talking about is a way to export your current config (workspace by workspace) to be able to save it (backup) or share it for example in a data filetype like json/yaml/toml/... And obviously a way to import it afterward.
I deeply think that this would be a major bonus to the project. Thanks for reading me ^^
All reactions