Re-installing a site & restoring a database

Have A Bug With Your Webdate Script. Ask For Help Here.

Re-installing a site & restoring a database

Postby redspan on Wed Jul 16, 2008 2:53 pm

Hi Paul,

You said:
if there are tables missing your script cannot communicate with certain areas of the database...

you need to export (backup) your entire database

then erase the database and create a new (empty one)

then install the webdate version and with plugins you wish to install upload plug ins after the main script,, then check off all the plug ins when running the install http://yoursite.com/install.php

after the script is up and running with the new database you can then go to phpmyadmin and import your old database... now all the required tables and fields should exist.

Hope you understand what I am getting at

also you might want to try and download a fresh copy of the install script from webscribbles site as the files do become corrupted on download at times.



1. I have a backup of the entire db.

2. I erased it and created a new, empty db.

3. I installed the site with all the plug-ins previously used. When I checked the new db I could see that it had 71 tables. The same number as in the backup. The site itself is visible in its default format, but of course, with no members.

4. The db backup is too large to import from phpmyadmin, so I have to do it from the command line on the server, but that produces a new problem:

Code: Select all
[root@xxxxx httpdocs]# mysql xxxxx < xxxxx.sql   
ERROR 1050 (42S01) at line 19: Table 'dt_address_book' already exists

So presumably I have to drop all the tables first, then restore the database.

5. So dropped the tables and and the restore command to rebuild the database.

Code: Select all
[root@xxxxx httpdocs]# mysql -u xxxxxx -p xxxxx < xxxxx.sql
Enter password:
[root@xxxxx httpdocs]#


Now, the site itself is not loading a page because it's waiting for something. It's just sitting there waiting for the page to load. In phpmyadmin I can see (eventually) that the database has been restored: 71 tables, and all the profiles.

I don't understand. What's gone wrong now? :cry:
redspan
 

Re: Re-installing a site & restoring a database

Postby paul on Wed Jul 16, 2008 3:11 pm

It appears your scheduler may be trying to perform a rather large task

open index.php

near line 33

find

require "engine/scheduler.php";

put // in front of this line and save

//require "engine/scheduler.php";

upload the saved file and retry the site.. does it load now?

Paul
User avatar
paul
Site Admin
 
Posts: 264
Joined: Sat Jan 26, 2008 7:30 pm
Location: Newington,Ct,USA

Re: Re-installing a site & restoring a database

Postby redspan on Wed Jul 16, 2008 4:43 pm

Thanks.

Tried that but it haasn't made any difference (so I've removed the // again to undo the change)
redspan
 

Re: Re-installing a site & restoring a database

Postby redspan on Wed Jul 16, 2008 5:18 pm

All the databases on my various sites on the server seemed to have hung, so I rang the hosting company and go them to check. They did something and all other sites (not the webdate) site returned to normal.

They say that the admin user ID is running a query that has billions (!) of rows to check, so it's likely to go on for hours. Clearly there's something wrong and the re-install hasn't fixed it.

The site is visible but anything that's needed from the database isn't visble e.g. all the text.
redspan
 

Re: Re-installing a site & restoring a database

Postby redspan on Wed Jul 16, 2008 5:35 pm

This is what the hosting company had to say:
I have restarted MySQL, but there are some problem queries that keep backlogging:
explain SELECT *, p.id, p.gender, p.name FROM (dt_profile p, dt_members m, dt_privacy pr) JOIN dt_photos f ON p.member_id = f.member_id WHERE (p.status='1' AND (pr.featured_yn IS NULL OR pr.featured_yn='') AND pr.member_id=m.id AND p.member_id=m.id AND p.gender='Female') ORDER BY p.lastlogin DESC LIMIT 1;
+----+-------------+-------+------+---------------+------+---------+------+------+----------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+------+----------------------------------------------+
| 1 | SIMPLE | p | ALL | NULL | NULL | NULL | NULL | 648 | Using where; Using temporary; Using filesort |
| 1 | SIMPLE | m | ALL | NULL | NULL | NULL | NULL | 761 | Using where |
| 1 | SIMPLE | pr | ALL | NULL | NULL | NULL | NULL | 656 | Using where |
| 1 | SIMPLE | f | ALL | NULL | NULL | NULL | NULL | 444 | Using where |
+----+-------------+-------+------+---------------+------+---------+------+------+----------------------------------------------+
4 rows in set (0.00 sec)

So that query is having to sort through 143630433792 rows for the xxxxx.com site. That query needs to be optimized or it will likely cause slow performance for MySQL and sites reliant upon them.
redspan
 

Re: Re-installing a site & restoring a database

Postby paul on Wed Jul 16, 2008 5:53 pm

the file located at

engine/pages/index.php

this file is creating the query that is jamming up your servers it is the file that calls to the database for the featured members

you can clear the original file and put this

Code: Select all
<?
   
   parseVariables("templates/index.html");
?>


this will skip the featured profiles on your home page

my guess is you have modified your genders from Male or Female and the script is unable to find your featured profiles

Let me know if this helps

or like I said send me FTP in a private message and I will get it resolved for you

Paul
User avatar
paul
Site Admin
 
Posts: 264
Joined: Sat Jan 26, 2008 7:30 pm
Location: Newington,Ct,USA


Return to Have A Bug? Ask For Help Here

Who is online

Users browsing this forum: No registered users and 5 guests

cron