-
August 6th, 2008, 03:32
#1
مدیر کل
چگونگی انتقال یک فروم بزرگ از سرور a به سرور b
How to move a large forum from Server A to Server B?
Prerequisite: Change the DNS TTL values on the old server for your forums domain to 600 or 900 for faster DNS cutover. This should be done at least 24 hours in advance of the move.
Moving a website with large databases is a pain. In our case we were moving a forum to a new server. Both servers run cpanel / WHM on the backend. A first try to move the entire site with the built-in WHM site moving tool failed. The reason was the large database attached to the account. Backing up the database is not a problem, but using an automated process to restore just times out. The next thing we tried was to generate a full backup from cPanel for the domain, move the file over and restore it from backup via WHM. The same problem appeared and the process failed due to time out issues. But the good thing out of this was that the domain except for the database was fully restored. All file permissions, folder settings, DNS, etc was ready to go. The database itself was created, but of course incomplete.
So, when decided to use a different approach. Instead of working with a database dump we decided to copy the database files itself. Here are the steps that worked for us:
On the old Server
1) Close the forums
2) Stop MySQL (logged in as root to the server)
service mysql stop
3) Switch to the location of all MySQL databases. Copy the database files to your backup directory.
cd /var/lib/mysql
cp -r /username_databasename /username_databasename
4) Restart MySQL
service mysql start
5) Switch to your backup directory
cd /backup
6) TAR the database directory for better transfer to the new server
tar cf forumsdatabase.tar username_databasename
7) Copy file to current Auswanderer-Forum Folder
cp username_databasename /home/username/public_html/username_databasename.tar
On the new Server
8) Switch to the new server and SSH as root into the server. Switch to your downloads folder and download the forums database
wget http://www.example.com/username_databasename.tar
9) Untar the file
tar xf username_databasename.tar
10) Stop MySQL service mysql stop
11) Backup old database from the earlier efforts to restore the database
cd /var/lib/mysql
mv username_databasename username_databasename.saved
12) Copy the database from the downloads folder into the final destination
cp -pfr /downloads/username_databasename username_databasename
13) Reset permissions to make sure the database files are accessible by MySQL
chown mysql username_databasename
chgrp mysql username_databasename
14) Restart MySQL
service mysql start
You are pretty much done at this point. Test the forum via IP address for functionality. Open the forum when everything looks good. On the old server change the IP address in DNS to point to the new server. Then go and change the DNS server information on the registry level to point to the DNS servers of the new server. Within 30 minutes the domain name should point to the new server where the forum is hosted. Do not delete the old domain account from the old server just yet. I recommend to leave it online for another 48 hours at least to make sure everyone finds the new server.
Your mileage might vary, but for us this worked just fine when moving a forum with a 1 GB database. Please make sure you have appropriate access to both servers and that you are comfortable in executing the steps described below. Be aware that stopping MySQL will affect all websites on a server that use MySQL. Please use the help of an experienced administrator if needed. Good luck.
برای پیش رفت در علم آسانسوری وجود ندارد پله ها را باید پیاده رفت /./ همیشه این یادتان باشد که دست بالای دست بسیار است.
يادمان باشد براي يك بار ايستادن صد ها بار افتاده ايم /./ بک آپ مهمترین رمز موفقیت هاستینگ /./ امنیت مطلق نیست.
ارتباط مستقیم با من :
Admin -{(@)}- WebHostingTalk . ir
-
تعداد تشکر ها ازVahid به دلیل پست مفید
-
August 6th, 2008 03:32
# ADS