Allowed Memory Size exhausted when trying to convert DB

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Allowed Memory Size exhausted when trying to convert DB

Post by dlukinski »

Hello XI Support

We are getting this error when trying to convert XI DB from Postgres to MySQL:

php pg2mysql_cli.php nagiosxi.psql nagiosxi.mysql myisam
Filesize: 1.3G
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 230 bytes) in /tmp/pg2mysql-master/pg2mysql.inc.php on line 85

Please advice what to do
Thank you.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Allowed Memory Size exhausted when trying to convert DB

Post by cdienger »

Check the memory allocated in /etc/php.ini and increase it - https://support.nagios.com/kb/article/n ... e-611.html.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Re: Allowed Memory Size exhausted when trying to convert DB

Post by dlukinski »

cdienger wrote:Check the memory allocated in /etc/php.ini and increase it - https://support.nagios.com/kb/article/n ... e-611.html.

Hi

I've copied PHP.ini from the old system, but still not luck with DB conversion (same error) / PHP.ini has 4096 MB configured, but shows 512 MB in the error?

Code: Select all


[root@fikc-nagxiprod01 pg2mysql-master]# php pg2mysql_cli.php nagiosxi.psql nagiosxi.mysql myisam
Filesize: 1.3G
PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 230 bytes) in /tmp/pg2mysql-master/pg2mysql.inc.php on line 85
[root@fikc-nagxiprod01 pg2mysql-master]# mc

You have new mail in /var/spool/mail/root
[root@fikc-nagxiprod01 etc]#

User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Allowed Memory Size exhausted when trying to convert DB

Post by cdienger »

Try running it like this:

Code: Select all

 php -d memdory_limit=4096M pg2mysql_cli.php nagiosxi.psql nagiosxi.mysql myisam
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Allowed Memory Size exhausted when trying to convert DB

Post by cdienger »

Resolved this over a call, but for future searchers, the memory setting is in pg2mysql.inc.php:

Code: Select all

pg2mysql.inc.php:ini_set("memory_limit", "512M");
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked