One of our Biggest Clients Islamicboard.com is hosted with us and have its own server, They are a quite a big Islamic Forum with over 25,o00 Members and 1 Million posts and are running Vbulletin 4.
They decided to upgrade their forum from Vbulletin 3 to Vbulletin 4.0
Since we already did Ummah Forum upgrade which is 3 times as big as Islamicboard and since it took around 45 mins to upgrade, Islamicboard should have been a breeze in the Park for us
However we were Wrong.
Our Upgrade took a total of 19 hours to get the site back up and running! After running into Problems after Problems.
The reason why it took so long was due to the fact that the board was heavily modified with plugins and 3rd Party with customised tables and what not which made the job slightly difficult
So this is what happened
We uploaded the New Vbulletin Files to the Server
Ran the upgrade script
it froze half way through
So we tried to re-run it again, again it froze half way through at a particular step, i think Step 7 or 8 where it was doing something to the Index of the post table, after 1 hour of waiting for it to get past this stage browser froze and crashed it, at this stage we gave up, however the major problem we had now was that the “Post” table had been marked as crash, which was one of the main tables that contained all the threads and post, since there was over 1million posts on the forum repairing it wasn’t going to be easy, but nonetheless we tried running a table repair through PHPmyadmin this did not work and this stage the database was totally kapoot, in which at this stage we Had to restore from an earlier Backup, since this restore and upgrade was using alot of CPU and memory it grounded the server to a halt effecting MYSQL and other websites on the box. So we had to move the database over to another Server and repair and try to upgrade it on there.
So these are the steps we took
1) Took a backup of the database and Homedirectory
Logged on to shell
Ran the command
(This creates a full backup in a tar.gz format of the Entire website / database / mail / files etc)
This was done prior to the upgrade so we had a backup in place
2) Since the upgrade was using a lot of CPU and memory we moved the database to an empty server to reattempt the backup
So now we had to move the account from one server to another using SCP! Good old SCP!
The command to move a file from the Local to a Remote server is as follows
So being logged in to SSH to the local server i ran the following
scp name_of_the_account.tar.gz email@example.com:/home/
name_of_the_account.tar.gz <<< This is the name of the backup file we did in Step one
firstname.lastname@example.org << This is the name of the server we want to move this file too “root” being username “126.96.36.199” being the IP address (Obviously you would put your own IP address here)
:/home << the location where we want to move the file to..in this instance we wanted to move it to the /home directory
Hit Enter and it will ask you for your account password put that in then the files will transfer, since the total data was around 4 gig altogether this may take a while took us 1.5 hours to move over great thing about SCP it shows you progress bar and how long you got remaining!
3) Restore the Account
Now we have the .tar.gz file moved over time to restore the account, this can be done by simply typing in this command at SSH prompt
This will then restore the entire account to the server including databases, files, mails etc everything so we had an identical copy of the website on this new server. This is one way of doing it
However what we did instead of this was just to restore the Database, so what we did was created a new account on the server, uploaded the New Vbulletin 4 files to this new account (we started from fresh because the old account had a lot of folders and junk in there) So uploading the files did not take long. Once this was done at this stage we had a new account on this new server with just the vbulletin files on there nothing else, now time to restore the database back to this new account.
So this is what we do….
The file which we copied over contains the database file so we browser to the drive where this .tar.gz file is stored so at SSH we do
Now we want to extract the contents of what is in the .tar.gz
So we run this command
tar xvfz name_of_the_account.tar.gz
This will then extract everything from the tar.gz file and place it in a directory may take a while especially if it is big
Once this is done we browse to the mysql folder normally under
/name_of_account.tar.gz/mysql (Something like that)
Browse in this folder and you will find your mysql file in there
Now we want to restore this back so we run the following command, but FIRST we need to create a database, give it a username and password and give it permissions you can do this via Cpanel using MYSQL wizard
The command for restoring the database is (staying in the current directory)
mysql -u username -p nameofdatabase < database_file_name.sql
It will ask you for the password of the username for MYSQL which you have just created stick that in , hit enter and it will begin the restore! Unlike SCP you have no idea how long it will take or its progress..it will look as if its doing nothing but its important just to leave it, this process took around 5 hours to restore and don’t close your SSH window just let it run..it will say when it has complete
sooo 5 hours later we now have a database restored back to Vbulletin 3
So we try run the upgrade script and again and BINGO! alhumdulillah it works since we moved it on a more powerful server it had all the resources to use and the upgrade completed sucessfully! So now on this server we have a Forum running vbulletin 4 !
Of course we changed the nameservers back and forth to work easily!
Sounds quite a lot eh? Well this is just half way but not to worry the second part aint as bad..
Now we need to move this database back over to the original server
You can either do it account transfer via Cpanel but if your site or DB is more then 1 gig forget it! likely it will crash out! Better use good ole SCP 😀
So on the old Server We Terminate the account and we want to create it from scratch! Unless you want to keep what you have then no need to terminate just move the Database over and upload the files etc
So this is what we do…Terminate the account on old server, create a new one..then transfer the account
* So we make a backup of this account as we did before….
* SCP the tar.gz file of what we have just backed up the working version to the original server again what we did before using the same command but just changing the paths
* Restore the account using the command /scripts/restorepkg username.tar.gz
Again the moving of the account from one server to another took us 1 hours since it was a big database and the restoration of the account took 6 hours…
In this time we change the nameservers wait for it to resolve..wait for the restore to complete and there you have it!
Fully function upgraded forum
Of course useful info for those who have their own servers but as always..take care when attempting things like this!