Mass migration between virtualmin servers

Basically I was new to this virtualmin administration and its interface was really confusing to me. My task was to do a mass domains migration between two centos servers having virtualmin panel installed in it. Following are the steps I did for the server wide migration.

First reduced the TTLs to 5min prior to hours of migration to avoid downtimes while changing the A records.

virtualmin modify-dns –all-domains –ttl 300

Then I created a directory “/root/backups” to store all the domains backup that I generate in the source server.

virtualmin backup-domain –dest /root/backups/ –all-domains –all-features –newformat –all-virtualmin

Copy it over to new server with same directory path “/root/backups” for easiness in use.

rsync -avzrp /root/backups/ root@destip.x.x.x:/root/backups/

if destination server is using any non standard port for ssh, then make some alteration to above rsync command.

rsync -avzrp -e “ssh -p portno” /root/backups/ root@destip.x.x.x:/root/backups/

Restore your domains in destination server.

* virtualmin restore-domain –source /root/backups/virtualmin.tar.gz –all-virtualmin
* virtualmin restore-domain –source /root/backups/ –all-domains –all-features

Set the TTLs back to 4 hours now.

virtualmin modify-dns –all-domains –ttl 14400

You are done 🙂

Reference: http://www.virtualmin.com/documentation/system/migrate
Virtualmin install: http://www.virtualmin.com/download.html

How to extract .jpa archive file? :)

Some clients may approach you with the backup file as .jpa archive(joomlapack) which cannot extract using the usual tools available in server. This can be done by using the third party script Akeeba Extract Wizard.

Download the Akeeba pack from here https://www.akeebabackup.com/download/official/akeeba-kickstart.html

Upload the kickstart zip archive again in public_html or in the same folder where the you have the .jpa archive. Extract the content of the archive. This will put multiple files in the same folder(you see many .ini files of it).

Access the kickstart.php script inside the unzipped kickstart folder via your domain and browser. For example:

http://yourdomain.com/kickstart.php

(should load the correct path where your kickstart.php resides. If it is in a subfolder, load as http://yourdomain.com/subfolder/kickstart.php)

On the kickstart.php loaded on browser, you can browse the .jpa archive file exists in the same folder and go click Extract. You will see the extracted files and folders in the same folder where your kickstart package downloaded 🙂

PHP 5.4 : Strict standards : Non-static methods called statically

I got the following error while loading up a domain running on php 5.4

=======================
Strict Standards: Non-static method JLoader::import() should not be called statically in /home/user/public_html/libraries/joomla/import.php on line 29
Strict Standards: Non-static method JLoader::register() should not be called statically in /home/user/public_html/libraries/joomla/loader.php on line 71
Strict Standards: Non-static method JLoader::import() should not be called statically in /home/user/public_html/libraries/joomla/import.php on line 32
=======================

and I did the below steps to clear them

=======================
In php.ini,
changed error_reporting = E_ALL | E_STRICT to error_reporting = E_ALL & ~E_NOTICE

changed display_errors = On to display_errors = Off
=======================

If the above still doesn’t help you, do the following too.

In the domains index.php file set it like inside the php division.

========
ini_set(‘display_errors’,0);
========

This should fix it 🙂

Legacy filter_module syntax causing 500 error in apache 2.4

Hey, sometimes you may come up with the following error in error log which is actually causing by legacy filter_module syntax on the htaccess file.


======================
[Sun Oct 06 18:20:24.119633 2013] [core:alert] [pid 47884] [client 5.x.x.x:54039] /home/user/public_html/.htaccess: FilterProvider takes three arguments, filter-name provider-name match-expression
[Sun Oct 06 18:20:31.705923 2013] [core:alert] [pid 48315] [client 157.x.x.x:46020] /home/user/public_html/.htaccess: FilterProvider takes three arguments, filter-name provider-name match-expression
[Sun Oct 06 18:20:31.707094 2013] [core:alert] [pid 48315] [client 157.x.x.x:46020] /home/user/public_html/.htaccess: FilterProvider takes three arguments, filter-name provider-name match-expression
======================

Probably the apache version is 2.4 in your server and it wont take the legacy filter_module syntax. You should need to make some changes in it. For example my users filter_module rules were as follows in his .htaccess file.


FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject
FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $image/x-icon
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf
FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype
FilterChain COMPRESS
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no

I changed it to


FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/html'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/css'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/plain'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'text/x-component'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/javascript'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/json'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/xhtml+xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/rss+xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/atom+xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/vnd.ms-fontobject'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'image/svg+xml'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'image/x-icon'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'application/x-font-ttf'"
FilterProvider COMPRESS DEFLATE "%{Content_Type} = 'font/opentype'"
FilterChain COMPRESS
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no

The error has gone then 🙂