Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to Sandbox #288

Closed
kode54 opened this issue Jun 27, 2022 · 2 comments
Closed

Migration to Sandbox #288

kode54 opened this issue Jun 27, 2022 · 2 comments

Comments

@kode54
Copy link
Collaborator

kode54 commented Jun 27, 2022

If you are starting a new version and suddenly finding your playlist blank, you will need to migrate it to the Sandbox Container.

To do so:

  1. Close the app.
  2. Open ~/Library/Application Support/Cog in one Finder window.
  3. Open ~/Library/Containers/org.cogx.cog/Data/Library/Application Support/Cog in a second Finder window.
  4. Select all the files in the Containers folder window, and move them to the Trash.
  5. Select all the files in the first folder, and Copy them, either using Ctrl/Right Click, Copy, or by pressing Cmd+A to Select All and Cmd+C to Copy.
  6. Switch to the Containers folder, which is now empty.
  7. Paste the files here, either by using Ctrl/Right Click and Paste, or pressing Cmd+V.
  8. Re-open Cog and your playlist will be imported.

Cog uses Core Data storage, but will happily migrate even the oldest tier of playlist formats it ever supported:

  1. It tries to open Core Data. If it finds any playlist entries, it stops here.
  2. It will attempt to import from the naively designed Default.sqlite data storage, which is unfortunately considerably slower to manipulate than Core Data. If it finds this database, it will import it and stop here.
  3. It will attempt to import from a further naively designed Default.xml, which is in the Plist format. This format was even slower than the second format. If it finds this file, it will import it.
  4. It will attempt to import an M3U playlist from Default.m3u, which is the common format named. This will require all the metadata about the tracks to be reloaded on first startup, which could be slow, depending on how large the list is.

However the input is processed, it will finally save the result in the Core Data storage, which is a SQLite database in a different format than I created for Default.sqlite, and also defined by the Core Data model for the app. It will also attempt to delete all of the legacy format files on app shutdown, assuming a successful import from them took place on startup.

@reagle
Copy link

reagle commented Jun 27, 2022

BTW: I don't have a ~/Library/Application Support/Cog.

@kode54
Copy link
Collaborator Author

kode54 commented Jun 28, 2022

Then you have nothing to import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants