Page 1 of 1

migration to new hardware

PostPosted: Mon Jun 03, 2013 9:06 am
by haz
Hello all!
We have installed a vicidial server using the preload iso (VERSION: 2.6-394a, BUILD: 130130-1207) on a relatively old server (HP ML110G4 ) for testing purposes. As usual we realised now that we need to replace the server with a new server to get better performance.
The question is what is the procedure to migrate to the new machine without needing to redo all the configuration steps again?
Which procedure is easiest or least headache?


Regards
Hafez

Re: migration to new hardware

PostPosted: Tue Jun 04, 2013 9:51 am
by rrb555
backup your database and upload it to the new machine. There are many post here that teach on how to backup and upload the database.

Re: migration to new hardware

PostPosted: Sun Jun 16, 2013 3:54 pm
by haz
Hello all!
Well i have executed the ADMIN_backup.pl script and got a tar.gz file. I have tried to untar that file and then to restore the database to mysql but nothing happens.
here is what i have done and please help if you know why the restore is not working.
1- I've executed ADMIN_backup.pl in the old server. (same version of vicibox as the new server only new hardware)
2- using FTP i moved the *all*.tar.gz file to the new server.
3- I used tar -xvwzf *all*.tar.gz and i got 7 files.
4- i took the file named ipadressasterisk.gz and tried to restore it to mysql using
mysql -u cron -p asterisk < *all*.tar.gz
i am asked for my password and then no errors but still i no Changes in the existing database.

Can any one tell me where this has gone wrong? what is the procedure?

Regrards
HAZ

Re: migration to new hardware

PostPosted: Mon Jun 17, 2013 4:53 am
by DomeDan
The backup script creates one X_ALL_x_tar.gz every time it runs, but it keeps 7 files, so you only need the last created one
run tar tfv X_ALL_x_tar.gz to look at the content, you will see something like this:
Code: Select all
drwxr-xr-x root/112          0 2013-06-17 02:50 var/log/astguiclient/archive/temp/
-rw-r--r-- root/112     604160 2013-06-17 02:50 var/log/astguiclient/archive/temp/X_CONF_1.tar
-rw-r--r-- root/112      20480 2013-06-17 02:50 var/log/astguiclient/archive/temp/X_LINUX_1.tar
-rw-r--r-- root/112  167690240 2013-06-17 02:50 var/log/astguiclient/archive/temp/X_WEB_1.tar
-rw-r--r-- root/112    7915520 2013-06-17 02:50 var/log/astguiclient/archive/temp/X_BIN_1.tar
-rw-r--r-- root/112   19261440 2013-06-17 02:50 var/log/astguiclient/archive/temp/X_SOUNDS_1.tar
-rw-r--r-- root/112   87592960 2013-06-17 02:50 var/log/astguiclient/archive/temp/X_VOICEMAIL_1.tar

then extract it tar xvf X_ALL_x_tar.gz and go to the directory where the files is cd var/log/astguiclient/archive/temp/
runt tar tfv X_tar on the files to check the content, extract and copy it where it belongs.
I dont have the DB included in my backups because I use an other script to backup database, but just find that file, look at the content and extract it and import it,
that file is probably named .sql and that file you can import like you mentioned mysql -u cron -p asterisk < some_file.sql

Re: migration to new hardware

PostPosted: Mon Jun 17, 2013 5:59 am
by haz
Hello DomeDan
Well thanks for the eaplanation, but as you can read in my post my problem is that the file called serveripaddressasterisk.gz which i suspect should include the sql database backup file can't be imported using mysql -u cron -p asterisk < some_file.sql command.
If i understood you correctly you are using another tool for the mysql backup can i ask you which tool is that? then may be i will do the mysql backup seperately.
one more question where does the x_Conf_1.tar file belong to? I could figure out -i think- the web, bin and sounds as where these should be copied to but not the config..
Regards
HAZ

Re: migration to new hardware

PostPosted: Mon Jun 17, 2013 6:13 am
by DomeDan
yeah that .gz is probably the asterisk database, you can either unzip it using gunzip serveripaddressasterisk.gz and you will get a .sql file
or you can unzip and import it on the fly using zcat serveripaddressasterisk.gz | mysql -u cron -p asterisk
the X_CONF_1.tar file contains files from /etc/asterisk/ and /etc/dahdi/ and /etc/astguiclient.conf

I use AutoMySQLBackup http://sourceforge.net/projects/automysqlbackup/ to make backups because I got more databases then the asterisk one, and with AutoMySQLBackup I get a system which keeps old backups the way I like it

Re: migration to new hardware

PostPosted: Tue Nov 26, 2013 2:33 pm
by smead
I am also running into problems with this. I tar xvf all the tar files , then when I run the mysql piece and this is what I get:

linux-57aw:~ # mysql> \. 192.168.2.101asterisk2
Query OK, 0 rows affected (0.00 sec)
-bash: .: Is a directory

linux-57aw:~ # Query OK, 0 rows affected (0.00 sec)
-bash: syntax error near unexpected token `('
linux-57aw:~ #
linux-57aw:~ # Query OK, 0 rows affected (0.01 sec)
-bash: syntax error near unexpected token `('
linux-57aw:~ #
linux-57aw:~ # Query OK, 0 rows affected (0.00 sec)
-bash: syntax error near unexpected token `('

linux-57aw:~ #
Query OK, 0 rows affected (0.00 sec)

linux-57aw:~ # Query OK, 0 rows affected (0.00 sec)
-bash: syntax error near unexpected token `('
linux-57aw:~ #
linux-57aw:~ # Query OK, 0 rows affected (0.00 sec)
-bash: syntax error near unexpected token `('
-> \q
Bye
linux-57aw:~ #
linux-57aw:~ # Query OK, 0 rows affected (0.00 sec)
-bash: syntax error near unexpected token `('
linux-57aw:~ #
linux-57aw:~ # Query OK, 0 rows affected (0.00 sec)
-bash: syntax error near unexpected token `('
linux-57aw:~ #
linux-57aw:~ # Query OK, 0 rows affected (0.00 sec)
-bash: syntax error near unexpected token `('
linux-57aw:~ #
linux-57aw:~ # Query OK, 0 rows affected (0.00 sec)
-bash: syntax error near unexpected token `('
linux-57aw:~ #
linux-57aw:~ # Query OK, 0 rows affected (0.00 sec)
-bash: syntax error near unexpected token `('
linux-57aw:~ #
linux-57aw:~ # mysql> /q

When I login to admin after this I see that nothing has changed. What am I missing?

Re: migration to new hardware

PostPosted: Tue Nov 26, 2013 4:31 pm
by haz
Hello
I solved my problem by searching the forum and found a thread from william where he described how to upgrade.
Starting with dropping the asterisk database and then creating it and then following the upgrade dokument.
I made a new backup of the old machine and then restored using this backup according to the upgrade document "UPGRADE" and then things wokred.

Regards
HAZ

Re: migration to new hardware

PostPosted: Tue Nov 26, 2013 4:56 pm
by smead
Are you referring to this? viewtopic.php?t=16326&highlight=usr+src+astguiclient+upgrade

Because step number 2 merely says:
"Test backup:

Create a new (any name) database on any mysql server, apply the backup data to it, and verify a new lead from TODAY is actually in there."

This appears to me to be the same step I am stuck on.

Re: migration to new hardware

PostPosted: Tue Nov 26, 2013 9:56 pm
by williamconley
linux-57aw:~ # mysql> \. 192.168.2.101asterisk2

If this is an attempt to reinstall a backed up database, it should be preceded with a drop and create. The existing database must be deleted before superimposing your DB.

If this is an attempt to upgrade a database, it is entirely wrong.

So ... what stage is this that you are attempting to complete?

Re: migration to new hardware

PostPosted: Wed Nov 27, 2013 3:57 am
by haz
Sorry I am out of office this week so I can not send you the link for the post I am referring to
But it is not the one you are referring to.
The post has information about sql commands, setting user rights and owner of the database
And so on. Just search the forum again.
Regards
HAZ

Re: migration to new hardware

PostPosted: Wed Nov 27, 2013 10:13 am
by smead
For now I just want to replicate my system on another machine. Then I would like to upgrade.

William, I followed your advice from http://www.eflo.net/VICIDIALforum/viewtopic.php?t=11788 and did the following:

mysql -e "drop database asterisk"
mysql -e "create database asterisk"
mysql asterisk < 192.168.2.101asterisk2

When I do this it still doesn't appear to do anything with the asterisk2 file.
mysql> use asterisk;
Database changed
mysql> show tables;
Empty set (0.00 sec)

Is there an additional step after "gunzip 192.168.2.101asterisk2.gz" that I need to do to extract the file? I notice it does not list the extracted file as a .sql file

Re: migration to new hardware

PostPosted: Wed Nov 27, 2013 10:18 am
by haz
Try using my sql commands to get ownership of the database or make sure
That you have full access rights to the database and myself.

Re: migration to new hardware

PostPosted: Sat Nov 30, 2013 8:49 pm
by williamconley
smead wrote:For now I just want to replicate my system on another machine. Then I would like to upgrade.

William, I followed your advice from http://www.eflo.net/VICIDIALforum/viewtopic.php?t=11788 and did the following:

mysql -e "drop database asterisk"
mysql -e "create database asterisk"


When I do this it still doesn't appear to do anything with the asterisk2 file.
mysql> use asterisk;
Database changed
mysql> show tables;
Empty set (0.00 sec)

Is there an additional step after "gunzip 192.168.2.101asterisk2.gz" that I need to do to extract the file? I notice it does not list the extracted file as a .sql file

Did you not receive an error or warning when executing mysql asterisk < 192.168.2.101asterisk2? You'll need to check the content of your asterisk2 file. It may be corrupt or empty (which would not result in an error report! LOL).

Re: migration to new hardware

PostPosted: Sat Nov 30, 2013 10:49 pm
by smead
YES! Bill I owe you a drink sometime :lol:

cat 192.168.1.101asterisk3
-- MySQL dump 10.13 Distrib 5.5.28, for Linux (x86_64)
--
-- Host: localhost Database: asterisk
-- ------------------------------------------------------
-- Server version 5.5.28-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

So...

I super debug the backup script and see this little guy almost immediately:
"mysqldump: Got error: 1105: Unknown error when doing refresh"

And I found the fix here viewtopic.php?f=4&t=26789 and ran the "/bin/chmod 655 /var/log/mysql" command

Newly restored backup seems to look good so far. Going to do some more testing just to be sure :D

Re: migration to new hardware

PostPosted: Sun Dec 01, 2013 7:13 pm
by williamconley
Thank me by sticking around and helping newbies. And bringing more people to Vicidial (and all other Free Open Source projects that are useful for Call Centers and anyone doing business in General ...).

You may think you don't know much .. but every newbie knows less than you and is in need of all the help you needed up until now. Give it. Besides thanking me .. you'll actually learn as you help (and in the end your employer will benefit from that knowledge!!).

Really: One post response per day ... 5 minutes. What could it hurt?

8-)