Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Pro

 AfterLogic Forum : AfterLogic WebMail Pro
Subject Topic: Unable to export calendar and contacts Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
batpets
Newbie
Newbie


Joined: 15 December 2025
Location: Bulgaria
Online Status: Offline
Posts: 3
Posted: 15 December 2025 at 5:44am | IP Logged Quote batpets

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 View batpets's Profile Search for other posts by batpets
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6185
Posted: 15 December 2025 at 5:58am | IP Logged Quote Igor

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 View Igor's Profile Search for other posts by Igor
 
batpets
Newbie
Newbie


Joined: 15 December 2025
Location: Bulgaria
Online Status: Offline
Posts: 3
Posted: 15 December 2025 at 6:59am | IP Logged Quote batpets

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 View batpets's Profile Search for other posts by batpets
 
batpets
Newbie
Newbie


Joined: 15 December 2025
Location: Bulgaria
Online Status: Offline
Posts: 3
Posted: 19 January 2026 at 4:26am | IP Logged Quote batpets

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 View batpets's Profile Search for other posts by batpets
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6185
Posted: 19 January 2026 at 5:08am | IP Logged Quote Igor

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 View Igor's Profile Search for other posts by Igor
 
menadei
Newbie
Newbie
Avatar

Joined: 25 July 2025
Online Status: Offline
Posts: 2
Posted: 24 January 2026 at 1:02am | IP Logged Quote menadei

Then, should I consider error handling for the CreateUser API call?
Back to Top View menadei's Profile Search for other posts by menadei Visit menadei's Homepage
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6185
Posted: 25 January 2026 at 10:39pm | IP Logged Quote Igor

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 View Igor's Profile Search for other posts by Igor
 
bellhopmega
Newbie
Newbie
Avatar

Joined: 20 August 2026
Location: United States
Online Status: Offline
Posts: 1
Posted: 20 August 2026 at 1:30am | IP Logged Quote bellhopmega

after a fresh install of the latest version, can I import only the contacts and calendar data before any user logs into the new system?
Back to Top View bellhopmega's Profile Search for other posts by bellhopmega Visit bellhopmega's Homepage
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2226
Posted: 20 August 2026 at 2:39am | IP Logged Quote Alex

In WebMail Pro, you can create a user in admin panel (provided that the user already exists on the mail server). You can then import the data into this user's account. It can occur before a real person will log in this user account.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide