
最近、私のサーバーがクラッシュしました。ホスティング会社は交換用ドライブに新しい CentOS をインストールし、古いドライブを私のサーバーに接続しました。新しいサーバーに cPanel をインストールしてセットアップし、古いサーバーと同様のユーザー アカウントなどを作成しました。
public_html の転送は、データのコピー アンド ペーストだけなので簡単です。古い SQL インストールから新しいサーバーにデータを移動するには、どのように進めればよいかを知りたいです。
何か助けて?
答え1
データベースサーバーはmysqlで、以前のOSはcentosで、DBを新しいディスクに移動するだけであると想定しています。
StackExchange フォーラムの 1 つでこの回答を見つけました。この方法を試しましたか?
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