how to backup (and restore)

edited February 2013 in Stylish
I am sure this must be posted somewhere but didn't find it so far. I'd like to backup the styles from one mac to another so I can use them in the Chrome extension.

there's no export, so what directory are they stored in?

Comments

  • edited February 2013
    In your user data directory is a folder named databases, and in databases is a folder named chrome-extension_fjnbnpbmkenffdnngjfgmeleoegfcffe_0 (that's the Welsh name for Stylish in the middle). In that folder is a single file with a number for a name - that file is your Stylish database.

    In Mac #2 install at least one style (else Chrome will jettison the empty database when it closes) and close Chrome. Find the Stylish database in Mac #2 as you did in Mac #1, and replace it with a copy of the database from Mac #1, giving the copy the name of the file it replaces. Restart Chrome - done.
  • Fantastic. thank you!
  • Has this changed? I no longer see any file with a number in that directory. How can I move styles from one machine to another?
  • edited June 2014
    No, it hasn't changed. Chrome won't save an empty database - install a style before you close Chrome, then copy your old database over the new database while Chrome is closed.
  • edited September 2014
    This didn't work immediately for me. It took a while for the fucking styles to show up in Stylish.
  • edited September 2014
    In Chrome? Never happened.

    If you copy the database when Chrome is closed as instructed, all styles in the database will be available when Chrome next starts. If you copy the database when Chrome is open, Chrome will either overwrite it when it closes (if you've added a style since it started) or ignore it when it restarts (if the new database is empty). There's no "it took a while" in either case - it either worked or didn't from the start.
  • I can't get the file to show up either. Is there another way to force the file to be created?
  • edited August 2016 Firefox
    Stylish for Chrome switched from WebSQL to IndexedDB. Your styles are now in
    [profile folder]/IndexedDB/chrome-extension_fjnbnpbmkenffdnngjfgmeleoegfcffe_0.indexeddb.leveldb/
    In Chrome you can simply copy that folder's contents to back up styles, and replace (all of) its contents to restore a backup. However, there is no end-user equivalent to SQLite Manager for LevelDB databases, and GOK how Mozilla implemented IndexedDB in SQLite, so copy+paste is about all you can do.

    (A very bad change indeed, JasonBarnabe - please roll it back. In the meantime you should check whether Firefox also ignores the database origin when an extension opens an IndexedDB database - if not, even the simple backup-restore I've described here will fail in Firefox.) Wait, no, restoring to the same installation should work, but restoring to a different Firefox instance may fail - depends on (1) whether they're checking the db origin at all, and (2) whether they're using the "friendly" extension ID that is Stylish-specific or the unique instance-specific extension ID that's generated on install.
  • edited August 2016 Chrome
    Are the files created for chrome and chromium the same? I tried copying them to a linux machine using chromium and it didn't seem to work.
    EDIT - It apparently just needed time. I was doing some other things for about 10 minuets, then opened chromium again and its working fine.
  • Chrome must be closed when you fiddle the database. It caches the database and reads from the cache, and overwrites the database file from the cached copy when you add a style.
  • edited February 23 Chrome
    Ive tried multiple different ways, I can't get it to work. it deletes all the files when chrome starts. I am making sure to download at least one style, closing chrome. Replacing the .log file and renaming it to the replaced .log. I also tried copying the other files in the indexdb folder and tried without renaming anything at all. it always deletes everything when chrome starts back up no matter what combination of things I try.

    Any help plz? I had to fresh install because my pc was stuck in a boot loop. I barely recovered the file with a recovery program, but now I can't restore userstyles. I was in the process of making 2 different user styles and spent days on them. So it's not like I can redownload from the site, I never had a chance to upload :(
  • I'm having the same problem as the guy above. This really sucks. Is anybody else encountering this issue? I feel like it's possible recent updates from either the devs or Chrome make this method of restoring your styles obsolete... :/
Sign In or Register to comment.