Migrate existing files
Permalink Browser Info Environment
I wrote this job to migrate files and figured it could be useful to others. Just make sure you set the correct file storage location ID to load for fromLocation and toLocation. This is written to migrate files in a queue based on the built in Fill thumbnail database table job.
It could probably be fancier and maybe built into the package but it's accomplished what I needed at this time.
Note* the local version of your file will be deleted after it's been moved.
It could probably be fancier and maybe built into the package but it's accomplished what I needed at this time.
Note* the local version of your file will be deleted after it's been moved.
<?php namespace Application\Job; use Concrete\Core\Entity\File\File; use Concrete\Core\File\FileList; use Concrete\Core\Entity\File\StorageLocation\StorageLocation; use Concrete\Core\Job\QueueableJob; use Doctrine\ORM\EntityManagerInterface; use ZendQueue\Message; use ZendQueue\Queue; class S3StoragePush extends QueueableJob { /** * @var EntityManagerInterface */ protected $entityManager;
Viewing 15 lines of 92 lines. View entire code block.
Type: | Discussion |
---|---|
Status: | Resolved |