Serv-u FTP迁移(windows_to_windwos)

需求分析

公司服务器要做维护,部分服务器需要进行迁移处理,其中就包括Ser-v FTP服务器。

确认环境信息

角色 ip 系统版本 sql版本 Serv-U版本 ODBC account/password
旧服务器 192.168.1.18 Server 2003 R2 Enterprise x64 Edition Service Pack 2 community-5.7.10.0 ServU v15.1.2 5.1.13-winx64 heyt/hero922175
新服务器 192.168.1.179 (192.168.1.18)   community-5.7.10.0 ServU v15.1.2 5.1.13-winx64 administrator/Thinkiveftp18

原外网映射:218.17.161.51:18022

备份服务器应用

备份分为四个个部分:应用、配置文件、数据库和附件。

应用/配置文件备份

应用安装在E盘 E:\Serv_U\ 内

E:\Serv_U\.
    ├─FTP_Workspace
    │  └─发布目录-文件路径说明
    ├─LOG
    └─Serv_IN
        └─Serv-U

将Serv_IN目录整体压缩复制

附件备份

附件采用windows磁盘映射的方式,挂载至\192.168.1.252\ftpdata

  • account:ftpdata
  • password:thinkive20060808

数据库备份

  • 使用工具备份

  • 命令行备份

mysqldump -u root -p `serv_u` > backup.sql
#回车后,输入密码
Enter password: ******

迁移还原

  • 将应用备份上传到新服务器中,目录同原始目录保持一致
    • 原始目录
F:.
├─FTP_Workspace
│  └─发布目录-文件路径说明
├─LOG
└─Serv_IN
    └─Serv-U
[client]
loose-default-character-set = utf8

[mysql]
default-character-set = utf8
tee=E:\\Serv_U\\tools\\Mysql\\mysql\\logsquery.log
no-auto-rehash

[mysqld]
basedir = E:\\Serv_U\\tools\\Mysql\\mysql\\mysql-5.6.32-winx64
datadir = E:\\Serv_U\\tools\\Mysql\\mysql\\data
port = 3306
socket = E:\\Serv_U\\tools\\Mysql\\mysql\\logs\\mysql.sock
event_scheduler = 0

#GTID
gtid_mode = on
enforce_gtid_consistency = on

#timeout
interactive_timeout = 28800
wait_timeout = 28800

#character set
character-set-server = utf8
open_files_limit = 65535
max_connections = 500
max_connect_errors = 100000

#logs
log-output=file
slow_query_log = 1
slow_query_log_file = E:\\Serv_U\\tools\\Mysql\\mysql\\logs\\slow.log
log-error = E:\\Serv_U\\tools\\Mysql\\mysql\\logs\\error.log
log_warnings = 2
long_query_time = 1
#log-slow-admin-statements = 1
#log-queries-not-using-indexes = 1
log-slow-slave-statements = 1

#binlog
binlog_format = row
log-bin = mybinlog
binlog_cache_size = 4M
max_binlog_size = 1G
max_binlog_cache_size = 2G
sync_binlog = 1
max_allowed_packet = 4M
expire_logs_days = 10

#relay log
skip_slave_start = 1
max_relay_log_size = 1G
relay_log_purge = 1
relay_log_recovery = 1
log_slave_updates
#slave-skip-errors=1032,1053,1062

#buffers & cache
table_open_cache = 2048
table_definition_cache = 2048
table_open_cache = 2048
max_heap_table_size = 96M
sort_buffer_size = 2M
join_buffer_size = 2M
thread_cache_size = 256

query_cache_size = 0
query_cache_type = 0
query_cache_limit = 256K
query_cache_min_res_unit = 512
thread_stack = 192K
tmp_table_size = 96M
key_buffer_size = 8M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 32M

#innodb
innodb_buffer_pool_size = 1G
innodb_buffer_pool_instances = 1
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 64M
innodb_log_file_size = 256M
innodb_log_files_in_group = 2
innodb_max_dirty_pages_pct = 50
innodb_file_per_table = 1
innodb_rollback_on_timeout
innodb_status_file = 1
innodb_io_capacity = 2000
transaction_isolation = READ-COMMITTED

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
  • 修改系统变量
    • Path后添加 mysql bin文件夹的路径
    • 新建系统变量,变量名:MYSQL_HOME 变量值 E:\Serv_U\tools\Mysql\mysql\mysql-5.6.32-winx64
  • mysqld —install mysql —defaults-file=E:\Serv_U\tools\Mysql\mysql\mysql-5.6.32-winx64\my.ini
  • 端口暴露同原始一致:3306
  • 启动命令:net start mysql
  • 关闭命令:net stop mysql
  • 设置MySQL数据库root用户密码
mysqladmin.exe -uroot -p password "thinkive"
Enter password:【直接回车】
Warning: Using a password on the command line interface can be insecure.
  • 清理用户
bin>mysql -uroot -p
Logging to file 'D:\MySQL\logs\query.log'
Enter password: thinkive
......
mysql> delete from mysql.user where user!='root' or host!='localhost';
mysql> truncate mysql.db;
mysql> drop database test;
mysql> flush privileges;
  • 设置root远程连接
mysql> grant all privileges on *.* to root@"%" identified by 'thinkive' with grant option;
mysql> flush privileges;
  • 恢复数据库文件

    • 工具直接导入(新数据库)
      • 打开heidisql - > 连接新数据库 -> 工具 -> 加载sql文件
    • 命令行导入数据(新数据库)
      mysql -u root -p < backup.sql
  • 安装ODBC配置数据源

    • 双击安装 mysql-connector-odbc-5.1.13-winx64.msi
    • 开始 -> 管理工具 -> 数据源管理器 -> 系统DSN -> 添加 serv_u 数据源
  • 映射系统磁盘

    • 我的电脑 -> 工具 -> 映射网络驱动器 -> 驱动器盘符选择Z -> \192.168.1.252\ftpdata -> 输入账号/密码进行添加
  • 添加Serv-u至windows服务

sc create "Serv-U File Server" binpath= "E:\Serv_U\Serv_IN\Serv-U\Serv-U.exe -service"
sc config "Serv-U File Server" start= auto
sc start "Serv-U File Server"

重启服务

  • 添加 Serv-U File Server 至系统服务
    • “E:\Serv_U\Serv_IN\Serv-U\Serv-U.exe” -service
  • 设置系统服务登录
    • 打开Serv-U File Server服务属性,指定系统管理员账号进行登录
  • 运行FTP目录下Serv-U-Tray.exe,添加系统运行控制台
  • 安装chrome浏览器
  • 界面右下角系统运行控制台,右键选择系统浏览器进行运行(进入系统管理页面-只有该页面可以设置群组及目录权限)
  • 双击已制作好的快捷启动应用
    • open.exe

Serv-U使用

  • 访问和登录Serv-U

    • 启动Serv-U服务后,浏览器直接访问 http://Serv-U服务器ip:80端口 即可访问和登录Serv-U。
    • 注:如果网页无法访问,请先关闭Serv-U所在电脑的防火墙尝试刷新网页访问。
    • Serv-U默认管理,登录服务器
      • E:\Serv_U\Serv_IN\Serv-U\Serv-U-Tray.exe -administrator
      • 配置Serv_U群组分配群组权限,只能使用改方式操作
  • Serv-U数据库

    • heidisql工具访问
      • 网络类型:默认选择MySQL。
      • 主机名/IP:127.0.0.1:mysql端口
      • 用户名: root
      • 密 码:xxxxxx
      • 数据库:serv_u
        • 数据库存储目录: 默认在
          • C:\Program Files\MySQL\MySQL Server 5.0\Data

异常处理

Server 2003 R2 Enterprise x64 Edition Service Pack 2 正常情况下是无法打开浏览器的,需要安装以下插件:

猜你喜欢

转载自www.cnblogs.com/YatHo/p/8979152.html