Restoring VitalPBX backup from command line!

Sometimes, because of the backup size, we are unable to restore it using the VitalPBX GUI; this happens because the server comes configured to support files no larger than 500 M.

So, what can we do when this happens? Well, we have two options.

The first option is to edit the file “/etc/php.d/vpbx.ini” to increase the PHP upload size. The parameters to update are the “post_max_size” and “upload_max_filesize” respectively.

...
post_max_size = 500M
upload_max_filesize = 500M
...
default_socket_timeout = 600

After updating the values and saving the file, we have to reload the Apache service.

systemctl reload-or-restart httpd

Our second and the recommended option is to upload the backup to our new server using an SFTP Client(WinSCP, Filezilla, etc.). Let’s say we upload the file to the path “/tmp/” of our new server. Now, how can we restore the file? Well, we need to run a VitalPBX command as shown below.

vitalpbx --restore-backup "/tmp/my-backup.tar.gz"

Keep in mind that you have to pass to the command as an argument the full path of the backup file.

I hope this helps someone out there!

3 Likes