| Author |
|
batpets Newbie

Joined: 15 December 2025 Location: Bulgaria
Online Status: Offline Posts: 3
|
| Posted: 15 December 2025 at 5:44am | IP Logged
|
|
|
Hello, I am trying to do a calendar and contacts export regarding this howto https://afterlogic.com/docs/webmail-pro/developers-guide/batch-export-of-contacts-and-calendars
My webmail pro version is 8.2.3-build-a3 installed as standard package.
Default server php version is 8.2, but it seems that provided script is not compatible with php 8.0 or higher. So I tried running it on php 7.4, but still has some errors:
sudo -u www-data /usr/bin/php7.4 export_contacts_calendars.php
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/html/modules/Calendar/Storages/Sabredav.php on line 858
PHP Fatal error: Uncaught Aurora\System\Exceptions\ApiException: ApiException in /var/www/html/system/Module/AbstractModule.php:930
Stack trace:
#0 /var/www/html/system/Module/Decorator.php(42): Aurora\System\Module\AbstractModule->CallMethod()
#1 /var/www/html/export_contacts_calendars.php(14): Aurora\System\Module\Decorator->__call()
#2 {main}
thrown in /var/www/html/system/Module/AbstractModule.php on line 930
/var/www/html/ is the document root of the webmail and script is located in same directory. System is ubuntu 18.04
Can you advice me how to fix this?
Thank you in advance.
|
| Back to Top |
|
| |
Igor AfterLogic Support

Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6179
|
| Posted: 15 December 2025 at 5:58am | IP Logged
|
|
|
I'm afraid that version is way too old, 2018 if I'm right, PHP 8 didn't even exist back then. I would recommend upgrading to the latest version.
--
Regards,
Igor, Afterlogic Support
|
| Back to Top |
|
| |
batpets Newbie

Joined: 15 December 2025 Location: Bulgaria
Online Status: Offline Posts: 3
|
| Posted: 15 December 2025 at 6:59am | IP Logged
|
|
|
Thank you for suggestion, but somehow I need to export data for further upgrade. I have the old php versions also installed. Is it possible to run the export or script is written for newer webmail version
|
| Back to Top |
|
| |
batpets Newbie

Joined: 15 December 2025 Location: Bulgaria
Online Status: Offline Posts: 3
|
| Posted: 19 January 2026 at 4:26am | IP Logged
|
|
|
Somehow with some vibe codding I managed to success with export of contacts and calendars.
Now I have another question.
If I do a fresh install of the latest version, may I import only contacts and calendars data, even before any user login into new system?
|
| Back to Top |
|
| |
Igor AfterLogic Support

Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6179
|
| Posted: 19 January 2026 at 5:08am | IP Logged
|
|
|
Oh, that actually is a very reasonable question, something we didn't think of. I've adjusted the import sample slightly, replacing this line:
Code:
| $UserId = \Aurora\System\Api::getUserIdByPublicId($sEmail); |
|
|
with the following code:
Code:
$UserId = \Aurora\System\Api::getUserIdByPublicId($sEmail);
if ($UserId===false) {
$UserId = $oCoreDecorator->CreateUser(0, $sEmail);
} |
|
|
When performing mass import, in case if user account doesn't exist yet, it will be created via API. User's mail account will be created on their first login but the user itself will already be there, with contacts and calendars in place.
--
Regards,
Igor, Afterlogic
|
| Back to Top |
|
| |
menadei Newbie


Joined: 25 July 2025
Online Status: Offline Posts: 2
|
| Posted: 24 January 2026 at 1:02am | IP Logged
|
|
|
Then, should I consider error handling for the CreateUser API call?
|
| Back to Top |
|
| |
Igor AfterLogic Support

Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6179
|
| Posted: 25 January 2026 at 10:39pm | IP Logged
|
|
|
Well yes, but it would help to explore the debug logs of WebMail Pro first, do you get any errors or exceptions recorded there?
--
Regards,
Igor, Afterlogic
|
| Back to Top |
|
| |