New laptop? Restore Publii website hosted on Github Pages from backup

Mandatory steps to restore from backup

  • Install Publii app on your laptop.

  • Open Publii and choose “Install from Backup”

    • Choose latest backup file from Onedrive_i.a.j-gmail.com/publii-gh-pages-websites/backups
  • Once the site backup loads in Publii, click on “Provide access data” in bottom left corner.

    • Select “Github Pages”

    • The configuration below is for my site, please change it to match the config of your website:

      Website URL: `amberja.in`
      Username/Organization: `amberj`
      Repository: `personal-website` OR `SerenivueStays`
      Branch: `main`
                Token: Token `Publii GitHub Page v2.0` from `Dropbox/logins.txt`
      Click "Test connection".
      
  • Themes: Click on 3 dots icon in top-right corner, then click “Themes” and add:

      - "Mono" theme: https://marketplace.getpublii.com/themes/mono/ on personal-website
      - "Mercury" theme: https://marketplace.getpublii.com/themes/mercury/ on Serenivue Stays
      - Note to self: The theme file is kept in `Onedrive_i.a.j-gmail.com/publii-gh-pages-websites/themes/` 
      - On personal-website, the theme uses icon pack plugin Feather Icons https://marketplace.getpublii.com/plugins/feather-icons/, but I decided not to use icons in navigation bar. You can insert code like `[fi=bell]` anywhere to insert an icon.
      - On Serenivue Stays, install Google analytics https://marketplace.getpublii.com/plugins/google-analytics/ and Simple Lightbox Gallery https://marketplace.getpublii.com/plugins/simple-lightbox-gallery/ plugins.
    
  • Now make some minor edit to any post or page. Then click “Sync your website” to see if sync is working (from local to Github pages) and double-check the same by verifying that the minor edit is reflected on Github Pages website.

Change location of Sites folder and Backups Folder

  • Note down the location of folder where Publii was installed by default (usually ~/Documents/ on Mac).
  • Open Onedrive_i.a.j-gmail.com/publii-gh-pages-websites/ and create a new folder with appropriate name to uniquely identify this installation. Create subfolders inside this folder with name sites and backups
  • Click on three dots in top right corner of Publii’s main screen and click on “App Settings”.
  • Scroll down to “Files location” section/block.
  • Change “Sites location” here to the Onedrive folder (Don’t select the checkbox that appears when you change the location).
  • Change “Backup location” here to the Onedrive folder.
  • Click “Save Settings” at the bottom. This should move Publii Sites from old folder to new location on Onedrive.
  • As a last step, COPY (don’t move) original Publii folder (where it was installed by default) and back it up as well (just in case something goes wrong). * If you start getting errors about config files missing, then make sure that original Publii folder is still kept in original folder.
  • Also goto Publii > three dots in top right corner > Themes and make sure that Mono theme is visible as thumbnail. If not, delete and add it again.

Plugins

Additional options

To be done:

Related post