I'm on a osTicket 1.12 installation, downloaded from an online server to my local MacBookPro in this directory "/Users/myuser/www/project-name/osticket/upload". I use MAMP for Apache and MySQL.
Notice: osTicket was already installed in "osticket/upload" on the remote server.
Version osTicket v1.12.5 (933bb1f)
Web Server Software Apache/2.4.46 (Unix) OpenSSL/1.0.2u PHP/7.4.12 mod_wsgi/3.5 Python/2.7.13 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.11 Perl/v5.30.1
Version MySQL 5.7.32
Version PHP 7.4.12
I installed the plugin "Attachments on the Filesystem".
It works well, new uploaded attachments goes to filesystem instead of DB but I also had a lot of existing attachments in the DB that I need to migrate to files.
I launch from this folder "/Users/myuser/www/project-name/osticket/upload" the command:
php manage.php file backends
D -- In the database (AttachmentChunkedData)
6 -- upload_dir folder (from osTicket v1.6) (OneSixAttachments)
F -- Filesystem: /Users/myuser/www/project-name/osticket/upload/osTicketAttachments (FilesystemStorage)
osTicketAttachments is the attachments folder, so it seems all ok.
Now I launch
sudo php manage.php file migrate --backend D --to F --limit=1
but I get this error
IOError: /Users/myuser/www/project-name/osticket/upload/osTicketAttachments/b/b56944cb4722cc5cda9d1e23a3ea7fbc: Unable to open for reading Migrated 0 files
If I launch from "/setup/cli" I get this:
PHP Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /........../osticket/upload/bootstrap.php on line 19
Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /......../osticket/upload/bootstrap.php on line 19
PHP Warning: session_cache_limiter(): Cannot change cache limiter when headers already sent in /......../osticket/upload/bootstrap.php on line 21
Warning: session_cache_limiter(): Cannot change cache limiter when headers already sent in /......../osticket/upload/bootstrap.php on line 21
PHP Warning: session_set_save_handler(): Cannot change save handler when headers already sent in /......../osticket/upload/manage.php on line 28
IOError: /......../osticket/upload/osTicketAttachments/b/b56944cb4722cc5cda9d1e23a3ea7fbc: Unable to open for reading
Migrated 0 files
Firstly, it's not clear from where I need to launch commands. It seems launching from project root gives less error than from setup/cli.
Since the problem seems the folder/files permissions I tried various things found on this forum.
At the moment the osTicketAttachments folder has this permission
drwxrwxrwx 43 myuser staff 1376 16 Gen 12:26 osTicketAttachments
and all the folders inside have these:
drwxrwxrwx 2 myuser staff 64 16 Gen 12:26 K
What user is Apache using? I launched this
ps aux | egrep '(apache|httpd)' and it lists myuser (10 times).
Hope someone could help me. Thanks