Restore from any .sql file with this:
- Code: Select all
mysql asterisk < /root/filename.sql
but wait , thats not it , the sql file you have , from the old server , it must have create-drop table statements in it , thats why your new table structure got changed.
now you have two options
option 1 ) use any text editor to open your .sql file from old server , look for create-drop table queries , and delete these queries , remember to delete everyone of them, then save your sql file , then transfer it to the new server , then restore from it
but i am assuming your ssql file doesnot have field names in it either , in the insert queries , so that will create a problem , if the table structure has changed, so you should go for option 2
option 2 ) create a new database asterisk_temp , restore your old server sql file in to this database , with command
- Code: Select all
mysql asterisk_temp < /root/filename.sql
after the database has been populated , we will now take the backup in a desired format , use the following command to take a backup of newly created database:
- Code: Select all
mysqldump --no-create-info --complete-insert --no-create-db asterisk_temp vicidial_list > vicidial_list.sql
mysqldump --no-create-info --complete-insert --no-create-db asterisk_temp vicidial_lists > vicidial_lists.sql
after this , transfer these two files , to the root folder of your new vicidial 8 server , and restore using following commands :
- Code: Select all
mysql asterisk < vicidial_list.sql
mysql asterisk < vicidial_lists.sql
and that should do it.
after you have verified everything is working fine , you can remove the temporarily created database , or might even just keep it , your wish !