I am migrating a wordpress blog into silverstripe and wanted to import some images across into the assets folder. It seems as though the FilesystemSyncTask has been removed. Is there another way to achieve this? That was such a useful feature when you are FTPing files or migrating sites into Silverstripe.
Yes, it’s gone. I’ve found this issue when upgrading from SilverStripe 3 to 4 as well. You now have to upload everything through the Asset section of the CMS for it to be a part of the file database.
It has been done because not everyone is using the local filesystem so it would not work if you were using Amazing S3 for asset storage. Although I suspect most people are still using the local file system so I think it should still be an option.
Make sure to set Legacy Filenames to true in the config.yml as well so as not to get every file renamed at least until you’re ready to turn on file versioning (which makes an already messy assets folder even messier).
SS4 is also storing all _resized images right next to the original file as well so cleaning those up is now a much bigger pain than it used to be in SS3.
That’s just a code-snippet obviously. You can run it anywhere you like. You could add it to a dev task, certainly.
When migrating WP sites, I use it in a script which parses an exported XML file from Wordpress and automatically copies the images from the source site into the new SS site.
It could be a good practice, but my ‘Files’ have a lot of associations, like ownerID, parentID etc. How about those items? They will lost as the files are new now.