Rebuilding website from root dump

Soldato
Joined
8 Nov 2005
Posts
4,477
A friend of mine has had a little falling-out with the small-time media 'agency' he has been employing to design and host his company's website (the short version is they were falling well short of their SLA's and they threw their toys out of the pram over it) and has been given a 'dump' of the site as it last stood and told to 'do it himself' if he doesn't like things as they are/were.

I've got a hosting package it could sit on for the time being, and I'm in the process of getting the domain under my control and pointing everything in the right direction, but I'm utterly baffled with the files for the website itself.

I've got two folders in a .zip that the previous 'hosts' have sent through; one contains all the website files and the other seems to be the SQL database that tied it all together.

The problem I have is that I have no idea how to get the website back up-and-running again with what I've got to hand. I can get the website structure online easy enough, but how do I tie the SQL database in with that?

Is that even possible? And if so, how?
 
Okay, that sounds relatively straightforward. Well, I understand what you mean anyway - the actual doing might prove my downfall.

When you mention this config file, would that be in the website files themselves? As in some of the pages would be coded to point to one location and I'll need to change that line of code to point to the new one?

As it currently stands, the website is relatively simplistic in its structure. It looks like the SQL database was used to generate the product pages and handle the various customer logins used to browse the products.
 
Everything seems to be written in PHP.

I can see from one of the pages (showproductrange.php) that it references a connect.php file for the SQL database. And looking at that file, that shows the various paramaters for the database itself - db_host, db_name, username, password, etc.

So, I guess it's that connect.php file that I'll need to fiddle about with in order to get everything talking to each other?

And with the database itself, I'm in my cPanel and I can see where to create a new MySQL database, but where do I go from there? I guess I'll need to change the code in connect.php to reflect the new database name, username and password that I create, but how do I get the content of the old one into the new one?
 
Okay, I think I've figured at least part of it out by using parts of my brain that I thought were long lost.

First off I've created a new database and a new user and then married the two together - although I have no idea what permissions to give said user.

Once the database has been created, I've headed into the phpMyAdmin area and imported the data from the old SQL database into the new one - I think.

And then I've amended the connect.php file with the new information, which I presume just needs to be uploaded to the right place on the server and then wait for the magic to happen.

Am barking up the right tree?
 
Okay, quick update with all of this.

I followed the steps I suggested in Post #6 and uploaded the updated connect.php file, but I'd obviously done something wrong along the line as I was getting various error messages on the pages that looked like this:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in

I assumed that I'd mucked up in importing the SQL database in some way as the code itself hadn't been changed, but while I could see what was on each of the lines the error messages were referring to, I had no idea what they meant!

So, having ran out of knowledge/luck I called in reinforcements in the shape of my hosts, as Van Hellseek had suggested. Admittedly I was a little cautious in doing this as I didn't really think this fell under their remit, but to my absolute astonishment they didn't bat an eyelid and had everything sorted out within a couple of hours of my original ticket being raised.

And they even managed to make a few other changes along the way that fixed a couple of other niggles that cropped up - and all without breaking a sweat and with the consumate professionalism that I've come to expect from them.

So, massive thanks to al the lovely people at Tsohost and thanks to the four people who posted in this thread and helped me along the way. I'm in your collective debt.
 
Back
Top Bottom