Skip to main content

Backup your Pieces Database

Backing up your Pieces Database is a crucial step to ensure you don’t lose any of your code snippets. This guide will walk you through how to easily back up and restore your Pieces Database within the Pieces Desktop App.

tip

When you finish working on your personal computer for the day, make sure to back up your Pieces Database. Later, when you switch to your work device, restore the database there. Similarly, after finishing work on your work device, back up the database, and then restore your personal device from the latest backup.

Creating a Backup​

  1. Open the Pieces Desktop App.
  2. Click on your profile icon in the top-right corner of the app.
  3. Select Backup & Restore Database.
  4. In the pop-up window, click on the Create Backup button.

Restoring a Backup​

  1. Open the Pieces Desktop App.
  2. Click on your profile icon in the top-right corner of the app.
  3. Select Backup & Restore Database.
  4. In the pop-up window, find the backup you want to restore and click on the Restore button.

Deleting a Backup​

  1. Open the Pieces Desktop App.
  2. Click on your profile icon in the top-right corner of the app.
  3. Select Backup & Restore Database.
  4. In the pop-up window, find the backup you want to delete and click on the Delete button.

Offline Backup​

info

Manual backups are ONLY compatible with the same and future versions of Pieces OS and Pieces Desktop as when it was created. If it was created with Pieces OS 1.9.1 and Pieces Desktop 1.9.2, then it is compliant with those same versions and all future versions when restoring the backup.

Please note that you CANNOT go backward in versions. For example: on one computer you have Pieces OS 1.9.3 and Pieces Desktop 1.9.4, and you attempt to restore this database on Pieces OS 1.9.0 and Pieces Desktop 1.9.1, this will fail and your Pieces OS will NOT function properly. To resolve this please first update your version to the latest on Pieces Desktop and Pieces OS and then repeat the restoration process.

Creating an Offline Backup​

Step 1: Quit Pieces OS and Pieces Desktop​

Please quit Pieces OS and Pieces Desktop and make sure neither are actively running.

  1. To quit Pieces OS, open the Pieces OS toolbar app towards the top of your Desktop and select Quit
  2. To quit Pieces Desktop, select Pieces in the top-left of your macOS toolbar and select Quit

Step 2: Locate your Pieces Database​

Open your Finder and navigate to your Home folder.

If you cannot see your Home folder on the left-hand side of your Finder, simply tap Shift+Cmd+H to open it

Navigating to home folder

Step 3: Locate your Pieces Database​

Once in your Home folder, you’ll need to click Shift+Cmd+. (shift, command, period) to show your hidden files & folders. Once they are visible, find your Library folder and click it.

Selecting your Library Folder

Step 4: Locate your Pieces Database​

Next, locate the folders titled com.pieces.os and com.pieces.pfd. These folders represent your Pieces OS & Pieces Desktop databases.

Step 5: Compress the folders​

Select both folders (com.pieces.os and com.pieces.pfd), right-click, and select Compress.

info

This may take some time, especially if you have any local LLMs downloaded. If you do have any local LLMs downloaded, you may cancel the compression, open Pieces Desktop App, and delete the local LLMs you have downloaded. However, you MUST restart the guide from Step 1 if you choose to do this.

Step 6: Rename the Zip file​

This will create a new Zip file titled, Archive. From here, you can enter a new name. We recommend naming this, pieces_backup_(month)_(day)_(year).

From here, you can place this Zip file anywhere you desire, whether it be another folder on your machine or in cloud storage such as Google Drive, Dropbox, or OneDrive.

info

Backups are ONLY compatible with the same and future versions of Pieces OS and Pieces Desktop as when it was created. If it was created with Pieces OS 1.9.1 and Pieces Desktop 1.9.2, then it is compliant with those same versions and all future versions when restoring the backup.

Please note that you CANNOT go backward in versions. For example: on one computer you have Pieces OS 1.9.3 and Pieces Desktop 1.9.4, and you attempt to restore this database on Pieces OS 1.9.0 and Pieces Desktop 1.9.1, this will fail and your Pieces OS will NOT function properly. To resolve this please first update your version to the latest on Pieces Desktop and Pieces OS and then repeat the restoration process.

Restoring the External Backup​

Step 1: Quit Pieces OS and Pieces Deskto[]​

Please quit Pieces OS and Pieces Desktop and make sure neither are actively running.

  1. To quit Pieces OS, open your system tray in the bottom-right corner of your Desktop, then right-click the Pieces OS icon, and select Quit.

  2. To quit Pieces Desktop, right-click the app icon in your system toolbar and select Quit.

Step 2: Locate the compressed backup file​

Locate the compressed Zip folder containing both your com.pieces.os and com.pieces.pfd backups.

Step 3: Navigate to your Pieces Database​

Navigate back to the Library folder either on the same or your different machine.

Step 4: Unzip the compressed backup file​

Unzip the compressed backup file.

Step 5: Replace the existing database​

This next step is critical. If you have an existing Pieces database already located in your current folder on your device, you will see a window similar to what’s shown below.

Replace dialog popup

This step is asking if you’d like to override the existing database with your backup.

  • If you’d like to override, select Replace the files in the destination
  • If you don’t want to override, abandon the process by pressing Stop

Step 6: Restart Pieces OS and Pieces Desktop​

Lastly, if you chose to proceed with restoring the backup, you will need to restart both Pieces OS and Pieces Desktop for the changes to take effect.

Support​

As always, if you run into issues or have feedback, please fill out this quick form or email us at support@pieces.app, and we’ll be in touch as soon as possible!