
최근에 서버가 다운되었습니다. 호스팅 회사는 교체 드라이브에 새 CentOS를 설치하고 기존 드라이브를 내 서버에 연결했습니다. 새 서버에 cPanel을 설치하고 설정했으며 이전 서버와 유사한 사용자 계정 등을 만들었습니다.
public_html 전송은 데이터 복사-붙여넣기가 필요하므로 쉽습니다. 이전 SQL 설치에서 새 서버로 데이터를 이동하려면 어떻게 진행해야 하는지 알고 싶습니다.
도움이 필요하세요?
답변1
데이터베이스 서버는 mysql이고 이전 OS는 centos였으며 DB만 새 디스크로 옮기고 싶다고 가정합니다.
StackExchange 포럼 중 하나에서 이 답변을 찾았습니다. 이 방법을 시도해 보셨나요?
https://dba.stackexchange.com/questions/174/how-can-i-move-a-database-from-one-server-to-another
기존 서버
Stop mysql server
Copy contents of datadir to another location on disk (~/mysqldata/*)
Start mysql server again (downtime was 10-15 minutes)
compress the data (tar -czvf mysqldata.tar.gz ~/mysqldata)
copy the compressed file to new server
새 서버
install mysql (don't start)
unzip compressed file (tar -xzvf mysqldata.tar.gz)
move contents of mysqldata to the datadir
Make sure your innodb_log_file_size is same on new server, or if it's not, don't copy the old log files (mysql will generate these)
Start mysql