I am sandboxing an existing application, and for some reasons the migration does not seem to work, although I am following exactly what is specified in the documentation. In summary, here is what I am doing:
- I have removed the existing container (in ~/Library/Containers/com.mycompany.myapp);
- I have created the
container-migration.plistin the Resources group; -
I want to migrate a single file, in
~/Application Support: I have tried to specify the file, and the enclosing folder, neither worked. Here is the migration plist that I am using (I have just changed the application name), with the folder:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Move</key> <array> <string>${ApplicationSupport}/myapp</string> </array> </dict> </plist> -
When I start the application, the new container is created, and a blank file is created but no migration is performed.
The file that I am trying to migrate is a CoreData SQLite store. The data model has not changed so there is no data migration involved, I am simply trying to move the CoreData store to the sandboxed container.
I guess I am missing something very obvious, as I can’t find anything useful around, any help will be much appreciated.
Just after posting the question I noticed this error in the system log:
I tried to copy the application to my Desktop before running it, and from there it works correctly. I do not understand why from the build folder the migration does not work, but this is sufficient to solve my problem.
Hopefully this will avoid somebody else to waste their time.