sh $work_dir/db_gen_config.sh $source_db_host$source_db_user$source_db_pwd$target_db_host$target_db_user$target_db_pwd$database$config_file_name$db_backup_sub_folders$use_cache
echo"--- Step 2: replace domain name in tables: $database$mysql_host$db_backup_sub_folders ---"
cd$db_backup_sub_folders
file_count=`ls-l*.sql | wc-l`
echo"./*.sql file count is $file_count"
if["$file_count"-gt 0 ];then
echo"--- Step 2: replace domain name in tables: $database$db_backup_sub_folders ---"
echo"--- Step 2: is re_replace_ip: $re_replace_ip ---"
sh $work_dir/db_replace_ip.sh $database$target_db_host$db_backup_sub_folders$re_replace_ip$ip_value
echo"--- Step 3: import basic data from backup file: $database$mysql_host$db_backup_sub_folders ---"
echo"--- Step 3: import basic data from backup file: $database$db_backup_sub_folders ---"
sh $work_dir/db_import.sh $database$target_db_host$db_backup_sub_folders$delete_business_data
#if [ $? != 0 ];then
# echo "db_import.sh error"
# exit -1
#fi
else
echo"--- Skip step 2: replace domain name in tables: $database$db_backup_sub_folders ---"
echo"--- Skip step 3: import basic data from backup file: $database$db_backup_sub_folders ---"